Closed Ilshidur closed 1 year ago
I want to know the same.. @Ilshidur did you get a solution? I basically stored the user click in my own collection and want to show the value from my collection on the screen. How do you set the star rating to a value. Example if i pass 3; three starts would be active.
I did not find a workaround for this, sorry. My "solution" was to add a "Submit rate" button below the stars and to set a 'click' listener on this. Therefore, I could set the user vote in the 'onRendering' template function. In this case, I didn't use the 'change' event of this control.
FYI, I kind of hacked my way around this as was getting a kind of infinite loop. Here's the psuedo-concept:
isCreated
I create a reactiveVar that waits (autorun
) for the data.onChange
even to set the reactiveVarwhen the template (with the rating widget) is onDestroyed
I then set the database value to the value stored
in the reactiveVar.
So this breaks the onChange
firing (which it would if you had it wired to the database value).
It's all in the title. I just want to set the default rating to the value the user set before.
Use case :
How can I manage to achieve this ?