gpt4 book ai didi

asp.net-mvc - 如何使用 jqgrid 和 http 方法 POST 将额外的参数传递给服务器?

转载 作者:行者123 更新时间:2023-11-30 23:59:05 26 4
gpt4 key购买 nike

我正在做类似这篇文章中的人的事情:is there a way to programatically set a filter in jquery jqgrid?

我正在使用 http 方法 POST 从我的 MVC2 项目中获取数据,我看到您可以使用 GET 添加参数,如下所示:

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"})
});

如何使用 POST 添加额外的过滤器参数?

最佳答案

对于两者 GETPOST您可以设置 postData :

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

请注意,您调用 jqGrid()缺少 ;

关于asp.net-mvc - 如何使用 jqgrid 和 http 方法 POST 将额外的参数传递给服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3684779/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com