Open rajanmidd opened 8 years ago
do you have any solutions?
hi @ivanmfan and @rajanmidd you can use the following approach to load star rating after page load , add the following option inside the pager
option in the list view
'eventOnRendered' => new \yii\web\JsExpression ( 'function(){var optVar = $("your_target_input_object_or_selector").attr("data-krajee-rating");options = window[optVar];$("your_target_input_object_or_selector").rating(options);}' )
hope this solves your problem
$script =<<<JS
jQuery.ias().on('rendered', function(items) {
$(".rating-widget").attr("data-krajee-rating"); // rating-widget given class to rating widget
options = window[optVar];
$(".rating-widget").rating(options);
});
JS;
$this->registerJs($script);``
I have fixed this problem. according "omer-sds commented on 21 Jul 2017" answer that we could maybe fix one time in instance but Multiple instances. so here the deal.
put this code after the starRating widget like this :
<?php echo StarRating::widget([ 'name' => 'rating', 'id' => 'YOUR ID NAME HERE', 'pluginOptions' => [ 'min' => 0, 'max' => 5, 'step' => 0.5, 'size' => 'sm', ], ]); ?>
At last thank to omer-sds
Hello All, Please help me on this.
I am using the yii2 scroll pagination and in the pagination use the ListView::widget.
when i scroll the page a button shows names as "load more " when i click on that link it load the items but rating start is not showing. Can you please help me on this.