- Authors
Wolfram Kriesing
- Developers
Wolfram Kriesing
- since
V1.2
This widget allows users to rate items.
By default it shows three stars. The star images are provided with dojox.
This is a form widget, which means that you can simply embed it inside a dojo form, which submits the value automatically too. But it doesn't require to be inside a form.
The following example shows how the default widget works:
You can reset the number of stars to 0 by clicking on the currently selected star. For example, if two stars are currently selected click on the second star again and no star will be selected.
This example shows how to use additional attributes to customize the widget. The attribute numStars="10"
tells the widget to show ten stars, value="4"
sets the initially selected number of stars.
The following shows what events you can connect to and how to do this using inline script blocks.
The next example shows how you can do the same as above, just using the default connect methods, which is the most common way and probably fits best when working in big projects and when you need a separation of markup and JavaScript source code.