Drupal : how to add a JavaScript file in Ctools modal popup

1.2k Views Asked by At

how to add a JavaScript file in Ctools modal popup ?

I added the js file (datatables.js) in the .tpl.php file but it does not work?

The popup does not detect this file?

drupal_add_js(drupal_get_path('module', 'my_module') . '/jquery.dataTables.min.js');
1

There are 1 best solutions below

0
esod On

We're using document.ready and ajaxComplete:

$(document).ready(function () {
Drupal.behaviors.nameSpace.functionName();
});

and

$(document).ajaxComplete(function () {
Drupal.behaviors.nameSpace.functionName();
});

Clearly not a DRY solution, but it solves the problem for now.