jquery - jqGrid - date & time format not being applied -
i have jqgrid displays 3 columns, 1 of date-time (sql datetime field being returned). colmodel settings follow:
colmodel:[ {name:"col1",....,sortable:false}, {name:"col2",....,sortable:false}, {name:"sendtime",index:"sendtime",width:col3width,align:"left",formatter:"datetime",formatoptions:{srcformat:"iso8601long",newformat:"longtime"},xmlmap:"sendtime",sortable:false} ],
the date being returned sql in following format:
yyyy-mm-ddthh:mm:ss
none of fields in jqgrid sortable, , sql order by
controls order of data being returned.
i change date format being returned omit "t" in middle of - yyyy-mm-dd hh:mm:ss
. if can't that, consider having formatted military time. i've tried several format options in colmodel settings, have succeeded in formatting date or time, not both @ once.
does require custom formatter, or overlooking settings in jqgrid? appreciate help.
thanks! s
jqgrid have predefined formatter:"date"
, no formatter:"datetime"
(see the documentation). should fix name of formatter make working.
the last version of jqgrid supports yyyy-mm-ddthh:mm:ss
, not yyyy-mm-dd hh:mm:ss
. don't need make changes on backend.
you should consider use sorttype: "date"
instead. helpful if use loadonce: true
or if use datatype: "local"
.
Comments
Post a Comment