【问题标题】:How do i pass an extra parameter to server using jqgrid and http method POST?如何使用 jqgrid 和 http 方法 POST 向服务器传递额外的参数?
【发布时间】:2010-09-10 12:59:24
【问题描述】:

我正在做类似这篇文章中的那个人的事情: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 添加额外的过滤器参数?

【问题讨论】:

    标签: asp.net-mvc jqgrid


    【解决方案1】:

    对于GET POST,您可以设置postData

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

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

    【讨论】:

    • Thx m8,这正是我想要的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-29
    • 2012-07-03
    • 1970-01-01
    • 2013-07-21
    相关资源
    最近更新 更多