Forum Discussion
Parshant
6 years agoBoss
SheryBulos, Try this code:
<@liaAddScript>
    ;(function($){
        $(document).ready(function() {
            $('table.generic').DataTable();
        } );
				
			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}});
			}					
    })(LITHIUM.jQuery);
</@liaAddScript>
SheryBulos
6 years agoAce
Hello Parshant
Just to make sure that we are on the same page
I tried this but I got the same error also 
"Uncaught ReferenceError: setTablesFilter is not defined at HTMLButtonElement.onclick."
<@liaAddScript>
    ;(function($){
        // all js and jquery code here
    })(LITHIUM.jQuery);
</@liaAddScript> 
Thanks in advance,
Shery
- Parshant6 years agoBossSheryBulos , looks like library which contains setTablesFilter function is not added here in the community