1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    235
    Vote Rating
    0
    chandan.behura is on a distinguished road

      0  

    Default pass array to server

    pass array to server


    Hi,
    How to pass a array having more than 100 values to server .
    when i am passing an array of 150 values the i am getting bad request from server side.
    how i will avoid that one in an efficient way.

    i have something like that,
    scond = [];//contains 150 value
    store.load({
    url : xyz.view,
    params :{
    sc : scond
    }
    });

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,623
    Vote Rating
    331
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't think this is really an ExtJS question. You need to devise the interface between you client and server and then implement accordingly.

    At a guess you may be hitting a length limit for a GET request. You might have more luck switching to a POST but that's just dodging the more important problem that you're trying to pass huge quantities of data as part of a load request.

  3. #3
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    570
    Vote Rating
    181
    Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold

      0  

    Default


    POST should handle it fine assuming he doesn't have a novel for each index. GET in IE is limited to ~2000 characters. Not sure about ie9 though. POST is a server setting usually in the meg range. I do agree that the amount of data should be limited if possible, but I can see there being a use-case for a 150 element array. Also, I would probably Ext.encode it. Passing arrays like that is ugly IMO.

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    235
    Vote Rating
    0
    chandan.behura is on a distinguished road

      0  

    Default


    Quote Originally Posted by Tim Toady View Post
    POST should handle it fine assuming he doesn't have a novel for each index. GET in IE is limited to ~2000 characters. Not sure about ie9 though. POST is a server setting usually in the meg range. I do agree that the amount of data should be limited if possible, but I can see there being a use-case for a 150 element array. Also, I would probably Ext.encode it. Passing arrays like that is ugly IMO.
    Hi Tim,

    As I am passing an array

    lets say myArray = [],
    and My array contains [xyz,pqr,abc] like that
    bt when i am encoding it lik,Ext.encode(myArray) it seems like ["xyz","pqr","abc"]


    so i am getting an server side exception for encoding case

  5. #5
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    570
    Vote Rating
    181
    Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold

      0  

    Default


    My mentioning encode wasn't really related to the issue you were having. Just a personal preference in the way to send it. You would then have to decode it on the server. To switch your store to post on read, you would use the following

    http://docs.sencha.com/ext-js/4-1/#!...-actionMethods

Thread Participants: 2

Tags for this Thread