Initialize inputs

Upon initialization:

  1. Shiny calls the initializeInputs function.
  2. It takes all input bindings and calls their initialize method before binding all inputs.

The initialize method is not always defined

An exception is the Framework7 (used but {shinyMobile}) requires instantiating all elements.

let f7ToggleBinding = new Shiny.InputBinding();
  $.extend(f7ToggleBinding, {
    initialize: function(el) {
      app.toggle.create({el: el});
    },
    // other methods
});

Where:

  • el: '.toggle' means that we are looking at the element(s) having the toggle class.
  • app.toggle.create is internal to the Framework7 API.