Closed MrSef217 closed 7 years ago
the bug is also in v4.3.35.
the issue was caused by this line column = x_pos / width;
scheduler._get_column_index = function(x_pos) {
var column = 0;
if (this._cols) {
var width = 0;
for (var i = 0; i < this._cols.length && !width; i++) {
width = this._cols[i];
}
if (width) {
//column = x_pos / width;
// youssef : not accurate way to calculate sections , sometimes 1px is missing
var x = 0;
for(var j=0; this._cols.length ;j++){
if( x <= x_pos ){
x+= this._cols[j];
}else{
column = j;
break;
}
}
} else {
column = 0;
}
if (this._ignores)
for (var i = 0; i <= column; i++)
if (this._ignores[i])
column++;
}
return column;
};
```.
Hi, should be fixed in v4.4.0 https://github.com/DHTMLX/scheduler/tree/v4.4.0
Hello , we are currently using scheduler v4.3.17 commercial licence.
and our clients started complaining about an issue where the events are created in the wrong section. for example i click section "b" it get created in "c" or "d". i found out that the event during it's creation doesnt have the section id so to fix it i added this line to the function
scheduler.addEventNow
base.id = this._drag_id = this.uid();
var pr = this._props[this._mode];
if(pr && e){ base[this._props[this._mode].map_to] = this.getActionData(e).section ; }
now the event is created where it should . but there's a new issue , if we create a view unit that has 7 days 7 units , the event is created in wrong section , i think there's is a problem with the way how it's calculated , i tracked the issue to the function
scheduler["mouse_"+ name] = function(pos){ //mouse_coord handler
indhtmlxscheduler_units.js
.Thank you.