Archive for the ‘javascript’ Category

Extjs rating extension

Saturday, September 6th, 2008

Lately i was playing with extjs and i created an extension for rating. The extension itself has 2 components. The first one is the visual one. It’s a kind of slider with some modifications. It’s usage is the same as a slider’s. The second component is a form field that holds the value of the first one in a hidden input flield. The input element takes an extra parameter called starConfig and this parameter is passed to the constructor of the first component.

The number of stars is calculated dynamically and it’s equal to maxValue/increment
for example

1
2
3
4
5
{
    minValue: 0,
    maxValue: 100
    increment: 10	
}

This will give us 10 stars and each star increases the value of the hidden field by 10. By default increment = 1 and maxValue = 5

you can see demo here and download the extension here

Share/Save/Bookmark