Threaded View

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Answers
    4
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default Answered: How to use extraParams?

    Answered: How to use extraParams?


    Hi,

    First I am sending a request (param) to the server and using the same PHP for another grid, but that grid doesn't give me data with passed param , but when I send param in the url I can get it done. When I searched for it, there is an object extraParams, I am using like,

    Code:
    {
        xtype: 'gridpanel',
        url: 'php/update.php',
        extraParams: {
            'columnname': selectedField
        }
    }
    This doesn't seem to work, it isn't sending the extra parameter. What am I doing wrong?

    Thanks.

  2. Where are you wanting to build the array of selected field values? You shouldn't do this on every checkbox select, but rather just prior to performing your AJAX call (I'm assuming on a button push somewhere?).

    Code:
    var selections = Ext.getCmp('your_grid_id').getSelectionModel().getSelection();
    var arr = [];
    Ext.each(selections, function(rec, index) {
        arr.push(rec.get('Field'));
    });
    You can then pass "arr" as your extra param during the AJAX call.

Thread Participants: 2