Extjs rating extension

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

4 Responses to “Extjs rating extension”

  1. Aaron Conran Says:

    This was a clever way to implement this. Very cool!

    However, why did you choose to copy and paste all of the Ext.Slider code and subclass Ext.BoxComponent rather than subclass Ext.slider itself?

    Please make sure that you post a link in the User Extensions and Plugins as I’m sure other users would certainly like this as well.

    Aaron Conran
    Ext JS Core Developer

  2. ivan Says:

    Well this was my first extension :) I haven’t got so much experience with extjs in moment I wrote this. If I have to rewrite it (may be soon) I’ll extend Ext.slider.

  3. ivan Says:

    By the way there is a post in Ext forum here.

  4. galdaka Says:

    How can I make work setValue on this extension?

    Thanks in advance,

Leave a Reply