Closed binskeep closed 8 years ago
Hi @binskeep , can you elaborate a bit more?. Not sure what you mean by the previous initialRating. There's only one initialRating, the one you use to load the first time.
User case: I have a 'read only' starRating that displays the average of everyones starRating. I have another starRating that allows the operator to enter the operator's starRating. When the ajax call returns from the updating the operator's starRating, I need to update the 'read only' starRating. It has already been initialized and displayed. However I need to be able to update the 'read only' with the new average. I ended up unloading and erasing the 'read only' starRating, then rebuilding a new 'read only' starRating. It would be nice to allow updating the initialRating after it's been loaded.
I get you now, good point. I'm gonna add a new method to update the current rating.
@binskeep Added a couple of new methods, let me know if that works for you
// set rating example
$('your-selector').starRating('setRating', 2.5)
// get rating example
$('your-selector').starRating('getRating')
Hi Nashio, I just downloaded v1.0.1 That did the trick. I don't have to unload/reload the plugin. Thanks!
I tried to re-initialize a star rating with new initialRating. The previous initialRating remained. How do you go about doing it?