Refresh two datatables tables and create star rating
Refresh two datatables tables and create star rating
vl4dimir
Posts: 1Questions: 1Answers: 0
If I reload 2 datatables one after another and then let it crate ration https://plugins.krajee.com/star-rating visualisation, like this
$("#" + assetsTableId).DataTable().ajax.reload(
function(){
//$(".rating").rating({ theme: "krajee-fas", stars: 5, min: 0, max: 5, step: 1, size: "xs", showCaption: false, displayOnly: true, readonly: true, showClear: false, animate: false });
$("#" + secondTableId).DataTable().ajax.reload(
$(".rating").rating({ theme: "krajee-fas", stars: 5, min: 0, max: 5, step: 1, size: "xs", showCaption: false, displayOnly: true, readonly: true, showClear: false, animate: false })
);
}
);
I get errror
jquery.dataTables.min.js:4 Uncaught TypeError: t is not a function
at HTMLTableElement.<anonymous> (jquery.dataTables.min.js:4:48391)
at HTMLTableElement.e (jquery-2.2.3.min.js:3:5222)
at HTMLTableElement.dispatch (jquery-2.2.3.min.js:3:7537)
at r.handle (jquery-2.2.3.min.js:3:5620)
at Object.trigger (jquery-2.2.3.min.js:4:4836)
at HTMLTableElement.<anonymous> (jquery-2.2.3.min.js:4:5389)
at Function.each (jquery-2.2.3.min.js:2:2861)
at n.fn.init.each (jquery-2.2.3.min.js:2:845)
at n.fn.init.trigger (jquery-2.2.3.min.js:4:5365)
at R (jquery.dataTables.min.js:4:47659)
and it only creates stars in the first table.
If I only do refresh of one table and do the star-rating
it works no issue
Any ideas how to make this work?
Answers
It's hard to say what is causing that error without being able to debug to code. Please post a link to a simple test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
You can get an ajax loaded Datatable template from here.
Kevin