I have a jqgrid that shows details of search result. I was able to use ilterToolbar option to filter each column per user input. The grid shows all the rows that matches that filter in the grid, even partial match. The StackFlow article helps : https://stackoverflow.com/questions/15159452/adding-filter-to-each-column-of-jqgrid
It works perfectly fine except the CreatedDate column. For example, one of createddate is 10/20/2020. When I entered 2020, no match found. It works on the date column on the demo in the above article though. http://jsfiddle.net/uQQn3/1/. What is missing on my date column which causes the date matching not working? I added an additional date column to the code, exact the same as the date column in the demo, it doens’t match anything.
colNames: [‘Col1’, ‘Col2’, ‘Col3’, ‘Col4’, ‘Col5’, ‘Col6’, ‘Col7’],
colModel: [
{ name: ‘Path’, index: ‘Path’, width: 150, formatter: viewLink },
{ name: ‘Title’, index: ‘Tilte’, width: 100, sortable: true, editable: true },
{ name: ‘Submitter’, index: ‘Submitter’, width: 50, sortable: true, editable: true },
{ name: ‘PublishedDate’, index: ‘PublishedDate’, width: 40, sorttype: ‘date’, editable: true, editrules: { date: true }, formatter: ‘date’ },
{name:’TestDate’,index:’TestDate’, width:90, sorttype:”date”, formatter:”date”},
{ name: ‘ItemCount’, index: ‘ItemCount’, width: 50, sortable: true, sorttype:’Integer’, editable: true },
{ name: ‘ContentTypeId’, index: ‘ContentTypeId’, width: 80, sortable: true },
],
localReader: { repeatitems: true },
rowNum: 50,
rowList: [50, 100, 150, 200, 250],
autoload: true,
rownumbers: true,
sortname: “ItemCount”,
sortorder: “desc”,
refresh: true,
gridview: true,
viewrecords: true,
multiselect: true,
rowTotal: 250,
pager: ‘#gridPager’,
loadonce: false,
height: 1000,
ignoreCase: true,
altRows: true,
shrinkToFit: true,
autowidth: true,
resizable: false,
groupColumnShow: false,
hidegrid: false,
multiboxonly: true,
caption: “Search Results”,
searchoptions: {
clearSearch: true,
attr: { size: 18, maxlength: 18, style: “width:130px;margin-top:1px;” }
},
jQuery(“#requestGrid”).jqGrid(‘filterToolbar’, { stringResult: true, searchOnEnter: false, defaultSearch: “cn” });
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top