onChange for ext_minical times?

Hello, is there a way to have onChange fire for ext_minical start and end time changes? Thanks!

There is no public handlers, internal one can be adjusted in _minical.js ( you can get uncompressed version from sources/ext )

Thanks Stanislav. So as to avoid making customizations to ext_minical, I’m attempting to use jQuery to bind to the select element and add an onChange handler. My code looks something like this (for now it’s selecting all select elements until I get this much working):

$(“select”).each(
function(intIndex){
alert(“iterating”);
$(this).bind (
“change”,
function(){
alert("time changed " + indIndex);
});
});

The problem is that obviously this code won’t work until after the lightbox is rendered. onBeforeLightbox interrupts the regular rendering. Is there a way I could do something like:

scheduler.attachEvent(“onBeforeLightbox”, function (event_id){
// call lightbox render function here?
$(“select”).each(
function(intIndex){
alert(“iterating”);
$(this).bind (
“change”,
function(){
alert("time changed " + indIndex);
});
});
});

But add a call to lightbox render function to get it to render normally? Is there a better way to do this?

Thanks,
Chris

Nevermind, I just realized why this won’t work - I need to return true to get the lightbox to render, but I can’t put the jQuery selector code in the onBeforeLightbox event. Is there some other event that fires after the lightbox is rendered that I could use?

I think I’ve found the solution. I’m new to jQuery and just realized they have the .live method that binds to future objects in the DOM. So, I’ve done the following:

	$(".dhx_cal_lsection select:eq(0)").live(
		"change",
		function(event){
			// event code for start time change here
		});
	
	$(".dhx_cal_lsection select:eq(1)").live(
		"change",
		function(event){
			// event code for end time change here
		});

Obviously this relies on there being only one element of class dhx_cal_lsection to be on the page, an assumption that holds true at least for my lightbox at the moment. While it may change in the future due to changes to my lightbox sections or from changes in dhtmlxScheduler, this seems like the best way to do what I need.

I’m just posting in case it’s helpful for someone else, or in case someone can spot something obviously wrong with my approach. Thanks!

Chris

Is there some other event that fires after the lightbox is rendered that I could use?
There is onLightBox event