Rating stars widget

Hello all,

I've got an application that I'm working on and gathering feedback is
a key part of the whole system. So we want to make it easy for users
to rate things and naturally we're thinking about using a rating star
widget ala Netflix.

I was able to find this one,
http://www.beauscott.com/2006/08/26/ajax-rating-stars/. But it's
based on Prototype and I don't even know if that will be compatible
with dojo.

Has anyone had tried to create a rating star widget with dojo? If
not, do you think there will be problems using the prototype one with
dojo?

Thanks,
Rich

Comments

Sure, I've done something similar in Dojo. The rating system wasn't
really based on a numeric number && visually represented as stars but
it's still covered the same basic concept.

http://archive.dojotoolkit.org/nightly/tests/widget/test_RadioGroup.html

The test makes it look like a menu system but really the widget can be
generically used for anything that might benefit from shared grouping
behavior. (such as a star system perhaps)

On 12/8/06, Richard Wallace wrote:

--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

I took a look at the prototype widget. You should be able to use the
dojo.widget.slider with a transparent shuttle to accomplish roughly the same
effect as a stars widget.

Specifically one could set the snapValues to stars+1, turn on activeDrag,
turn off showButtons, set handleSrc to a transparent image,
progressBackgroundSrc to "full" starts, backgroundSrc to "empty" stars.

If you need to lock it after setting it, in the onValueChanged just set
isEnableX to false.

It still lacks the "existing rating" (red stars) that the stars widget you
linked in has. If this is important to you, it could be accomplished by
extending the Slider (ala SliderHorizontal) to add it.

The latest versions of prototype play fine with dojo as long as you have
dojo load *first*, although I personally prefer to not mix them.

Hope this helps,

Matt

On 12/8/06, Richard Wallace wrote:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061209/d715...

Richard Wallace wrote:
I just built a dojo stars widget a few days ago (with the basic
behaviour of the beauscott one and some other features) which I can
submit to dojo at the end of this week - I need a chance to clean it up
and document it better before I send it in.

Can you wait that long?

Rob :)

--
One Track Mind Ltd.
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Mobile +64-21-572 632
Web http://www.onetrackmind.co.nz

Back to top