Barbatus:stars-rating Package Rating Undefined error


#1

Dear All,

I am making a start rating comment, where I am using the package barbatus:stars-rating.

However If I have two comments in the same window:

{{#each Updates}}
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title" align="center">Update</h3>
        </div>
        <div class="panel-body">
            <table class="table">
                <tr>
                    <td width="15%" nowrap align="left">2:</td>
                    <td width="35%" align="left">2</td>
                    <td width="15%" nowrap align="left">2</td>
                    <td width="35%" align="left">2</td>
                    <td width="15%" nowrap align="left">Rating:</td>
                    <td width="35%" align="left" class="rate">{{> starsRating id='rating' size='lg' mutable=true}}</td>
                </tr>
            </table>
        </div>
      </div>
{{/each}}

When I select a start in the second comment of a list of comments, the returned value is: “Undefined”.

Template.Update.events({
‘click .rate’: function(event){
event.preventDefault();
var rating = $(’#rating’).data(“userrating”);
console.log(rating);
Session.set(‘UpdateId’, this._id);
var UpdateId = this._id;
console.log(UpdateId);
return false;
}
});

Return value, screenshot: http://screencast.com/t/dC0p6duJJKbQ.

Then, do you know, how can I resolved it?

I really appreciate all your help about it,

If you have any question just let me know, have a great day.


Star Rating value undefined / 0