-
19 Feb 2008 5:16 AM #1
Submit grid store
Submit grid store
I have a form with 3 editable grids, i want to submit the Ext.data.Store into .php file. What should i do? here is the code
[PHP]Ext.onReady(function()
{
function formatDate(value){
return value ? value.dateFormat('M d, Y') : '';
}
;
var fm = Ext.form;
sm = new Ext.grid.RowSelectionModel();
var cm = new Ext.grid.ColumnModel([{
id:'chname',
header: "
-
19 Feb 2008 5:31 AM #2
Are you needing to submit all the data at once, or after each cell edit?
You might want to check out this tutorial to get a feel for grid editing, however it can be quite overwhelming.
http://extjs.com/learn/Tutorial:Ext2...itor_PHP_MySQL
-
19 Feb 2008 5:47 AM #3
i want to submit all information at once.even if information not change.
-
19 Feb 2008 5:50 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
And how would you like your data that is send to the server to be formatted?
-
19 Feb 2008 6:05 AM #5
i got 3 grids and i want 3 requests to diffirent php scripts
-
19 Feb 2008 6:09 AM #6
i just want to see simple example how can i submit data.store, and sorry for my english

-
19 Feb 2008 6:24 AM #7
I think something like this should work (never tried it with XML data though)
Inside your button handler...
Its likely that you will have to commit changes to the store before hand, or perform some other actions, but this should get you headed in the right direction.Code:form1.getForm().submit({ params: { data: Ext.util.JSON.encode(grid.getStore().reader.jsonData) } ... });
If you want to submit XML data instead of JSON, then im not sure what you need to do - personally I never use XML data.
-
19 Feb 2008 6:26 AM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
Example (simply JSON encode the records):
Code:Ext.Ajax.request({ url: 'submit.php', method: 'POST', params: Ext.encode(grid.getStore().getRange()), callback: function(options, success, response) { // do stuff } });
-
19 Feb 2008 6:30 AM #9
-
2 May 2008 3:11 AM #10
Does not work for me, i get the following error:Code:Ext.encode(grid.getStore().getRange());
too much recursion ?!



Reply With Quote
