switch timeline render modes (bar/cell) through a tab button

Hi everyone,
i founded a way to change view from bar to cell mode of the timeline through a custom html input button with onclick() parameter that calls scheduler.setCurrentView with a second defined timeline specification.

Is it possible to bind that function to a navbar button, I mean: as the other ones to set different views?

I hope my question is enough clear…
Thank you,



you can add a custom tab to a nav bar, just insert a div with a correct class name and the name attribute
The click on such div will call scheduler.setCurrentView with appropriate view parameter.

The behavior of the tabs can be altered using onBeforeViewChange event - you detect the operation needs to be altered, do a custom behavior and return false from the handler in order to prevent the default behavior:

scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){ if(mode == "tab name"){ // do something // and refresh view scheduler.updateView(); return false; } return true; });
docs.dhtmlx.com/scheduler/api__s … event.html

Alternatively, you can simply add a div with a defined onclick handler to the navigation bar

Thank you Aliaksandr for the tip, I’ll give a try.