Scheduler Scrollingbar handling?

Hello there !



I am trying to code a Arrow-Key Handling (left+right) via JScript.



document.onkeydown = function(event) {

if (event.keyCode == 37) {

// Left-Arrow pressed

event.cancelBubble = true;

event.returnValue = false;

// Code for changing the day in dayview to last one

}

}



1.] Is there any way to allocate the Code for changing the day?

Or is there a command, that is allways right for LAST DAY and NEXT DAY?



2.] Is there PERHAPS a possibility to check if i am in dayview right now?

Than i would build it like this:



document.onkeydown = function(event) {

if (IS_IN_DAYVIEW) {

if (event.keyCode == 37) {

>>1.] Is there any way to allocate the Code for changing the day?
var next = scheduler.date.add(scheduler._date,1,“day”);
scheduler.setCurrentView(next);

>>2.] Is there PERHAPS a possibility to check if i am in dayview right now?
If (this._mode == “day”) do_something();


Actually you can use

var next = scheduler.date.add(scheduler._date,1,this._mode);
scheduler.setCurrentView(next);

It will switch to next time period, according to current view mode

Many Thanks!
Exactly what i where locking for :slight_smile: I try the LEFT ARROW on my own and will post the result for other users usage :slight_smile:

Forget one question: 3.] Is it usuall that the UP- and DOWN-Keys not scrolling up or down in the Scheduler?

Could be that it is just my issue, so i want to ask you :slight_smile:

Okay, sorry, can’t make it working…
Perhaps i have the wrong relation for the scheduler object?

document.onkeydown = function(event) {
  if (event.keyCode == 37) {
    // Left-Arrow
    var next = scheduler.date.add(scheduler._date,1,this._mode);
    scheduler.setCurrentView(next);
    alert(“Left Key pressed”);
  }
}

I put this code in front of the dp.init(scheduler); and also tried it behind… Don’t know, there is no behaviour, no alert (just for testing in the code!), so i have to code a scheduler event instead of this unique javascript code? Would be glad for your help coder god’s :slight_smile:

3.] Is it usuall that the UP- and DOWN-Keys not scrolling up or down in the Scheduler?
If there is no opened editor for some event - scheduler doesn’t change anything in key processing. So scrolling works by the same rules as for normal html elements ( in local test , keys will work in ff only after focus was moved in scheduler, by editing|creating events )

Sorry, was a my typo, instead of
this._mode
you need to use
scheduler._mode

Ok.
But to my mind, in IE, SAFARI and FF is no possibility to scroll up and down via Arrowkeys, although dhtmlx doesn’t change any key-functions liek you said.
Still working on the last day, next day fuction…
When i ask my debugger he says, that “scheduler.date.add” i no declared function, and i think he’s right? :slight_smile:

Oh i got your posting afte ri send mine…
Perfect, this is it!
For going one day back i just have to change the “1” into “-1” :slight_smile:

Perfectly and nice feature, perhaps you can use it for your releases, but just my impression that this is usefull for handling (for people more intuitive).
Thanks to help me out with that. I am still amazed about your help. Could nto anybody answer my email to make me thank you more than just by THANK YOU saying? :slight_smile: