calling javascript on rendering views in BackBone js. post-render callback?

后端 未结 8 1667
粉色の甜心
粉色の甜心 2020-12-04 19:55

behold, a backbone view render call:

render: function() {
  $(this.el).html(this.template({title: \'test\'}));  //#1
  this.renderScatterChart();
  return th         


        
8条回答
  •  孤街浪徒
    2020-12-04 20:48

    If you don't want to use the setTimeout hack, I think this way is more 'normal':

    Just pass the $el element to the function that needs to manipulate elements added by render() and then DOM manipulation can be done on $el.

提交回复
热议问题