Initialize inputs
Upon initialization:
- Shiny calls the
initializeInputs
function. - 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 thetoggle
class.app.toggle.create
is internal to the Framework7 API.