Thilok Gunawardena
Thilok Gunawardena

Reputation: 924

jqGrid does not display search button

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.

Upvotes: 0

Views: 495

Answers (1)

AJ.
AJ.

Reputation: 16719

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.

Upvotes: 2

Related Questions