Closed magamlag closed 8 years ago
Hi, I have a loop $.each , which shows dynamically 6 grades with star rating for each. I tried to inject .rating() to the loop, but no success. How makes .rating() work and show stars for every grade input field in the loop? Thank you.
For example: $i = 0; $.each(response, function (key, value) { i++; $('.input-grade').append(getHtml(i, value.grading_criteria_id, value.grading_criteria.name, value.grading_criteria.description, value.grade )); $('input.grade-rating-' + i).rating({ filled: 'fa fa-star fa-sm', filledSelected: 'fa fa-star fa-sm', empty: 'fa fa-star-o fa-sm' }); });
Hi, I have a loop $.each , which shows dynamically 6 grades with star rating for each. I tried to inject .rating() to the loop, but no success. How makes .rating() work and show stars for every grade input field in the loop? Thank you.
For example: $i = 0; $.each(response, function (key, value) { i++; $('.input-grade').append(getHtml(i, value.grading_criteria_id, value.grading_criteria.name, value.grading_criteria.description, value.grade )); $('input.grade-rating-' + i).rating({ filled: 'fa fa-star fa-sm', filledSelected: 'fa fa-star fa-sm', empty: 'fa fa-star-o fa-sm' }); });