Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Biju on Jan 08, 2009 04:08
open dhtmlx forum
dhxCalendarA

Dear,

I use dhxCalendarA as one of the column types of the grid. It allows the user to type in date.

I would like to know if any kind of formatting can be applied while I type in the editor such as 'dd/MM/yyyy' or 'MM/dd/yyyy' etc.

If this is possible to check what I enter is a valid date?

Thanks,
Biju
Answer posted by Support on Jan 08, 2009 10:13
>>I would like to know if any kind of formatting can be applied while I type in the editor
You can define format , which will be applied to data after cell switched back to normal state, but there is no "live-formattting"

>>If this is possible to check what I enter is a valid date?
You can attach any kind of custom code to onEditCell event, such code may check entered code by any custom rules and allow or deny result of edit operation. 
Answer posted by BIju on Jan 18, 2009 21:56
Hi,
>>>
such code may check entered code by any custom rules and allow or deny result of edit operation.
<<<
How to deny edit and retain the existed value? I mean some code example.

Thanks,
Answer posted by Support on Jan 19, 2009 01:53
mygrid.attachEvent("onEditCell",function(stage,id,ind,value){
     if (stage==2 && ind == INDEX ){    //INDEX - index of necessary column
           if (!some_check(value)) return false;// returning false revert value to previous one
     }
     return true;
});