I’m developing my own custom modules for ExpressionEngine and I’d like to retain a consistent look/feel with the baked-in features of ExpressionEngine, so I’m trying to use DataTables. However I’m getting a Javascript error when I try. Here’s my setup…
I load the DataTables plugin using:
$this->EE->cp->add_js_script(array('plugin' => 'dataTables'));I load my own custom Javascript file using:
$this->EE->cp->load_package_js('index');The contents of this custom Javascript file are very basic:
$(document).ready(function() {
$('#tblBuilders').dataTable();
});The error I get is:
b is null
Does anyone have advice for me on this? I just don’t see any working examples anywhere on the Internet. I have a ton of experience working with both CodeIgniter and jQuery but I’m new to ExpressionEngine and wondering why something basic like this doesn’t work.
I am also having this issue. Any pointers on this would be gratefully received.
Thanks 😊
We use DataTables heavily in our Store module, but we couldn’t get the EE-bundled DataTables to do anything useful. Kept getting that same “b is null” error as you are seeing.
I couldn’t figure out how the EE version was even working, but the version they have bundled is not even an official release. I remember downloading an uncompressed copy of the same version which is supposedly included in EE (to find out where the JS error was occurring), and the error went away.
We ended up just bundling our own version of DataTables with our add-on. You can still use all the same css classes, and it will save you some headaches 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.