jQGrid and Date

jQgrid fails to sort or search Date columns correctly if you don't set proper format on the Date field. I finally corrected my problem by setting Date format before converting the object into JSON.

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(date);
object.setDate(formattedDate);

Properties set in the grid was as below:


{
  name:'myDateField',
  index:' myDateField ',
  sortable:true,
sorttype:'date',
formatter:'date'
 }

Comments

Popular posts from this blog

jQgrid reload with new data

Rich Client based UI technologies- A Comparison of Thick Client UI tools

OSS and BSS Systems