使用grid.locale-zh_CN.js时,要配置srcformat
col增加配置formatter:'date', formatoptions:{srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'}
例如:
colNames:['ID','类型','排序','备注','修改时间'],
colModel:[
{name:'id',index:'id', width:100, key:true, editable:false },
{name:'type',index:'type', width:120, sortable:false, editable:true,
stype:"select", searchoptions:{sopt:['eq'], value:"string:字符串;int:整数;enum:枚举;bool:布尔型;time:时间;double:数字"},
edittype:"select", editoptions:{value:"string:字符串;int:整数;enum:枚举;bool:布尔型;time:时间;double:数字"} },
{name:'no',index:'no', width:80, sortable:true, editable:true},
{name:'remark',index:'remark', width:120, sortable:false, editable:true},
{name:'modifyTime',index:'modifyTime', width:120, sortable:true, editable:false,
formatter:'date', formatoptions:{srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'} }
],
参考:http://www.trirand.com/jqgridwiki/doku.php?id=wiki:predefined_formatter&s[]=date