tomearly
22 Aug 2011, 2:51 AM
Hi,
I'm using Ext Scheduler and can add events to the UI, and these seem to be added to the store (according to FireBug)
When I try and sync the store, nothing gets posted for the create call (i.e. the new records) or the update call, apart from the _dc param.
Here is the store code below, if you need more of the code let me know.
Thanks,
eventStore : Ext.create("Ext.data.Store", {
idProperty : 'id',
model : 'Sch.model.Event2',
restful:true,
autoLoad: true,
proxy: {
type: 'ajax',
api: {
create: 'myBackend.php?action=create', // Called when saving new records
read: '/cgi-bin/EV_Rostering_Events_Get.pl?branch=' + branch + '&view=' + view,
update: 'myBackend.php?action=update', // Called when updating existing records
destroy: 'myBackend.php?action=destroy' // Called when deleting existing records
},
reader: {
type: 'json'
},
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: false
}),
timeout: 10000
},
listeners: {
//add
add: function(store, records, index, options)
{
console.log(records);
},
update: function(store, records, index, options)
{
console.log('update event');
}
//remove
//update
}
})
I'm using Ext Scheduler and can add events to the UI, and these seem to be added to the store (according to FireBug)
When I try and sync the store, nothing gets posted for the create call (i.e. the new records) or the update call, apart from the _dc param.
Here is the store code below, if you need more of the code let me know.
Thanks,
eventStore : Ext.create("Ext.data.Store", {
idProperty : 'id',
model : 'Sch.model.Event2',
restful:true,
autoLoad: true,
proxy: {
type: 'ajax',
api: {
create: 'myBackend.php?action=create', // Called when saving new records
read: '/cgi-bin/EV_Rostering_Events_Get.pl?branch=' + branch + '&view=' + view,
update: 'myBackend.php?action=update', // Called when updating existing records
destroy: 'myBackend.php?action=destroy' // Called when deleting existing records
},
reader: {
type: 'json'
},
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: false
}),
timeout: 10000
},
listeners: {
//add
add: function(store, records, index, options)
{
console.log(records);
},
update: function(store, records, index, options)
{
console.log('update event');
}
//remove
//update
}
})