TableTools code providing a DataTables warning message when an application is built using r.js

I had a problem creating an application that includes TableTools. I am using r.js and the build line

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

Build.js file

 ({ 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" }) 

Please note that I have smoothed out all the directories to make it easier to explore.

When I download my test application, I get a message

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

I am sure that DataTables is correctly specified in the assembly. It would seem that when checking the code of TableTools, the DataTables data did not seem to be fully loaded / initialized. If I put a breakpoint on the line

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

in external.min.js and then go, it will not display a warning. Datatables looks properly initialized by simply inserting a breakpoint and going through it. If I delete TableTools, then everything will load fine - there are DataTables.

+4
source share
1 answer

This can happen for several reasons, as indicated below.

  • You are using previous versions of data tables.

  • Not mentioning data tables in the assembly.

  • An old browser or browser that does not support data tables.

  • Slow internet.

+2
source

Source: https://habr.com/ru/post/1492151/


All Articles