我正在使用 jqGrid用于在用户界面中显示记录,我想对日期列进行排序。它以 Sat, Sep 1, 01:41 AM
的形式返回日期。我如何使用 jqGrid 做到这一点?
我对该专栏的 Colmodel 是:
{name:'transactiontime', index:'transactiontime', sorttype:'text', align:"right"},
最佳答案
尝试以下formatoptions
:
{name: 'transactiontime', sorttype: 'date', align: "right", formatter: 'date',
formatoptions: {srcformat: 'ISO8601Long', newformat: 'D, M d, H:i A'}}
参见 the demo这是来自 the answer 的演示的简单修改.
srcformat
可能取决于数据的输入格式。
关于javascript - 对 jqGrid 中的日期列进行排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12455337/