Hey,
I found this example of custom sorting date function.
/********************************************************/
function date_custom(a,b,order){
a=a.split("/")
b=b.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”);
/****************************************************/
I have problem sorting my date columns with ‘dd/mm/YYYY’ formating.
If i set sorting on “date_custom” it doesn´t work and do nothing.
This function is not called when the sorting event is called.
Its not called also when I set sorting in data XML datasource
Please help.
Thx
I have standart version of dhtmlx …
unfortunately the issue cannot be reconstructed locally.
The provided sorting type works well for us.
If issue still occurs for you - please, provide us with any kind of sample of your code.
Hey,
I construct some demo of custom sorting date function …
There are two examles.
1.Custom sorting set on column date in header.
2. … set by loading data in XML data row.
Thx.
I apologize for misleading you.
Unfortunately the custom sorting creation is not available in standard version of dhtmlxgrid. It available on pro version only.
Ok,
Is there any other solution ?
Or the only one is to set the American standart date format “YYYY/m/d” ?
Thx for your time…
You may try to use the default “YYYY/mm/dd” format of date or you may try to use dhtmlxCalendar:
dhtmlx.com/docs/products/dht … _grid.html
But I need to set this cell read only.
Is There any way to set it as dhxCalendar with option read only ?
Thx.
you may try to use onEditCell event to block any edit operation:
grid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){
if(cInd==1){
return false; // block the edit
}
else return true // allow edit
});