Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Matt Griffiths on Aug 21, 2009 02:47
open dhtmlx forum
controlling calendar within a grid

Hi,
Is it possible to control the calendar settings within a grid? I can see how if you are using the calandar object with a <input> you can associate the object and then initialise it and set the range using the sensitive control,but I can't see or work out how I can do that with a column in a grid.
I've got my column set to us the caledar, and that all works well, but I need to prevent users entering a date in the past, and although I can do this using some javascript validation on the returned value, I'd rather change the data control so it only lets them select future dates.
Similarly, I would rather apply a differnt skin to the control. Again, I can see that changing the javasscript library will do this, but is there a way to do this dynamically?
many thanks
Answer posted by Alex (support) on Aug 21, 2009 03:22

Hello, 

there is onDhxCalendarCreated event in grid. Its handler gets calendar object as a parameter:

grid.init();

grid.attachEvent("onDhxCalendarCreated",function(cal){
 cal.setSkin("dhx_blue");
 cal.setSensitive(d_start,d_end);
})