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 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


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);
})




What is format value for d_start and d_and?

And what is setYearsRange(2010,2010) don’t working?

What is format value for d_start and d_and?

d_start and d_end are Date objects:

d_start = new Date(…);
d_end = new Date(…);

And what is setYearsRange(2010,2010) don’t working?

The setYearRange method sets range for year select (new dhtmlxCalendarObject(…,…, {isYearEditable: true}):wink:

There is no need to use isYearEditable for 1 year. So setYearsRange(2010,2010) doesn’t have sense too.