Checkbox
Article Metadata
Contents |
Inheritance
Nokia.CheckBox
| - Nokia.OptionBox
| - Nokia.Widget
| - Nokia.Class (basic class)
1 - Description
The Checkbox component enables the user to make multiple selections from a group of checkboxes accompanied by text labels. Selecting the checkbox item toggles the state of the item between checked and unchecked. The selection state of the text labels is shown using the appropriate checkbox graphic.
2 - Visual Design
3 - Component Dependencies
3.1 CSS
<!-- Themeroller CSS --> <link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen"> <!-- Specific Theme/Resolution CSS --> <link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
3.2 Javascript
<!-- jQuery file --> <script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script> <!-- Guarana file --> <script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>
4 - Functional Specifications/Requirements
4.1 - Options
- wrapper: String
- Wrapper element for the component.
4.2 - Events - Callbacks
- create: function()
- Scope: [this.element]
- check: function(event)
- Scope: [this.element]
- unckeck: function(event)
- Scope: [this.element]
- push: function(event)
- Scope: [this.element]
- toggle: function(event)
- Scope: [this.element]
4.3 - Methods
- toggle: function(event)
- Performs toggle.
- return [void]
4.4- Default options
- wrapper: 'div'
- disableLabelSelection: true
5 - Component Demo
5.1 HTML
<div id="optiongroup"></div> <input type="checkbox" name="check1" value="" id="check1" />
5.2 Javascript
var check1 = new Nokia.CheckBox({
element: '#check1',
label: 'testing checkbox 1',
wrapper: 'div',
checked: true,
create: function() {
//alert('Checkbox: Create');
},
check: function(event) {
//alert('Checkbox: Check', this, event);
},
uncheck: function(event) {
//alert('Checkbox: Uncheck', this, event);
},
push: function(event) {
//alert('Checkbox: Push', this, event);
},
toggle: function(event) {
//alert('Checkbox: Toggle', this, event);
}
});
var optionGroup = new Nokia.OptionGroup({
element: '#optiongroup',
title: 'Option Group 1'
});
optionGroup.addItem(check1);
6 - Nokia WRT Browser Compatibility
| ▴ | S60 3.1 | S60 3.2 | S60 5.0 |
| Checkbox | NO | YES | YES |



(no comments yet)