id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blocking	blockedby
2672	new datepicker timing issue	balliano	iMarc	"hi,
i'm running the datepicker in a full ajax context, also datepicker js/css are not in the document's head but loaded when needed (when the ajax call returns a datepicker widget)

problem comes in js line 1433

-----------------------------------------
/* Initialise the date picker. */
$(document).ready(function() {
	$(document.body).append($.datepicker._datepickerDiv)
		.mousedown($.datepicker._checkExternalClick);
});

$.datepicker = new Datepicker(); // singleton instance
-----------------------------------------

it happens that $(document).ready is executed BEFORE the ""new datepicker"" is called, thus I get an error. to solve the problem just move the ""new datepicker"" inside the $(document).ready:

-----------------------------------------
/* Initialise the date picker. */
$(document).ready(function() {
	$.datepicker = new Datepicker(); // singleton instance
	$(document.body).append($.datepicker._datepickerDiv)
		.mousedown($.datepicker._checkExternalClick);
});
-----------------------------------------"	bug	closed	major	1.2.4	ui	1.2.3	fixed	datepicker			
