javascript - Backbone.Marionette view element initialization location -


i have general question regards should view element addin initialzation. instance have typeahead plugin requires initialization so.

$(element).typeahead(); 

using backbone.marionette best place todo type of view specific code? original thought override onrender() method in view class , everytime elements know @ design time. however, more general approach monitoring newly added dom elements , checking if element has identifier 'data-typeahead' , automatically initialising it. however, don't know jquery function this? or if realistic idea in terms of overhead of dom parsing on mobile devices?

any thoughts / ideas on how solve or best place sort of code awesome!

thanks

jon

for interested used @trond suggestions , implemented view init statements in onshow method.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -