Availability of UI elements in Marionette.View

前端 未结 3 1491
予麋鹿
予麋鹿 2021-02-13 11:47

I\'d just like to understand the decisions behind Backbone.Marionette\'s view regarding UI elements. When instantiating a Marionette.View on an existing DOM element, like this:<

3条回答
  •  一生所求
    2021-02-13 12:11

    When I am working with Marionette, I put the code that has to access the ui elements inside the onShow method. This event is fired after the dom is ready and the elements are ready to be manipulated. Inside this method, your ui.whatever will now be pointing to an element and not a string.

提交回复
热议问题