Buttons on Calendar Header

Hi,



Is there anyway to attach events to the buttons on the calendar’s header?



Thanks,



Joe


hello,


it is possible only by code modification. lines 624-674 of the dhtmlxcalender.js define header buttons.


You can add event call to the each button here (highlighted lines should be added):



btnClose.onclick = function (e) {
(e||event).cancelBubble=true;
self.callEvent(“onButtonClick”,[“close”])
self.hide();

}

btnMin.onclick = function(e) {
(e||event).cancelBubble=true;
self.callEvent(“onButtonClick”,[“minimize”])
self.minimize();
}

btnClear.onclick = function(e) {
(e||event).cancelBubble=true;
self.con.value = “”;
self.callEvent(“onButtonClick”,[“clear”])
self.hide();
}



To attach button event on the page you can use the following aproach:



calendar.attachEvent(“onButtonClick”,function(type){


if(type==“click”) …


})