Jqgrid,带有用于Json返回的参数的调用URL [英] Jqgrid, call URL with parameters for Json return

查看:60
本文介绍了Jqgrid,带有用于Json返回的参数的调用URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在aspx页面上有以下代码:

i have the following code on my aspx page:

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

一切正常,但是我想知道是否可以调用发送一些参数的URL方法.我知道默认情况下,当您调用url方法时,jqgrid发送一些参数来控制网格的分页:

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 control 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)

据我所知,我不需要指定前3个参数,因为默认情况下jqgrid会这样做,但是如何发送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?

推荐答案

我自己解决了这个问题. 所有需要做的就是将参数作为查询字符串发送到url上:

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.

这篇关于Jqgrid,带有用于Json返回的参数的调用URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆