I am using the jqGrid Filter toolbar. I am testing it for 2 columns, one numeric and another alphanumeric.
All operations with the filter through the filter toolbar are performed using the "bw" operator (starts with).
How to configure the operation I want to perform using a column?
In this case, I want to use "eq" in the numeric column and "cn" in alphanumeric format.
btw, if I use the advanced search dialog, everything works correctly.
Thanks!
Here is my implementation:
$('#EntityListGrid').jqGrid({ url: '<%= ResolveUrl("~/Controls/EntityManager/Controllers/EntitiesController.ashx?method=GridDataList") %>', datatype: 'json', mtype: 'GET', colNames: ['ID', 'Name', 'Actions'], colModel: [ { name: 'EntityID', index: 'EntityID', width: 50, align: 'left', resizable: true, sortable: true, sopt:['eq'] }, { name: 'Name', index: 'Name', width: 250, align: 'left', resizable: true, sortable: true }, { name: 'act', index: 'act', width: 75, sortable: false, search: false }, ], pager: $('#EntityListGridPager'), rowNum: 10, rowList: [10, 20, 30], sortname: 'EntityID', sortorder: 'desc', viewrecords: true, imgpath: '', caption: 'Entities', width: EntityListGridWidth, height: 400, gridComplete: function () { var ids = jQuery("#EntityListGrid").jqGrid('getDataIDs'); var editImageUrl = '<%=Page.ResolveUrl("~/Controls/EntityManager/Images/edititem.GIF")%>'; for (var i = 0; i < ids.length; i++) { var cl = ids[i]; ce = "<img src='" + editImageUrl + "' onclick='EditEntity(" + cl + "); return false;' />"; ce2 = "<input type='button' value='details' src='" + editImageUrl + "' onclick='EditEntity(" + cl + "); return false;' />"; $("#EntityListGrid").setRowData(ids[i], { act: ce2 }); } } }).navGrid('#EntityListGridPager', { search: true, edit: false, add: false, del: false, searchtext: "Search" }, {}, {}, {}, { closeOnEscape: true, multipleSearch: true, closeAfterSearch: true }); $('#EntityListGrid').jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false });