0

I'm using a jqGrid to display my data, but it does not display the search button. Why is that? Code is below.

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

But it displays the page navigation buttons with images, but not the search and reload button.

dda
  • 6,030
  • 2
  • 25
  • 34
Thilok Gunawardena
  • 924
  • 5
  • 22
  • 44
  • Related issue(s): http://stackoverflow.com/questions/1435001/navgrid-not-working-with-jqgrid AND http://stackoverflow.com/a/4027331/1220302 with some points to consider – anAgent Jul 13 '12 at 13:03

1 Answers1

2

One problem:

viewrecoreds: true

should be

viewrecords: true

I don't believe the searching functionality in jqGrid is magical, meaning you have to wire up actual search code. Take a look at the documentation for search.

AJ.
  • 16,368
  • 20
  • 95
  • 150