I am attempting to somehow override the schedulers week and month view headers to be clickable.
Typically the “dhx_scale_bar” section which I would like to link me to that specific date or day clicked in the header.
For instance: when in Week View, clicking “Tue, November 17” on the header will fire off the scheduler into the day view for that specific date.
Likewise when in the month view, clicking on a day will change the scehduler to that day.
Is this at all possible?
I am attempting to get this done via jquery itself.
I have been searching these docs for a solution or a way to override how these labels are rendered but I have no had any success.
Any assistance would be highly appreciated.
Thanks.
Hello,
you can either use active links extension
docs.dhtmlx.com/scheduler/extens … ctivelinks
Or you can manually inject clickable elements from template functions of header cells:
docs.dhtmlx.com/scheduler/api__s … plate.html
docs.dhtmlx.com/scheduler/api__s … plate.html
H,
Thanks for the reply and the great suggestions.
This is how I ended up implementing this functionality. Couldn’t have done it without your help
Firstly I overrode the week_scale_date template as follows:
[code]//override the week header click
scheduler.templates.week_scale_date = function(date){
var d = new Date(date);
var year = d.getFullYear();
var month = d.getMonth();
var day = d.getDate();
return "<a onclick='setSelectedDay("+year+","+month+","+day+");' class='header-week-day' href='javascript:void(0);'>" + scheduler.date.date_to_str(scheduler.config.day_date)(date) + "</a>";
};[/code]
This allows my headers to be clickable and at the same time setting a function call passing in my relevant clicked date components. My actual function is a simple one-liner:
var setSelectedDay = function(year, month, day) {
scheduler.setCurrentView(new Date(year,month,day), "day");
};
Seemingly, I can implement the exact same thing for the month view’s header in the same way.
If you think there is a better or more efficient way or if you have any advice after seeing my solution please let me know.
Always grateful!