Fix: adjust attribute name "disable" to match what is defined in multi-select.js by pieterlukasse · Pull Request #3014 · OHDSI/Atlas (original) (raw)

To answer your question about if it works dynamicaly:

The view-model field that the HTML template is binding to is called 'disable', defined here:

self.disable = (params.disable || false);

It will respond dynamically depending on what is in the params.disable payload (ie: what the component is being initialized with):

  1. An observable: if params.disable is an observable, then self.disable will reference it as the observable that was apassed in, and the disable data-bind will redraw whenever the observable state changes automatically.
  2. A plain boolean object: If you data-bind (via the disable: binding for example) to a non-observable value, the data-bind will not respond to anything and so whatever the initial state of the param is will be the final state of the DOM element.
  3. nothing at all: If it is nothing then the || false clause takes effect, and the binding will bind to a non-observable value of false and follow item 2 above.