tags:

views:

1165

answers:

3

Hi, i have the following code on my aspx page:

jQuery("#listFondos").jqGrid({
    url: '/PorMyController/LoadGridData/',
    datatype: 'json',
    mtype: 'GET',
    colNames: ['col1', 'col2',...etc

Everything is working fine, but i'm wondering if is it possible to call the URL method sending some parameters. I know that by default, when you call the url method, jqgrid sends some parameters to controll paging of the grid:

public ActionResult LoadGridData(string sidx, string sord, int page, int rows)

So, i want to add an extra parameter to make some filter on the data that is going to be loaded into the grid. For example i would like to have this:

public ActionResult LoadGridData(string sidx, string sord, int page, int rows, string filterId)

As i know, i don't need to specify the first 3 parameters, cause jqgrid does it by default, but how do i send the filterId parameter?

Thanks for your help.

A: 

I solve the problem myself. All that is needed to do is send the parameter as querystring on the url:

url: '/PorMyController/LoadGridData?filterId=123',...etc

The defaul parameters for paging will keep being sended, so you only have to specify the additional parameters.

lidermin
A: 

You can specify a function instead of a named datatype for the datatype parameter. Then in that function you can manually do a jQuery .ajax call with whatever parameters you want. This thread has a good example: here. (Specifically the last answer).

maxpower47
A: 

What will be the url if i am returning json data from aspx file in simple asp.net application. I am not talking about asp.net MVC.

Suman