1. #1
    Ext User
    Join Date
    Nov 2008
    Posts
    88
    Vote Rating
    0
    sanraj is on a distinguished road

      0  

    Default post an array in ajax request

    Hi I am using Ext.ux.FileUploader extension to upload files.
    While making ajax request I want to pass array as a parameter
    Code:
    // Simple ajax form submission
    Ext.Ajax.request({
        form: 'some-form',
        params: 'foo=bar'
    });
    How can i pass array as a parameter?
    Is that possible?

    Thanx in advance.............

  2. #2
    Touch Premium Member
    Join Date
    May 2007
    Posts
    47
    Vote Rating
    0
    jimmy.honeycutt is on a distinguished road

      0  

    Default

    I believe you should be able to pass an array as a parameter.
    Code:
    // Simple ajax form submission
    Ext.Ajax.request({
        form: 'some-form',
        params: { paramName: [x, y, z] }
    });

  3. #3
    Sencha - Ext JS Dev Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,054
    Vote Rating
    19
    mschwartz has a spectacular aura about mschwartz has a spectacular aura about

      0  

    Default

    params: { array: Ext.encode(the_array) }

    You have to json_decode() $_REQUEST['array'] on the server side (PHP example, use whatever replacement for your server-side)

  4. #4
    Sencha User
    Join Date
    May 2011
    Posts
    17
    Vote Rating
    0
    leolox69 is on a distinguished road

      0  

    Default

    thanks mschwartz.

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    8
    Vote Rating
    0
    sreenath886 is on a distinguished road

      0  

    Default rply

    thanks yar

  6. #6
    Sencha User
    Join Date
    Nov 2012
    Location
    Banglore.
    Posts
    6
    Vote Rating
    0
    shashidhar.gr is on a distinguished road

      0  

    Default thanks ..

    i have spent full day to search this answer .. finally i got , thank you very much.....
    Quote Originally Posted by mschwartz View Post
    params: { array: Ext.encode(the_array) }

    You have to json_decode() $_REQUEST['array'] on the server side (PHP example, use whatever replacement for your server-side)