Open buglinjo opened 7 years ago
Uhm, I think that they are not actually new DOM elements but existing ones that are being modified/updated. I suspect that because it seems that the second and subsequent calls to rating()
are being ignored. It is because the plugin prevents multiple instantiations.
Could you try to destroy the instances before recreating them again? Something like this:
$('.container').find('.all-reviews-rating').each(function () {
// This is internal plugin structure that we will move to the destroy method
$(this).prev().remove();
$(this).removeData('rating');
});
$('.container').find('.all-reviews-rating').rating();
If it works we could just add a destroy
method to the plugin.
I have a problem. I'm using Vue.js and Laravel to paginate. I have Vue.js code:
I'm calling
$('.container').find('.all-reviews-rating').rating();
after fetching data, but when I get second page it leaves first element's value to second page:First Page:
Second Page:
As you can see. On the second page I have 1 star but it get's 5 stars. In HTML in input value it displays correctly.