I have a jqGrid with a navGrid. When the user has clicked the search icon, and has run a search, is there any visual cue that the rows in the grid have been filtered? If not, is there a convenient or standard way for adding such a cue?
This is such a general question that perhaps I don't need to show any code. But just in case you want to see it, the code for the grid is as follows:
// Define the grid.
$("#messages_grid").jqGrid({
datatype: "local",
colNames:[
'Date/Time',
'Type',
'Details'
],
colModel :[
{name:'DateTime', index:'DateTime', width:200, align:'left', sorttype:'text'},
{name:'Summary', index:'Summary', width:100, align:'left', sorttype:'text'},
{name:'Details', index:'Details', width:830, align:'left', sorttype:'text'},
],
height: 'auto',
rowNum: 3,
rowList: [3, 6, 9, 12, 15],
pager: '#messages_pager',
viewrecords: true,
caption: 'Messages',
ignoreCase: true,
});
// Add the navGrid, which contains things like the search icon.
$("#messages_grid").jqGrid('navGrid', '#messages_pager', { edit: false, add: false, del: false });
Rows are added to the grid programmatically, by calling the following function:
function AddMessage(summary, details) {
// Add the new row to the grid.
var grid = jQuery("#messages_grid");
var new_id = $("#messages_grid").getGridParam("reccount") + 1;
var new_data = { DateTime: new Date(), Summary: summary, Details: details };
grid.addRowData(new_id, new_data);
// Set the sort order so that new messages appear at the end.
grid.jqGrid().setGridParam({sortorder: "asc"});
grid.jqGrid("sortGrid", "DateTime", true);
// Set the page to the last page
var last_page = grid.getGridParam('lastpage');
$("#messages_grid").setGridParam({page: last_page});
// Reload the grid.
$("#messages_grid").trigger("reloadGrid")
// Select newest row.
$("#messages_grid").setSelection(new_id, true);
}
Thank you!