Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Submit grid store

  1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default 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: "

  2. #2
    Sencha User VinylFox's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,501
    Vote Rating
    8
      0  

    Default

    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

  3. #3
    Ext User
    Join Date
    Jan 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default

    i want to submit all information at once.even if information not change.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    And how would you like your data that is send to the server to be formatted?

  5. #5
    Ext User
    Join Date
    Jan 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default

    i got 3 grids and i want 3 requests to diffirent php scripts

  6. #6
    Ext User
    Join Date
    Jan 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default

    i just want to see simple example how can i submit data.store, and sorry for my english

  7. #7
    Sencha User VinylFox's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,501
    Vote Rating
    8
      0  

    Default

    I think something like this should work (never tried it with XML data though)

    Inside your button handler...
    Code:
    form1.getForm().submit({
      params: {
        data: Ext.util.JSON.encode(grid.getStore().reader.jsonData)
      }
    ...
    });
    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.

    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.

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    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
    	}
    });

  9. #9
    Ext User
    Join Date
    Jan 2008
    Posts
    14
    Vote Rating
    0
      0  

    Default

    thanks

  10. #10
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    139
    Vote Rating
    1
      0  

    Default

    Code:
    Ext.encode(grid.getStore().getRange());
    Does not work for me, i get the following error:
    too much recursion ?!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •