Frage

I am having a problem building an application that includes TableTools. I am using r.js and the build line is

E:\Software\nodejs\node r.js -o build.js

The build.js is

({
    baseUrl: ".",
    paths: {
            'jquery'  : 'jquery-1.9.1',
            'jquery-ui' : 'jquery-ui-1.10.3.custom',
            'jquery.dataTables': 'jquery.dataTables',
            'jquery.tableTools' : 'TableTools'
    },
    name: "build_main",
    out: "external.min.js",
    optimize: "none"
})

Note that I have flattened all of the directories to make it easier to investigate.

When I load my test application, I get the message

Warning: TableTools 2 requires DataTables 1.9.0 or newer ...

I am pretty sure that DataTables is correctly specified in the build. It would seem that when the check in the TableTools code is done DataTables doesn't seem to have been fully loaded/initialised. If I put a break point at the line

if ( typeof $.fn.dataTable == "function" &&

in external.min.js and then step through, it won't popup the warning. Datatables looks to have been correctly initialised just by putting in a breakpoint and stepping through. If I remove TableTools then everything loads fine - DataTables is there.

War es hilfreich?

Lösung

This can happen due to several reason as mentioned below,

  1. You are using previous versions of Data-tables.

  2. Not mentioning data tables in the build.

  3. Older browser version or browser not supporting data-tables.

  4. Slow internet.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top