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 a init-time event to allow for configuring options as jquery mobile does. #94

Closed
wants to merge 1 commit into from

Conversation

vaab
Copy link

@vaab vaab commented Oct 10, 2011

This is a simple event that is triggered when datebox finished to init.

This permits configuration à la jquery. (cf: http:https://jquerymobile.com/test/docs/api/globalconfig.html)

Sample config code:

$(document).bind("dateboxinit", function(){
  $.extend($.mobile.datebox.prototype.options, {
    'dateFormat': 'YYYY-mm-dd',
    'headerFormat': 'YYYY-mm-dd',
    'noButtonFocusMode': true
   });
  });

@jtsage
Copy link
Owner

jtsage commented Oct 14, 2011

I decided to do this a little differently. Your init hook was sort of in the wrong place, now, 'dateboxbeforecreate' fires after 'pagecreate' when DateBox is loaded. 'dateboxcreate' fires as DateBox is initializing (before it actually does). And 'dateboxaftercreate' fires when the init is done. Fwiw, what you show here you can actually put in a $(document).bind('pagecreate') instead, it should work just fine there - it also will let you customize some of the one-time details (field order, etc) that this would be too late for.

@jtsage jtsage closed this Oct 14, 2011
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.

None yet

2 participants