Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: [SOLVED]serialize object

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

    Default

    Code:
    var data = [];
    Ext.each(grid.getSelectionModel().getSelections(), function(rec){
      data.push(rec.get('id'));
    });
    Ext.Ajax.request({
      url: 'myurl',
      params: {
        id: data
      },
      success: function(){
        // do something
      },
      failure: function(){
        // do something else
      }
    });

  2. #12
    Sencha User
    Join Date
    Nov 2010
    Posts
    47
    Vote Rating
    0
      0  

    Default

    i tried this but data is showing properly in firebug but when i receive it server its showing me as null. In my data object i have two params. id and a boolean value but when i retreive them in my restful webservice its null. what maybe the issue? i am stuck in it.

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

    Default

    Does your server know how to handle multivalued parameters like 'id' in the previous example (e.g. in Java you need to use request.getParameterValues instead of request.getParameter)?

    Alternatively, you could concatenate the array values, e.g.
    Code:
    params: {id: data.join(';')}

Page 2 of 2 FirstFirst 12

Posting Permissions

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