-
Unanswered: Ext.data.Store
Unanswered: Ext.data.Store
Hello to all,
my store initiates a create action although I have made an udpate.
Why ? Do I have to specify something else as well ?
Here is the code:
var jsWriter = new Ext.data.JsonWriter({
returnJson: true,
writeAllFields: true
});
var jsReader = new Ext.data.JsonReader();
var proxy = new Ext.data.HttpProxy({
api:{
read : '/ajax/remote?doAction=AJAX_loadAdditionalRemark',
create : '/ajax/remote?doAction=AJAX_saveAdditionalRemark',
update : 'app.php/settings/update', // Not needed yet
destroy : 'app.php/settings/destroy' // Not needed yet
}
});
var store = new Ext.data.Store({
baseParams:
{
docID: docID
},
id: 'setting',
proxy: proxy,
reader: jsReader,
writer: jsWriter,
autoSave: false,
listeners: {
load: {
fn: function(store, records, options)
{
// testing
var tn = document.getElementById('totalNumOfEULans').value;
for( i = 1; i <= tn; i++ )
{
Ext.getCmp('txtField' + i).setValue(store.getAt(0).data.text);
}
}
}
}
});
store.load();
....
Inside a button listener I do this:
var urec = store.getAt(0);
urec.set('text', 'New text set by the button');
var tn = document.getElementById('totalNumOfLans').value;
for( i = 1; i <= tn; i++ )
{
Ext.getCmp('txtField' + i).setValue(store.getAt(0).data.text);
}
alert('UI updated');
store.save();
alert('store save');
At this point I would expect to receive an update event. On the contrary a create event is being generated.
Thank you in advance
-
Sencha - Community Support Team
1. Store 'id' is deprecated. Use 'storeId' instead.
2. You are using metaData to configure the reader? Are you setting the correct idProperty?
-
Condor you are correct once again. 
Similar Threads
-
By Ex_Soft in forum Ext 3.x: Help & Discussion
Replies: 13
Last Post: 1 Mar 2011, 3:14 AM
-
By timbonicus in forum Ext 3.x: Bugs
Replies: 1
Last Post: 20 Aug 2010, 10:34 PM
-
By Roland D. in forum Ext 3.x: Help & Discussion
Replies: 3
Last Post: 26 Apr 2010, 6:58 AM
-
By nagavasantha in forum Ext 3.x: Help & Discussion
Replies: 2
Last Post: 9 Sep 2009, 7:34 AM
-
By reed in forum Ext 2.x: Help & Discussion
Replies: 3
Last Post: 9 Nov 2007, 3:30 AM
Tags for this Thread
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us