0

I'm having some trouble running multiple features (or "Extras") with my DataTables.js plug-in that's in a Drupal 6 module. When initializing my datatable with each feature independently, everything works as expected. However, when I try to initialize the features together, only the last initialized feature is enabled. In the code below, I am trying to initialize both ColReorder and ColVis. As executed, only ColVis is enabled when I run my program.

Thanks!

script.js

(function ($) {
    $(document).ready(function () {
        $("tableID").dataTable( {
            "sDom": 'Rlfrtip',
            "sDom": 'C<"clear">lfrtip'
        } );
    });
})(jQuery);

drupal.module

drupal_add_css("path/demo_page.css");
drupal_add_css("path/demo_table.css");
drupal_add_js("path/jquery.js");
drupal_add_js("path/jquery.dataTables.js");

drupal_add_css("path/ColReorder.css");
drupal_add_js("path/ColReorder.js");

drupal_add_css("path/ColVis.css");
drupal_add_js("path/ColVis.js");

drupal_add_js("path/script.js");

1 Answer 1

1

You cannot have multiple sDom definitions in the initialization routine. Try

(function ($) {
    $(document).ready(function () {
        $("tableID").dataTable( {
            "sDom": 'C<"clear">Rlfrtip'
        } );
    });
})(jQuery);

instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.