CheckboxView

Description
The Checkbox view displays a checkbox and returns a Boolean value indicating whether it is checked.
Library path
splunkjs/mvc/checkboxview
Properties
Name | Default value | Description |
id | | Required. The unique ID for this control. |
default | | The default value. |
disabled | false | Indicates whether to disable the view. |
initialValue | | The initial value of the input. If defaultis specified, it overrides this value. |
settings | | The properties of the view. See the methods below to get and set values. |
value | | The Boolean value of the checkbox. |
Methods
Name | Description |
render | Draws the control to the screen. Called only when you create the view manually. |
settings.get( property ) | Returns the value of property for the current component. |
settings.set( property, value ) | Sets the value of property to the specified value for the current component. |
val | Returns the view's value if passed no parameters. Sets the view's value if passed a single parameter. |
Events
Name | Description |
change | Fired when the value of the view changes. |
Example
require([
"splunkjs/mvc/checkboxview",
"splunkjs/mvc/simplexml/ready!"
], function(CheckboxView) {
// Instantiate components
new CheckboxView({
id: "example-checkbox",
default: false,
el: $("#mycheckboxview")
}).render();
});