views:

18

answers:

1

I'm doing something like the guy in this post: http://stackoverflow.com/questions/3311929/is-there-a-way-to-programatically-set-a-filter-in-jquery-jqgrid

I'm using http method POST to to get data from my MVC2 project and i saw that you can add a parameter using GET doing like this:

You can modify the url that jqGrid calls, and add the filter option to the querystring, then handle it on the server side.

    $(link).click(function(){

    $(".mygrid").jqGrid('setGridParam',{url:"server.php?useMyFilter=1"})
    });

How can i add a extra filter parameter using POST?

+1  A: 

For both GET and POST you can set postData:

$(".mygrid").jqGrid('setGridParam',
{
     url:"server.php",
     postData: {
         useMyFilter: 1
     }
});

Note that your call to jqGrid() is missing a ;

Craig Stuntz
Thx m8, that was exactly what i was looking for.
larole