Timeline - Open new window on click

Hi Guys

I’m using the timeline view (read-only) and I’d like to open a window and pass the event_id to this (e.g. server/event_info.html?e=12355) when the user clicks (or double clicks–not decided yet)

Where would I implement this? Do I need to edit dhtmlxscheduler_timeline.js, or is there a better way to override the functionality that won’t break when I get a new version and dhtmlxscheduler_timeline.js is updated?

Thanks

mark

Hi,
you can use an API event for a mouse click. Id of the related calendar event will be available in parametersscheduler.attachEvent("onClick", function (id, e){ window.open("someUrl?id="+id); return false;// prevent default behaviour, if any });
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … event.html

Thanks!

Will give it a try

I got the window open, but can’t seem to get hold of any values in the event. My event contains an object called JobNo (and this displays in the tile and the tooltip, but e.JobNo is returning undefined.

What am I missing?

[code]scheduler.attachEvent(“onClick”, function (id, e){
alert(“Event:” + id + " JobNo:" + e.JobNo);
window.open(“Test.html?e=”+id,"_blank", “toolbar=yes, scrollbars=yes, resizable=yes, top=200, left=200, width=600, height=600”);
return false;// prevent default behaviour, if any

});[/code]

Regards

mark

Hi,
the second argument of the handler contains a browser event, meaning one described here
developer.mozilla.org/en-US/doc … ents/click

If you need to get a calendar entry, you can retreive it by id, that are passed as a first argumentscheduler.attachEvent("onClick", function (id, e){ var event = scheduler.getEvent(id); alert("Event:" + id + " JobNo:" + event.JobNo); window.open("Test.html?e="+id,"_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=200, left=200, width=600, height=600"); return false;// prevent default behaviour, if any });

Thanks. Timely and spot on as usual!