In my project which uses with jQueryUI’s datepicker of plugins,
but in this code,the “create” event never fires,
you can check the documentation in official site:
in the Options tab.
$('#datepicker').datepicker({
create: function(event, ui) {
alert("ppp");
}
});
The documentation lies (as noted by Nick). If you look at
jquery.ui.widget.jsin the source, you’ll see this:So the create event is handled by the jQuery-UI widget factory so it should be supported by all of the widgets. If you look at
jquery.ui.button.js, you’ll see the widget factory in use:and you will find that the button widget does fire the create event. If you look at
jquery.ui.datepicker.js, you won’t find any$.widgetbut you will find a reminder for something to be done when the datepicker is converted to the widget factory:The datepicker doesn’t use the widget factory and it doesn’t implement the create event itself.
The beforeShow event does work though so maybe you can use that.
Quick demo (open your console please): http://jsfiddle.net/ambiguous/kn3hq/