View Full Version : int encode as string, json writter

10 May 2010, 1:24 AM
i have model

var SiteModel = new Ext.data.Store({
id: 'SiteModel',
proxy: new Ext.data.HttpProxy({
api: {
read : '/lcms/wizard/site_all/'+ LCMS.getLesson(),
create : '/lcms/wizard/site_add',
update: '/lcms/wizard/site_edit/',
destroy: '/lcms/wizard/site_delete/'
reader: new Ext.data.JsonReader({
totalProperty: 'totalCount',
successProperty: 'success',
idProperty: 'id',
root: 'data',
messageProperty: 'message'
name: 'id',
type: 'int'
name: 'title',
allowBlank: false
name: 'type',
allowBlank: false
name: 'xml',
allowBlank: false
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: false,
returnJson: true
autoSave: true,
autoLoad: true

when i delete my site, my post look like that:

'uri' => string '/lcms/wizard/site_delete/' (length=25)
'data' => string '"21"' (length=4)
'PHPSESSID' => string 'nu0hlc1padsovr9tuspcja4kj4' (length=26)

why ? data should be int '21'