Categories | Question details Back To List | ||
setDateFormat on calendar type cells, in read only grid Hello! The setDateFormat function is great, I would like to use it in read only mode. Is it possible to use the setDateFormat function without including dhtmlxgrid_excell_calendar.js and/or dhtmlxgrid_excell_dhxcalendar.js ? Answer posted by Support on May 12, 2008 03:37 >>This seems a lot of overhead just to get the date formatting? The DateFormating functionality based on js code of calendar|dhxCalendar - so one of those files still necessary to apply formatting. >>Is it possible to use the setDateFormat function without including dhtmlxgrid_excell_calendar.js and/or dhtmlxgrid_excell_dhxcalendar.js ? You can use custom sorting function, something similar to next For data such as dd/mm/yyyy function date_custom=function(a,b,order){ a=a.split("/") b=a.split("/") if (a[2]==b[2]){ if (a[1]==b[1]) return (a[0]>b[0]?1:-1)*(order=="asc"?1:-1); else return (a[1]>b[1]?1:-1)*(order=="asc"?1:-1); } else return (a[2]>b[2]?1:-1)*(order=="asc"?1:-1); } grid.setColSorting("int,date_custom,na,str"); |