I have a date column in my jqGrid that I am formatting. In addition, I have a toolbar search. The problem I am having is when I type in data to the search bar to search the formatted date data, it won't search the formatted date, it probably searches the pre-formatted date.
Is there any way to search the formatted date instead, or will I have to try and format it before I insert the data to the jqGrid?
Edit: Some Code
var gridLayout = [
{name: "name", index: "name", width: "250px"},
{name: "state", index: "state", width: "50px", hidden: true},
{name: "stateName", index: "stateName", width: "100px", hidden: true,
sorttype: function(cellValue, rowObj) {
return rowObj.state;
}},
{name: "stateImg", index: "stateImg", width: "50px", align: "center",
sorttype: function(cellValue, rowObj) {
return rowObj.state;
}},
{name: "launchDate", index: "launchDate", width: "150px", sorttype: "date",
formatter: 'date', formatoptions: {srcformat: "ISO8601Long", newformat:"n/j/Y, g:i:s A"}},
{name: "lastWorked", index: "lastWorked", width: "150px",
formatter: 'date', formatoptions: {srcformat: "ISO8601Long", newformat:"n/j/Y, g:i:s A"}}
];
I with the toolbar search above the launchdate/lastworked elements, I am trying to search for a date in the format specified in the "newformat" field, but it does not reply with any data when I do so.
After running a test, it does indeed search with the old format.
Edit:
I found an online example here: http://www.ok-soft-gmbh.com/jqGrid/MarkR.htm
If you enter 10/31/2007 into the date search bar and press enter, nothing appears. But if you type 2007-10-31 and press enter, the row with cell 10/31/2007 does appear in the search results. This is what I'm trying to work around.
Edit: This is jqGrid 4.4.0, jQuery 1.7.2