Custom Controls > Widget Reference > Linear Gauge |
Member Of | Wijmo Value Control |
Base Control | wijlineargauge |
Description | Creates a customizable linear gauge with horizontal or vertical orientation. |
Usage | Apply to an entity property having a numeric data type. |
Generated Code |
Copy Code
|
---|---|
myapp.ScreenName.PropertyName_render = function (element, contentItem) { var div = $("<div/>"); div.appendTo($(element)); div.wijlineargauge({ value: contentItem.value, min: 0, max: 100, orientation: "horizontal" }); contentItem.dataBind("value", function (newValue) { div.wijlineargauge({ value: newValue }); }); }; |
The widget’s constructor specifies a limited set of options (initial value, min/max values, and horizontal orientation). If you need to set additional options, add them to the initializer passed to the constructor.
The dataBind method call ensures that the widget stays in sync whenever the bound value changes.