I’ve looked all through the documentation is there a way to turn off the swipe scroll so it doesn’t change the dates? If not is there a way to change the sensitivity?
Thanks!
I’ve looked all through the documentation is there a way to turn off the swipe scroll so it doesn’t change the dates? If not is there a way to change the sensitivity?
Thanks!
Unfortunately this is hardcoded. Comment or adjust the next line in the dhtmlxscheduler.js
check_direction_swipe(source, tracker, 200);
Change the number to change sensitivity
Hmm
I looked for the line of code you specified and didn’t see it in the main .js file am I missing something?
Hi Quickly,
As Stanislav said it’s hard coded, but it can be turned off in the dhtmlxscheduler.js file look for the
scheduler._touch_events=function
section and in the very first function declaration in that is where you can turn the functionality on or off by commenting out the if statement. In the minified code the whole section you’re looking for is something like
scheduler._touch_events=function(a,b,c){
function d(a,b,c){
if(a&&b){
var d=Math.abs(a.pageY-b.pageY),e=Math.abs(a.pageX-b.pageX);
if(e>c&&(!d||e/d>3))
a.pageX>b.pageX?scheduler._click.dhx_cal_next_button():scheduler._click.dhx_cal_prev_button()
}
}
Comment out the function “d”'s contents and you remove the page left/right swipe functionality. So:
scheduler._touch_events=function(a,b,c){
function d(a,b,c){
/*if(a&&b){
var d=Math.abs(a.pageY-b.pageY),e=Math.abs(a.pageX-b.pageX);
if(e>c&&(!d||e/d>3))
a.pageX>b.pageX?scheduler._click.dhx_cal_next_button():scheduler._click.dhx_cal_prev_button()
}*/
}
Note: The variable names may be different (including function d’s name) as I’m running a slightly older version of the scheduler but you should be able to easily locate it by matching the rest of the codes logic up.
Hello,
There is any other solution to turn off Prev/Next scrolling on swipe instead of commenting the code in dhtmlxscheduler.js file.
Is there any latest solution like any scheduler property to turn off swipe event.
currently I am using dhtmlxScheduler v.4.3.0.