Brilliant, thanks for your help. Works OK as follows:
$(“#MarkupTable”).jqGrid('setColProp','Date',{sorttype:'date', formatter:'date', datefmt: 'd-m-y'});
A few observations that might help others:
- I do notice that the date handling is quite fussy when datatype is “clientSide”. When row content comes from HTML markup (using tableToGrid), the datefmt doesn't get used for actual formatting – that gets taken from the HTML markup, but the datefmt property is still required to make the sorting work.
- Similarly, if data is imported in JSON using the 'addRowData' function, the formatting seems to be determined by the value of newformat in the localisation file e.g. grid-locale-en.js
- The demos all seem to have dates formatted as Y-m-d, which will sort correctly as string-text, so I think the date-format demo code is often incorrect and the data is only correctly sorted because the text sorting produces the same results as date sorting for the given data and configuration parameters. Definitely worth changing example formatting as this is the only way to illustrate the code working correctly.