Forum Discussion
Parshant
5 years agoBoss
Your are getting error just beacuse your code is coming under script tag as well, whenever if you wish to continue to run jquery code you should use
<@liaAddScript>
;(function($){
$(document).ready(function() {
$('table.generic').DataTable();
} );
})(LITHIUM.jQuery);
var setTablesFilters = (attrName, tableId, attrIndex) => {
var table = $('#'+tableId).DataTable();
let uniqueFilterList = table.column(attrIndex).data().unique().toArray();
return uniqueFilterList.map((val)=>{ return {'name':val, 'checked': false}});
}
</@liaAddScript>
or script code only in
<@liaAddScript>
var setTablesFilters = (attrName, tableId, attrIndex) => {
var table = $('#'+tableId).DataTable();
let uniqueFilterList = table.column(attrIndex).data().unique().toArray();
return uniqueFilterList.map((val)=>{ return {'name':val, 'checked': false}});
}
</@liaAddScript>
- SheryBulos5 years agoAce
Hello Parshant
First of all thank you so much for your help.
secondly when I put all the js code inside the <@liaAddacript> tag,
the onclick methods return "Uncaught ReferenceError: setTablesFilter is not defined at HTMLButtonElement.onclick"
Related Content
- 2 years ago
- 12 years ago