Manipulating date in grid

Hello,

So I have this grid in which one column is a dhxCalendar.
Upon edit event, I would like to prevent the user to set a date previous to the current day. Problem is, I can’t target the column I want like I would be able to with a combo column, and I have no idea how to block the calendar once loaded. If possible, I would like to avoid reacting on the editEvent state 2, that would not be very user-friendly.

Any idea ?

Please, try to use the setInsensitiveRange() method:
docs.dhtmlx.com/api__dhtmlxcalen … range.html

You may call the methods from the onDhxCalendarCreated event.
For example:

mygrid.attachEvent("onDhxCalendarCreated", function(myCal){ myCal.setInsensitiveRange(null,"2014-07-08",); })

Hi,

Thanks for your answer, but the event is never called.

My cell type is set with :

myGrid.setColTypes(["ro,"ro","dhxCalendarA","ed","ed"]);

I tried your code with a “onDhxCalendarACreated” instead, but nothing happened as well

The event should occur on the first opening of the calendar window.
If the problem still occurs for you, please, provide with a more detailed sample of your code.

Hi,

It works well with a simpler grid. I must have done a error in the initialisation of this one, causing the event to fail. I’m gonna take a look at this.

Thanks a lot !