Reputation: 33
A situation:
$("#CreditLineEditorContent #tabs #PmntDates").jqGrid({
datatype: "local",
height: 250,
colNames: ["Date", "In", "Out"],
colModel: [
{ name: 'pmntDate', index: 'pmntDate', width: 150, sorttype: "date", sortable:false },
{ name: 'incSum', index: 'incSum', width: 150, sorttype: "float", formatter: 'currency' },
{ name: 'decSum', index: 'decSum', width: 150, sorttype: "float", formatter: 'currency' }
});
I need to sort my grid by column "Date".
The problem is following: I have a pmntDate
as a String (e. g. 02.09.2013), so it sorted as a String
, not Date
So, the question is:
How can I show a String
values (e. g. 02.09.2013) but sort by original values (Date
)?
Upvotes: 1
Views: 98
Reputation: 33
Thanks a lot. The right answer:
... sorttype: "date", formatter: 'date', formatoptions: { srcformat: 'ISO8601Long', newformat: 'd.m.Y' } }
Upvotes: 0
Reputation: 1728
Try datefmt option:
{ name: 'pmntDate', ..., sorttype: "date", sortable:true, datefmt: "dd.mm.yyyy" }
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options
Upvotes: 1