Results 1 to 4 of 4

Thread: how to change the structure of post data [with store's restful option]

  1. #1

    Exclamation how to change the structure of post data [with store's restful option]

    now use spring 3 mvc and extjs restful to save the record.
    but the data post by extjs is like this: {"undefine":{"id":"01234567"}}.
    i just want the data like this: {"id":"01234567"} and spring will auto inject into javabean by reflection.
    so can i change the post data structure by extjs config or not?
    thank you !

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You can post anything you want by specifying a render method in your JsonWriter config.

  3. #3

    Default

    thank you so much , can you give me an example?

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Something like:
    Code:
    writer: new Ext.data.JsonWriter({
      ...
      render: function(params, baseParams, data) {
        var jdata = Ext.apply({}, data, baseParams);
        params.jsonData = jdata;
      }
    })
    Disclaimer: Completely untested code!

Similar Threads

  1. Restful Store Example - totalProperty/No Data
    By sportda in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 13 Oct 2010, 7:02 AM
  2. Does data store have config control to change GET,POST,OPTIONS, etc?
    By whippersnapper in forum Ext Designer: Help & Discussion
    Replies: 1
    Last Post: 21 May 2010, 12:11 PM
  3. Restful in data store
    By 720 in forum Ext Designer: Help & Discussion
    Replies: 0
    Last Post: 23 Apr 2010, 2:47 AM
  4. [SOLVED][3.1.1] restful paging directStore - no data in POST
    By danellison in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Mar 2010, 1:28 PM

Posting Permissions

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