html - jQuery Star Rating Plugin AND Knockoutjs -
i'm having problem using i'm sure i'm doing wrong. want use star rating system(http://www.fyneworks.com/jquery/star-rating/) , knockoutjs. right i'm displaying bunch of business info using foreach binding, want add star rating each business. without star rating stuff business display fine, when add star rating stuff can 1 business display , none of others show up. here have, know little crapastic right i'm new stuff.
<div style="float: right; width: 360px; height: 700px; overflow-y: scroll; overflow-x: hidden;" data-bind="foreach: businesses"> <a href="#" data-bind="attr:{href: '/home/businessdetail?name='+ name}" style="text-decoration: none;"> <div> <h5 data-bind="text: name" style="font-size: 14px;"></h5> <div data-bind="if: stars===5"> <div id="star1" class="star-rating rater-5 star star-rating-applied star-rating-readonly star-rating-on"></div> <div id="star2" class="star-rating rater-5 star star-rating-applied star-rating-readonly star-rating-on"></div> <div id="star3" class="star-rating rater-5 star star-rating-applied star-rating-readonly star-rating-on"></div> <div id="star4" class="star-rating rater-5 star star-rating-applied star-rating-readonly star-rating-on"></div> <div id="star5" class="star-rating rater-5 star star-rating-applied star-rating-readonly star-rating-on"></div> </div> <br /><h6 data-bind="text: fulladdress"></h6> <br /> <hr style="margin-top: 1px; margin-bottom: 1px;" /> </div> </a> </div> var viewmodel = { businesses: ko.observable(), businesscategories: ko.observable(), selectedcategoy: ko.observable(), latitudetext: ko.observable(33.4633733188117), longitudetext: ko.observable(-111.926908493042), milestext: ko.observable(10) };
so need add display stars if stars == 4...stars == 3 etc. happening here? why 1 business display?
Comments
Post a Comment