Change Options

To be able to change a widget option, declare its value an observable.

var viewModel = {
    checkBoxOptions: {
        // ...
        value: ko.observable(true)

viewModel.changeObservables = function () {


Now, if you change an observable in code, the widget will receive the changes and update the UI. And vice versa, if a user changes something in the UI, the observable gets updated.

NOTE: Options containing array and specified on the second (or further) level of the configuration object cannot be made observable.

See Also