Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic initial vlue #41

Open
msnmkh opened this issue Oct 12, 2018 · 3 comments
Open

Dynamic initial vlue #41

msnmkh opened this issue Oct 12, 2018 · 3 comments

Comments

@msnmkh
Copy link

msnmkh commented Oct 12, 2018

Hi,I want to initial value from server but i can not do this.
the starRating method does not any condition to get data form source (like div ,span ,..).
is there any way?

@hoangnamitc
Copy link

Me too?

@Sahta77
Copy link

Sahta77 commented Jun 22, 2019

you can put anything you want inside the method. here is my code snippet:
$(".my-rating").map(function () {
$(this).starRating({
strokeColor: '#894A00',
minRating: 1,
initialRating: $(this).attr("value"),
strokeWidth: 10,
starSize: 25,
useFullStars: true,
readOnly: true,
});
});

i initialized multiple instances with values from database with this

@naczu
Copy link

naczu commented Jul 28, 2019

just use data-rating attribute

<div class="my-rating" data-rating="3"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants