Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This method is called after the rendering has been done (after renderContent()). When this is executed, the widget is guaranteed to have injected itself into the DOM, and thus normal techniques of manipulating DOM elements apply (jQuery can be used for example).

The default implementation of afterRender appends the custom template to the widget and also installs any custom events (see customEvents).

Expand
titleExample
Code Block
languagejs
titleExample
afterRender: function () {
    this.$el.append(this.customTemplate());
},

...

Expand
titleExample
Code Block
languagejs
titleExample
customEl: '.widget-content',

customTemplate()

widget.customTemplate(/* no arguments */)

Renders the custom template. The default behavior of this method is to call the customWidgetTemplate function with the return value of getCustomTemplateParams method.

customWidgetTemplate()

widget.customWidgetTemplate(params)

...