Closed GoogleCodeExporter closed 8 years ago
I would definitely like to see this as well.
Original comment by elimegro...@gmail.com
on 11 Mar 2009 at 7:38
I found a workaround. You can fake a click event on the appropriate star.
var current = 3; // the current rating
var el = $(".star_group_yourRating")[current - 1]; // grab the third star
$.rating.event.click("yourRating", el, {}) // pretend someone clicked it
Still, it'd be nice if there were a built-in way to do this.
Original comment by dean.thr...@gmail.com
on 11 Mar 2009 at 9:23
This is a great suggestion Dean. I do think the best way is to fake a click as
this
takes care of all related events (eg.: auto submission, etc). Now all I have to
do is
expose an API method to click the relevant element based on...
a) a given index (as your example suggests)
b) a given value (loop through the set and click the one that matches it)
...what do you think?
Original comment by diego.a...@gmail.com
on 12 Mar 2009 at 9:24
I agree! My original task was to do B, set the plug-in according to the current
value. (In my case, the stars went from 1-5, so the index and the value just
happened
to be the same.)
Original comment by dean.thr...@gmail.com
on 12 Mar 2009 at 1:19
Oh, I should also mention that I used a similar technique to call
$.rating.event.fill
on a group of read-only stars. This set of stars was used to display the
average of
all ratings. I didn't want the user to interact with it, but I still needed to
set
its value programmatically with the values returned from the database.
Original comment by dean.thr...@gmail.com
on 12 Mar 2009 at 1:22
Thanks for the info Dean, I will add this on the next release of the plugin -
hopefully over the weekend...
Original comment by diego.a...@gmail.com
on 12 Mar 2009 at 3:07
This feature is now available in v3.
See the "API" tab of the documentation here:
http://www.fyneworks.com/jquery/star-rating/
Original comment by diego.a...@gmail.com
on 16 Mar 2009 at 5:20
Thanks, Diego! I've checked out the new API. Looks great!
Original comment by dean.thr...@gmail.com
on 16 Mar 2009 at 6:17
Original issue reported on code.google.com by
dean.thr...@gmail.com
on 6 Mar 2009 at 10:11