I'm developing a wordpress plugin that uses jqgrid plugin to show a list of elements. This list gets data from ajax request.
I have to buttons to make filters, depending on the button pressed the data in the jqgrid must show only the rows that one column had a value.
When I press the button, I do this:
var postdata = grid.jqGrid('getGridParam','postData');
jQuery.extend (postdata,
{
filters:'',
searchField: 'estado',
searchOper: 'eq',
searchString: that.text().substring(0, that.text().indexOf("(") - 1)
});
grid.jqGrid('setGridParam', { search: filtrar, postData: postdata });
grid.trigger("reloadGrid",[{page:1}]);
in searchString I pass the text in the button, that matches with the text value i'm looking for in te table.
My problem is that all buttons makes the jqgrid empty, except the first button that is for show all, this button works (but it makes no sense for mi, this button sends in searchString a text that is not in any row at the field 'estado').
estado is the name in the column that I want search:
{ label: 'Estado', name: 'estado', width: 70, height: 'auto', template: myFloatTemplate, datatype: 'html' },
thanks...