We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Anyone have experience using jQuery DataTables and ExpressionEngine?

Development and Programming

upshot's avatar
upshot
85 posts
15 years ago
upshot's avatar upshot

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.

       
joe.dixon@selectamark.co.uk's avatar
[email protected]
6 posts
14 years ago
joe.dixon@selectamark.co.uk's avatar [email protected]

I am also having this issue. Any pointers on this would be gratefully received.

Thanks 😊

       
Adrian Macneil's avatar
Adrian Macneil
21 posts
14 years ago
Adrian Macneil's avatar Adrian Macneil

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 😊

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.