aacoro
13 Aug 2011, 5:55 AM
Hi all,
I'm desperatly trying to get Ext JS working well with CodeIgniter. I can feed my grid from CodeIgniter but after a edit I send back the data to CodeIgniter in JSON format, but then I cannot read it??
I have posted also in the CodeIgniter Forum: http://codeigniter.com/forums/viewthread/196636/
This is my store:
var taskStore = Ext.create("Ext.data.JsonStore", {
autoLoad: {start: 0, limit: 25},
remoteSort: true,
autoSync : false,
pageSize: 10,
model : Ext.define("UnplannedTask", {
extend : "Ext.data.Model",
fields : [
{name : 'Id', mapping : 'tp_pk'},
{name : 'Code', mapping : 'code'},
{name : 'Description', mapping : 'description'},
{name : 'Duration', mapping : 'duration'},
{name : 'Completion', type: 'date', dateFormat: 'Y-m-d h:i:s', mapping : 'requested_completion'},
{name : 'CustomerId', mapping : 'fk_customer'}
]
}),
proxy: {
method: 'post',
api : {
read : baseUrl + '/index.php?r=task/ProcessTask/index',
create : baseUrl + '/index.php?r=task/ProcessTask/create',
update : baseUrl + '/index.php?r=task/ProcessTask/update',
destroy : baseUrl + '/index.php?r=task/ProcessTask/delete'
},
type: 'ajax',
reader: {
type: 'json',
totalProperty: 'total',
successProperty: 'success',
root: 'tasks',
idProperty: 'taskId',
},
writer: {
type: 'json',
idProperty: 'taskId',
allowSingle: false,
listful : true,
nameProperty: 'mapping',
writeAllFields: true,
root: 'tasks',
listeners : {
success : function (response) {
console.log("try to commit...");
taskStore.commitChanges();
}
}
}
}
});
Any suggestions why the JSON cannot be read in CodeIgniter??:((
I'm desperatly trying to get Ext JS working well with CodeIgniter. I can feed my grid from CodeIgniter but after a edit I send back the data to CodeIgniter in JSON format, but then I cannot read it??
I have posted also in the CodeIgniter Forum: http://codeigniter.com/forums/viewthread/196636/
This is my store:
var taskStore = Ext.create("Ext.data.JsonStore", {
autoLoad: {start: 0, limit: 25},
remoteSort: true,
autoSync : false,
pageSize: 10,
model : Ext.define("UnplannedTask", {
extend : "Ext.data.Model",
fields : [
{name : 'Id', mapping : 'tp_pk'},
{name : 'Code', mapping : 'code'},
{name : 'Description', mapping : 'description'},
{name : 'Duration', mapping : 'duration'},
{name : 'Completion', type: 'date', dateFormat: 'Y-m-d h:i:s', mapping : 'requested_completion'},
{name : 'CustomerId', mapping : 'fk_customer'}
]
}),
proxy: {
method: 'post',
api : {
read : baseUrl + '/index.php?r=task/ProcessTask/index',
create : baseUrl + '/index.php?r=task/ProcessTask/create',
update : baseUrl + '/index.php?r=task/ProcessTask/update',
destroy : baseUrl + '/index.php?r=task/ProcessTask/delete'
},
type: 'ajax',
reader: {
type: 'json',
totalProperty: 'total',
successProperty: 'success',
root: 'tasks',
idProperty: 'taskId',
},
writer: {
type: 'json',
idProperty: 'taskId',
allowSingle: false,
listful : true,
nameProperty: 'mapping',
writeAllFields: true,
root: 'tasks',
listeners : {
success : function (response) {
console.log("try to commit...");
taskStore.commitChanges();
}
}
}
}
});
Any suggestions why the JSON cannot be read in CodeIgniter??:((