Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add init event #420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add init event #420

wants to merge 2 commits into from

Conversation

ajoah
Copy link

@ajoah ajoah commented Mar 22, 2018

Useful for exemple if you need to set a date programmatically and need to trigger the change event.

Before:

$(dom).dateRangePicker();
$(dom).data('dateRangePicker')
	.setDateRange('2013-11-20','2013-11-25'); //change event is not triggered
$(dom).bind('datepicker-change', function(event, obj)
{
	alert('KO'); //not displayed
});

After:

$(dom).dateRangePicker();
$periode.on( 'datepicker-init', function() {
  $(dom).data('dateRangePicker')
	.setDateRange('2013-11-20','2013-11-25'); //change event is triggered
});
$(dom).bind('datepicker-change', function(event, obj)
{
	alert('OK'); //displayed
});

@ajoah ajoah changed the title Adds init event Add init event Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant