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
Post a Comment