This will be called when the user hits ESC, clicking on the cancelEl or clicking outside the modal and before cancel is called. beforeCancel modal.beforeCancel() (callback) Triggered whenever the animation has ended and the modal is displayed. Useful when you want to do some custom work while it's rendering the modal. Similar to next(), but will open the previous view from views. Useful when creating a wizard like modal. Open the modal at a specific index from views. This will result in calling beforeCancel, cancel and closing the modal. Similar to submitEl you can define an element that will cancel the modal. This will result in calling beforeSubmit, submit and closing the modal. You can define an element that will trigger all submit events. Select a container from your template by doing: viewContainer: '.container' submitEl modal.submitEl viewContainer modal.viewContainerĪll views will be rendered within the viewContainer. But if you want to create a complex modal, you can combine the template and views, but you'll have to define a viewContainer. You don't need the views to create a modal, you can simply use a template if you just want to show one view. By using the onActive callback, you can see whenever a view is active. You can add additional options to pass along: view (as Backbone.View, function or template which is required), viewOptions (for specific options for that view). You can bind your views by adding an event handler, just like you would define events in a Backbone.View. Options can be added when extending from Backbone.Modal like: prefix (for classnames), animate and ke圜ontrol (disable enter/esc events). If you'd like to create a stacked modal (multiple modals on top of each other), you'll need to use and. You can also start out with the examples. Make sure you include everything that's needed for Backbone and add and the CSS files to start playing with it. Download v1.1.5 Source on Github Getting Startedī is built on top of Backbone.js.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |