Data-binding options:
Example:
In this example, the ViewModel is defined specifically for use with the radial gauge. It has disabled, min, max, and value properties that are bound in the View. If any of these values change, the widgets automatically respond to them. The widgets also update the ViewModel values as they modify them. This gauge starts at 0, goes up to 100, and has an initial value of 50.
Create a ViewModel:
ViewModel Script |
Copy Code |
---|---|
var viewModel = function () { var self = this; self.min = ko.observable(0); self.max = ko.observable(100); self.val = ko.observable(50); }; |
Create View with Bound Controls:
View Markup |
Copy Code |
---|---|
<div data-bind="wijradialgauge: {disabled: disabled, min: min, max: max, value: val}"> |