4

I'm doing something like the guy in this post: 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?

Community
  • 1
  • 1
larole
  • 172
  • 1
  • 3
  • 7

1 Answers1

5

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
  • 125,891
  • 12
  • 252
  • 273