我的aspx页面上有以下代码:
jQuery("#listFondos").jqGrid({
url: '/PorMyController/LoadGridData/',
datatype: 'json',
mtype: 'GET',
colNames: ['col1', 'col2',...etc
Run Code Online (Sandbox Code Playgroud)
一切都运行正常,但我想知道是否可以调用URL方法发送一些参数.我知道默认情况下,当你调用url方法时,jqgrid会发送一些参数来控制网格的分页:
public ActionResult LoadGridData(string sidx, string sord, int page, int rows)
Run Code Online (Sandbox Code Playgroud)
所以,我想添加一个额外的参数来对要加载到网格中的数据进行一些过滤.例如,我想有这个:
public ActionResult LoadGridData(string sidx, string sord, int page, int rows, string filterId)
Run Code Online (Sandbox Code Playgroud)
据我所知,我不需要指定前3个参数,因为jqgrid默认会这样做,但是我如何发送filterId参数?
lid*_*min 13
我自己解决了这个问题.所需要做的就是在url上将参数作为查询字符串发送:
url: '/PorMyController/LoadGridData?filterId=123',...etc
Run Code Online (Sandbox Code Playgroud)
分页的默认参数将继续被发送,因此您只需指定其他参数.