Rating disappear

Nov 20, 2012 at 7:10 PM

When used with DataTables.net and you change to another page then RateIt doesn't rebind.

Can RateIt be made to use on() or some other way so that it will constantly detect new objects having class rateit and transform them into rating?

Nov 20, 2012 at 11:51 PM

Similar issue here, when using RateIt with Meteor - https://github.com/dandv/meteor-jquery-rating-demo/blob/master/jquery-rateit-demo.js#L10

Coordinator
Nov 22, 2012 at 6:29 AM

The problem described is not a specific RateIt problem, more a generic problem. In order for RateIt to dynamically rebind it needs to be able to bind to some generic "onpagechanged" event, and that doesn't really exist. 

Another way, and few jQuery plugins implement this, is that RateIt would create a timer, and on every x ms would search for new rateit controls on the page and bind them. But I really don't like this: (1) it causes sometimes undesired black magic (2) what if each control works like that, it would mean many many timers on a page (3) it is against the jQuery standard.

The correct solution lays with the implementor: you. I suppose DataTables.net triggers an event when a page changes (if not, that would be a bug at their side), you will have to handle that event and rebind RateIt on the new page.