1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    29
    Vote Rating
    0
    chriswa is on a distinguished road

      0  

    Default Recommended way to get EditorGridPanel to send changes back to the server?

    Recommended way to get EditorGridPanel to send changes back to the server?


    I've got a great looking EditorGridPanel using a Store hooked up to JSONReader. I have a quaint little server app spitting out the correct JSON and everything is working beautifully. Now I want to start sending my changes back to the server and am wondering which way to proceed. ExtJS has been pleasantly plug and play so far, but I can't seem to find any simple way to get ExtJS to start sending changes back to the server.

    The closest I've gotten on my own to an answer is in the description of Store.commitChanges:

    To handle updates for changes, subscribe to the Store's "update" event, and perform updating when the third parameter is Ext.data.Record.COMMIT.
    From which I gather that I'll need to hand-code something to compile a list of changes, then fire them off with my own custom AJAX requests. Do I really have to build my own AJAX postback system from scratch? Is there a class/plugin/extension out there that will save me from reinventing the wheel? Am I missing something obvious?

    Thanks in advance,
    Chris

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,167
    Vote Rating
    28
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    Hi chris,

    Yes, everytime you want to 'commit' to the store, you're going to want to fire of an XHR.

    My suggestion is to fire the XHR first, then fire the commit. This way when the XHR returns successful : true, then you know the db has been updated.

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  3. #3
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,167
    Vote Rating
    28
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    Welcome to the forums btw

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  4. #4
    Ext User
    Join Date
    Apr 2008
    Posts
    29
    Vote Rating
    0
    chriswa is on a distinguished road

      0  

    Default


    Thanks, glad to be here!

    After digging a little deeper, I found WriteStore and added a note to the Grid FAQ here:

    http://extjs.com/forum/showthread.ph...618#post156618