Results 1 to 4 of 4

Thread: Posta store to server

  1. #1

    Default Posta store to server


    We can use json objects to send the data to the client side using post or get method. That works perfectly cool. My concern is pther way round.
    Let say I have a data store and i want to send this data store to the server then what is the best approach to do that. Further do extjs provide any method for this.

    demoStore = new{
      id :'demoStore',
      data: [
      reader: new{id:'id'}, [

  2. #2
    Sencha Developer
    Join Date
    Sep 2008
    Antioch, IL


    I probably wouldn't attempt to batch update all records in a database - I'd probably just use the "add" or "update" events on the Store() object, sending the data for each record that gets added/edited as separate AJAX requests.

  3. #3


    Hi arthur,

    In scenarios, yes you are right, but my requirement says that all of the data is to be updated as a whole or nothing is to be updated, and hence i am maintaning the data store on the client side. Now since i am successfull in maintaining the data store throughout the process i do not want to convert it to some other format set it to some hidden field(or any other variable) and then send it across to server. Rather i am looking for a mechanism in which i can send the complete data store as it is, and will parse it as we do with the json stores.

    I hope you got my point.

    Saurabh Agarwal

  4. #4
    Sencha Developer
    Join Date
    Sep 2008
    Antioch, IL


    I suppose you could have a "save" button in your toolbar with the following handler:
    PHP Code:
    var dataArray = [];

    getData(record) { dataArray.push(; }


    params: {
    success: function(responseoptions) {}
    Basically, you just need to serialize each of the records in your store and send to the server. You could implement that in a number of ways, but I'd probably use the method above unless someone has a better implementation.

    Alternatively, you could use the save() method on the data store - which saves all *pending* changes to the store. Latching onto the "save" event, you could launch an AJAX call to the server containing only the records that have changed. The handler would be similar to what I described above, but only looping over the records with pending changes (not necessarily ALL records in the store).

Similar Threads

  1. server communication
    By triple in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 30 Mar 2010, 2:10 PM
  2. Grid Extension columns and store from server from server
    By qulys in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 23 Nov 2009, 2:09 AM
  3. Stop the server request from store ?
    By ritesh.kapse in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 9 Sep 2008, 7:08 AM
  4. Persist Store to server?
    By deitch in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 18 Oct 2007, 6:16 AM
  5. Saving data from a store to server
    By marco.braga in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 3 Sep 2007, 7:02 AM

Tags for this Thread

Posting Permissions

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