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>
Related Content
- 2 years ago
- 12 years ago
- 14 years ago