If you have a dhtmlx grid that reaches to the bottom of the screen
and you have a column with a dhxCalendar field,
then the dhxCalendar is nevertheless shown on the bottom of the last row.
So you cannot see the calendar well.
Here is a bugfix. It would be great, if you could revise and publish the code with your next release.
Thank you.
[code] eXcell_dhxCalendar.prototype.edit = function() {
var arPos = this.grid.getPosition(this.cell);
this.grid._grid_calendarA._show(false, false);
var yPosition = 0;
if(arPos[1] + this.grid._grid_calendarA.base.offsetHeight + this.cell.offsetHeight < window.innerHeight) {
// Enough space to show dhxCalendar below date
yPosition = arPos[1]+this.cell.offsetHeight;
} else {
// Show dhxCalendar above date
yPosition = arPos[1]-(this.grid._grid_calendarA.base.offsetHeight);
}
this.grid._grid_calendarA.setPosition(arPos[0], yPosition);
this.grid._grid_calendarA._last_operation_calendar = false;
this.grid.callEvent("onCalendarShow", [this.grid._grid_calendarA, this.cell.parentNode.idd, this.cell._cellIndex]);
this.cell._cediton = true;
this.val = this.cell.val;
this._val = this.cell.innerHTML;
var t = this.grid._grid_calendarA.draw;
this.grid._grid_calendarA.draw = function(){};
this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));
this.grid._grid_calendarA.setDate(this.val||(new Date()));
this.grid._grid_calendarA.draw = t;
// Time is not needed so disable it
this.grid._grid_calendarA.hideTime();
}[/code]
Hi, thanks for the bugfix.
We will check how it can be included in the next update.
kcparun
September 17, 2015, 11:50am
#3
Hi,
can you please help solve this issue and explain it has be written in javascript.
Thank you,
Hers the Bugfix that limits the Calender Position also for right side of the Grid.
[code] eXcell_dhxCalendar.prototype.edit = function() {
var arPos = this.grid.getPosition(this.cell);
this.grid._grid_calendarA._show(false, false);
var yPosition = 0;
if(arPos[1] + this.grid._grid_calendarA.base.offsetHeight + this.cell.offsetHeight < window.innerHeight) {
// Enough space to show dhxCalendar below date
yPosition = arPos[1]+this.cell.offsetHeight;
} else {
// Show dhxCalendar above date
yPosition = arPos[1]-(this.grid._grid_calendarA.base.offsetHeight);
}
var xPosition = arPos[0];
if (xPosition+this.grid._grid_calendarA.base.clientWidth+ this.cell.offsetWidth>window.innerWidth) {
xPosition = window.innerWidth-this.grid._grid_calendarA.base.clientWidth;
}
this.grid._grid_calendarA.setPosition(xPosition, yPosition);
this.grid._grid_calendarA._last_operation_calendar = false;
this.grid.callEvent("onCalendarShow", [this.grid._grid_calendarA, this.cell.parentNode.idd, this.cell._cellIndex]);
this.cell._cediton = true;
this.val = this.cell.val;
this._val = this.cell.innerHTML;
var t = this.grid._grid_calendarA.draw;
this.grid._grid_calendarA.draw = function(){};
this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));
this.grid._grid_calendarA.setDate(this.val||(new Date()));
this.grid._grid_calendarA.draw = t;
// Time is not needed so disable it
this.grid._grid_calendarA.hideTime();
}
[/code]
I apologize for the delay.
Thank you for your suggestion. Your bug fix is included in the latest version of the dhtmlxGrid.