On creating dynamic listview star ratings are not displayed

Feb 5, 2013 at 10:49 AM
I am trying to create a dynamic listview, where each item in the list will contain star rating. If I create a static listview everything works fine, but on creating dyanmic listview we cannot see any star rating. How can I fix this issue.
Let me know if you need more inputs.
Coordinator
Feb 5, 2013 at 12:20 PM
Hi,

In order to "activate" the rateit control for items that have been added to the dom after domready, you'll simply need to call
 $('.rateit').rateit().
after you've loaded your listview.
Feb 5, 2013 at 12:44 PM
Thanks a lot.... it worked for me :-)
Feb 10, 2013 at 9:22 PM
I've spent the day trying to make this work and don't seem to be getting the hang of it.
I have a div id=comment1 with ratings in it that works fine.

Then I create additional divs using ajax that are inserted between the first div. The originals still work and the new ones show up, but clicking a star submits nothing.

At the end of my ajax call, after it posts the new div, I've tried rebinding with
$('#comment1 .rateit').rateit();
$('#comment2 .rateit').rateit();
$('.rateit').rateit();
But none of them seem to do the trick.
<div id=comment1>

     star rating - works
     star rating - works

<div id=comment2>

     new star rating - appears but doesn't work

</div id=comment2>
</div id=comment1>
Coordinator
Feb 11, 2013 at 5:25 AM
I've made a js fiddle that emulates your situation : http://jsfiddle.net/ZPnc9/1/ . With me it works.

If the JSFiddle is not according to your situation, edit it, and show me what you are doing.
Feb 19, 2013 at 7:33 PM
I've updated the js fiddle to be similar to what I'm doing. In this case, clicking the button will add multiple comments. Voting on each should update the "server response" div. (In reality I'm doing a bunch of processing and database manipulation). The first comment works, but the new comments just look pretty. I've a sneaking suspicion that I'm not binding correctly.

Sorry for the delay, I was out of the office.
Coordinator
Feb 20, 2013 at 5:19 AM
Is this what you want:
http://jsfiddle.net/ZPnc9/13/
Feb 20, 2013 at 11:02 AM
The fiddle link isn't working.
Coordinator
Feb 20, 2013 at 11:16 AM
http://jsfiddle.net/ZPnc9/13/
The href was different from text itself.
Feb 21, 2013 at 11:27 PM
Thanks for your help! Now to get my other scripts to cooperate with it. ;-)
Coordinator
Feb 24, 2013 at 5:32 AM
I'm happy I could help.