PDA

View Full Version : Updating grid with store sync via PHP back-end



hlong290494
28 Oct 2012, 8:21 PM
Hello, I'm new to Ext JS 4.
I am writing an application to make changes between the Grid and the Back-end. :)

My store :


Ext.define('DirectoryAdmin.store.members.Members', {
extend: 'Ext.data.Store',
model : 'DirectoryAdmin.model.members.Member',
autoLoad: true,

proxy : new Ext.data.HttpProxy({
type : 'ajax',
api: {
read: '../data/getMemberList',
update: '../data/updateMemberBasicInfo'
},
reader : {
type : 'json',
root : 'members',
successProperty : 'success'
},
writer: {
//encode : true,
root : 'data'
}
}),
});


when I update the store by:

this.getStore('members.Members').sync();

I can see there is an AJAX request to the url I specified, along with some JSON things in the "Post" tab of Firebug. However, at the back-end PHP script, when I


print_r($_POST);

it did not give me anything ?

Do you know why ? When I uncomment the "encode" property from the writer proxy, it just works but I really want to know how Ext JS proxies work.

Thank you.

mitchellsimoens
31 Oct 2012, 5:59 AM
That's because it doesn't get put as a POST param. Look at


file_get_contents('php://input')