Navigating to day from Month or Week view

Hello,

I’d like to be able to have a user navigate to a specific day by clicking on the day from the Month or Week views. Is this possible via the Scheduler API?

If not, I’ve found a hash called ‘schedule._click’ which has a property called ‘dhx_cal_data’ whose value is a function which repsonds to a click. I could use this function to navigate to the start of the table and then find the row and cell where the click took place. Then, using the known date, I could compute the date the scheduler should goto in Day view.

-OR-

I could simply give every ‘dhx_month_body’ DIV a name like ‘_Daynn’ and when the dhx_cal_data function is invoked get the target of the event, look at the name field and use that to tell the scheduler what day to goto.

Any help would be appreciated.

Thanks!

After poking around a bit, I discovered that if I hijack scheduler._click.dhx_cal_data function and
get the Target of the click (eg, ‘trg’ in the code) I can use that to get the following:

For Month View:

  1. trg.parentNode.className =one of (dhx_before (previous month),’ ', dhx_after(next month))
  2. trg.firstChild.data = the Day of the month if trg.parentNode.className==’ '.
    trg.firstChild.data = the Day of the previous month if trg.parentNode.className=='dhx_before '.
    trg.firstChild.data = the Day of the next month if trg.parentNode.className=='dhx_after '.

For Week View:
var header=getElementsByClassName(‘dhx_cal_header’);
var scalebar=getElementsByClassName(‘dhx_scale_bar’,header[0]);
var caldata=getElementsByClassName(‘dhx_cal_data’);
var scaleholder=getElementsByClassName(‘dhx_scale_holder’,caldata[0]);
var scalen=null;
for(var i=0;i<scaleholder.length;i++) {
if (trg==scaleholder[i]) {
scalen=i; //alert(“Item “+i+” clicked”);
break;}
}
if (scalen) {var day=scalebar[scalen]; alert(“day=”+day.firstChild.data); }

Find the the column index from the ‘dhx_cal_data’ DIV. Then, using the found index, get the
dhx_scale_bar DIV and that DIV’s firstChild is a text node which has DOW and Date.

Ugly! But, if there is no other way then… there is no other way.

a user navigate to a specific day by clicking on the day from the Month or Week views
Check

docs.dhtmlx.com/doku.php?id=dhtm … ehaviors&s[]=scheduler&s[]=behavior#dates_as_links

There is no native handlers for whole day clicking in month or week view, so you can use above extension or set your custom handler for global click handler. ( we plan to add some handlers to simplify the above use-case in the next version )