Rating
Article Metadata
Contents |
Inheritance
Nokia.Rating
|- Nokia.Widget
|- Nokia.Class (basic class)
1 - Description
The Rating component provides a control that allows the user to edit the rating of a content element.
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
- element: 'selector'
- jQuery selector or the DOM reference to become the container of the component.
- stars: int
- Defines the total number of stars in the component.
- value: int
- This defines the number of stars that are selected in the component by default. This is a number between 0 and the value of the stars option.
4.2 - Events - Callbacks
- create: function()
- Scope: [this.element]
- change: function(value)
- Scope: [this.element]
4.3 - Methods
- getValue: function()
- Returns the component value.
- return [int]
- setValue: function(value)
- Sets the component value.
- return [void]
4.4 - Default options
- stars: 5
- value: 0
5 - Component Demo
5.1 HTML
<div id="rating01"></div>
5.2 Javascript
window.rating1 = new Nokia.Rating({
element: '#rating01',
value: 2,
create: function() {
//alert("Rating: Create.");
},
change: function(value) {
//alert("Rating: Change - " + value);
}
});
6 - Nokia WRT Browser Compatibility
| ▴ | S60 3.1 | S60 3.2 | S60 5.0 |
| Rating | YES | YES | YES |



(no comments yet)