PDA

View Full Version : Editor grid staying dirty



nar
31 Oct 2010, 4:20 PM
Having some trouble getting my editor grid working. I've been looking at this all day and I know I am missing something small. The grid loads, I can click and edit the record and have a request go to the server and have JSON returned but the record stays dirty. Here is what I am working with:

Initial JSON used to load store:


{"success":"true","rows":[{
"status" : "Subscriber",
"user_id" : "3",
"last_name" : "Doe",
"first_name" : "John"
}
]}


items: new Ext.grid.EditorGridPanel({
height: 250,
clicksToEdit: 1,
store: new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
api: {
read: '../xxxx',
update: '../xxxx'
}
}),
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: true
}),
root: 'rows',
idProperty: 'user_id',
successProperty: 'success',
fields: [
'user_id',
'first_name',
'last_name',
'status'
],
autoLoad: true,
autoSave: true,
nocache: true,
baseParams:{
store: 'membership_updater'
}
}),
loadMask: true,
viewConfig: {
forceFit: true
},
cm: new Ext.grid.ColumnModel([
{header: 'First Name', sortable: true, dataIndex: 'first_name'},
{header: 'Last Name', sortable: true, dataIndex: 'last_name'},
{header: 'Status', dataIndex: 'status', editor: new Ext.form.ComboBox({typeAhead: true, store: new Ext.data.ArrayStore({fields: ['id','displayText'],data: [[1, 'Member'], [2, 'Subscriber']]}),typeAhead: true, triggerAction: 'all',lazyRender:true,valueField: 'id', displayField: 'displayText'})}
]),
})
JSON returned after cell edit:


{"success":"true","rows":[{
"status" : "Member",
"user_id" : "3",
"last_name" : "Doe",
"first_name" : "John"
}
]}
Any direction on where I am going wrong would be great, thanks guys.

plalx
31 Oct 2010, 6:29 PM
Listen to the exception event of the store to see if there's anything wrong when trying to parse the data...