CStarRating and CListView problem

When I sort a CListView list (using the provided AJAX sorting links), the CStarRating widgets in the CListView items are replaced by radio buttons. They are OK when the list is first loaded. How can I fix that?

Hi Petko, if it still problem, try ‘reinitialize’ stars after all ajax calls. Implement an ‘afterAjaxUpdate’ js function and call the .rating() for every strar block.

If we have CStarRating widgets in a CListView row by row like this:

$this->widget(‘CStarRating’,array( ‘name’ => ‘myrating[’.$index.’]’, …

Then in CListView definition:

‘afterAjaxUpdate’ => ‘function(id,data) { fixup_rating(); }’, …

fixup_rating() {

$(’#myrating_0 > input’).rating();

…etc etc

opps one more think if you choose this solution read and keep in mind this:

http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=5

good luck

Balázs

you can try to do the renderPartial like that:




$this->renderPartial($view, $params, false, true);