0

I have a page master tracker which is showing some records along with the status,

My question is ...How can I search the records on the basis of the status dynamically?

I searched the problem but no results, all the are are providing is filter toolbar or dynamic filters in search option, In my situation I need to search without hitting the search icon from the JSON data I received.

I am using following code to filter the jqgrid data

var searchFilter = $('input[id$="hfSearchFilter"]').val()
   f (searchFilter != "")
   {
      var grid = $("#jQGridDemo"), f;
      f = { groupOp: "OR", rules: [] };
      f.rules.push({ field: "STATUS", op: "eq", data: searchFilter });
      grid[0].p.search = true;
      $.extend(grid[0].p.postData, { filters: JSON.stringify(f) });
      grid.trigger("reloadGrid", [{ page: 1, current: true }]);
   }

I have data like,

 Type         status
Employement WIP
education WIP
Court On Hold
Reference WIP
from the above code my requirement is to filter just "On Hold" records as my search filter is On Hold only

I dont want the user to click on search button as I want the filtered records on page load out of the received json data.

any help?

Sachin
  • 11
  • 1
  • 4
  • If you use `datatype: "local"` then you can filter/search locally. You need to set `search: true` option, set `filters` property of `postData` option and trigger `reloadGrid` finally. See [the answer](http://stackoverflow.com/a/5750127/315935), [this one](http://stackoverflow.com/a/13247251/315935), [this one](http://stackoverflow.com/a/5273385/315935) and so on. – Oleg Dec 04 '14 at 15:41
  • hello Oleg, I have provided the code which i am using to filter the jqgrid but it is not working as expected. – Sachin Dec 15 '14 at 07:35

0 Answers0