Hi,
I have some cell on a grid that has dhxCalendar as type. I am wondering if I can make the calendar pop up be a little bit smarter like poping to the left if it is on the right most of the window or pop to the top if it is on the bottom of the browser window or pop down if it is on the top edge of the browser window, etc.
What I have observed is the user needs to scroll down for example to see the calendar if the cell they are trying to edit is on the bottom edge of the browser window.It would be more user friendly if the calendar would pop on top of the cell rather than going down where everything is hidden .
Thanks
Florante
Hello,
dhxCalendar excell doesn’t provide built-in functionality to anable this mode.
But you can change calendar position to the necessary one using setPosition method: calendar.setPosition(Y,X);
The example for the grid:
grid.attachEvent(“onEditCell”,function(stage,row_id,column_index){
if(stage==1 && column_index == 1){
var cell_position = this.getPostion(this.cells(row_id,column_index).cell);
var old_x = cell_position[0];
var old_y = cell_position[1];
/… your code here to get new position…/
this._grid_calendarA.setPosition(new_y,new_x);
}
return true
})
Does the above code work with dhxCalendar in a treegrid control? I got an error on this line:
var cell_position = this.getPostion(this.cells(row_id,column_index).cell);
There was a type in the provided solution - i letter was missed.
Try to call
var cell_position = this.getPosition(this.cells(row_id,column_index).cell);
instead of var cell_position = this.getPostion(this.cells(row_id,column_index).cell);
Thank you. That did the trick.