jqGrid“_search”参数一直是假的

jqGrid "_search" parameter is false all the time

我在我的代码中使用了 jqGrid,但遇到了一点问题。
这是来自 asd.jsp:

的代码
jQuery().ready(function ()
{

    $("#myGridId").jqGrid({
        url: "getListAsd.jsp",
        datatype: "json",
        colNames: ['menu', 'name', 'price'], 
        colModel: [
            {index: "menu", width: 250, sortable: true, editable: true, edittype: "text"},
            {index: "name", width: 250, sortable: true, editable: true, edittype: "text"},
            {index: "price", width: 100, sortable: true, editable: true, edittype: "text", align: "right"}
        ],
        rowNum: 35,
        height: 780,
        autowidth: false,
        sortname: "price",
        sortorder: "desc", 
        viewrecords: true,         
        pager: '#gridpager',
    })                
            .jqGrid('filterToolbar', { searchOnEnter: true, enableClear: true }) // make search available in each column
            .navGrid('#gridpager', {edit: true, add: true, del: true, search: false, view: false},
                    {multipleSearch: true} // search options
            );
});

这是来自 getListAsd.jsp 的代码:

if (request.getParameter("_search") != null) {
    search = java.lang.Boolean.parseBoolean(request.getParameter("_search"));
}
if (search) {
    // some search things here...
}

在 gridpager 中我需要 search: false 因为我想在每一列中搜索而不是使用默认搜索按钮。
所以问题是 _search 总是错误的。

问题已解决。 jqGrid 似乎需要 name 属性才能在列内正确执行搜索。
来自 asd.jsp 的新代码:

colModel: [
        {name: "menu", index: "menu", width: 250, sortable: true, editable: true, edittype: "text"},
        {name: "name", index: "name", width: 250, sortable: true, editable: true, edittype: "text"},
        {name: "price", index: "price", width: 100, sortable: true, editable: true, edittype: "text", align: "right"}
    ],