jqGrid不显示搜索按钮

时间:2012-07-13 12:49:48

标签: javascript jquery-ui jqgrid

我正在使用jqGrid显示我的数据,但它不显示搜索按钮。这是为什么?代码如下。

$("#grdOpenItems").jqGrid({
  url: 'api/matchingservicewebapi/GetAllMatchItemForClient',
  datatype: 'json',
  mtype: 'GET',
  caption: 'Open Items',
  jsonReader: { root: "rows", repeatitems: false, id : "0"},
  colNames: ['Id', 'Account', 'Amount', 'Ref'],
  colModel: [
    { name: 'Amount', index: 'Amount', width: 200 },
    { name: 'Account', index: 'Account', width: 300 },
    { name: 'Amount', index: 'Amount', width: 300 },
    { name: 'Ref', index: 'Ref', width: 300 }
  ],
  rowNum: 5,
  rowList: [5, 10, 15],
  multiselect: true,
  pager: '#pagerOpenItems',
  viewrecoreds: true,
  sortname: 'Id',
  sortorder: "desc",
  imgpath: 'Themes/images'
}).navGrid(pager, {
  edit: true, add: true, del: true, refresh: true, search: true,
  searchtext: "Search" });

但它显示带有图像的页面导航按钮,但不显示搜索和重新加载按钮。

1 个答案:

答案 0 :(得分:2)

一个问题:

viewrecoreds: true

应该是

viewrecords: true

我不相信jqGrid中的搜索功能是神奇的,这意味着你必须连接实际的搜索代码。看看documentation for search

相关问题