SheryBulos
5 years agoAce
How to solve the conflict between litium jquery and the jquery that I use ?
Hello everyone,
How to solve conflict between lithium jquery and the jquery that I use ?
The scenario is as follows:
I need to have the on document ready function inside the liaAddScript however
- if I add a script for jquery I get error in the liaAddSCript content and
- If I didn't add a jquery script I get an error for all the $ is not a function.
Ps. this is what I mean by jquery script
<script src="/html/assets/jquery.min.js"></script>
<@liaAddScript>
;(function($){
$(document).ready(function() {
$('table.generic').DataTable();
} );
})(LITHIUM.jQuery);
</@liaAddScript>
<script>
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}});
}
</script>
Thanks in Advance,
Shery