PDA

View Full Version : Problem with Store's Update event



varunjyoti
12 Jul 2012, 3:01 AM
I have 2 stores attached to 2 different grids.


Ext.define('DG.store.Roles', {
extend: 'Ext.data.Store',
model: 'DG.model.Role',
storeId: 'rolesStore',
proxy: {
type: 'ajax',
url: 'http://'+hostIP+'/dgcontroller/RoleServlet?json={"command":"getAllRoles"}',
reader: {
type: 'json',
root: 'result',
successProperty: 'success'
}
}

});






Ext.define('DG.store.Agents', {
extend: 'Ext.data.Store',
model: 'DG.model.Agent',
storeId: 'agentsStore',
proxy: {
type: 'ajax',
url: 'http://'+hostIP+'/dgcontroller/ListAllDgAgents',
reader: {
type: 'json',
root: 'result',
successProperty: 'success'
}
}



});


In the grid attached to the first store, when i open the grid editor to update the data and press update button without changing anything(without actually editing), the "update" event of store does not get fired. In second grid though, when i perform the same thing, the "update" event fires. What could be the reason for this? I want the behaviour of both the stores to be consistent.

scottmartin
13 Jul 2012, 9:04 PM
press update button without changing anything(without actually editing)

I am a bit curious about the above statement... in the demo, update is not enabled unless you edit
a value .. is your button enabled?

see:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/row-editing.html

Scott.

varunjyoti
15 Jul 2012, 9:55 PM
Yes. It is enabled even if i haven't made any change. Using 4.0.5 version.



Ext.define('DG.view.agent.Grid', {
extend: 'Ext.grid.Panel',
alias: 'widget.agent_grid',
//title: 'Add / Edit / Delete Agent',
frame: true,
xtype: 'gridpanel',
scroll: false,
store: 'Agents',
columns: [
{
text: "ID",
flex:0.2,
dataIndex: 'agentId',
sortable: true
},
{
text: "Name",
flex: 1,
dataIndex: 'agentName',
sortable: true,
editor: {
allowBlank: false,
blankText : 'Agent Name field is required',
emptyText: 'ex : Oracle Disc Agent'
}
},
{
text: "Hostname / IP",
flex: 1,
dataIndex: 'hostName',
sortable: true,
editor: {
allowBlank: false,
blankText : 'Host Name field is required',
emptyText: 'ex : localhost'
}

}],
plugins: [Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false

})
]
});

scottmartin
16 Jul 2012, 6:14 AM
This is most likely a bug in the version you are using. It is recommended you upgrade to the latest release as there where many updates.

Scott.

icebergdelphi
16 Jul 2012, 6:41 AM
Maybe my same problem: http://www.sencha.com/forum/showthread.php?230623-Extjs-4.1.1-does-not-save-nothing