Datatable conflict with Dojo
Datatable conflict with Dojo
soldiertt
Posts: 3Questions: 0Answers: 0
Hi,
I notice a very annoying conflict between datatable and dojo.js
Trying this simple example :
[code]
$(document).ready(function() {
$("#mytable").dataTable();
});
Name
Test
[/code]
Give me the js error : Uncaught TypeError: Object [object Object] has no method 'dataTable'
p.s : i'm using the Alfresco Share 4.2.0 product that includes dojo.js so i don't have the ability to remove this dependency.
Anybody knows how can i workaround on this ?
Thank you !
I notice a very annoying conflict between datatable and dojo.js
Trying this simple example :
[code]
$(document).ready(function() {
$("#mytable").dataTable();
});
Name
Test
[/code]
Give me the js error : Uncaught TypeError: Object [object Object] has no method 'dataTable'
p.s : i'm using the Alfresco Share 4.2.0 product that includes dojo.js so i don't have the ability to remove this dependency.
Anybody knows how can i workaround on this ?
Thank you !
This discussion has been closed.
Replies
Allan
Using jQuery doesn't help, please find the behaviour here : http://jsfiddle.net/6R6G3/ (two external resources) and look at your browser javascript console.
Regards.
Allan
I can only get DataTables to work when Dojo is configured in non-async mode. See this fiddle:
http://jsfiddle.net/thefork/aTuyn/
See Fiddle Options -> Framework script attribute -> [code]data-dojo-config="async:true"[/code]
The console error is still
[code]Uncaught TypeError: Object [object Object] has no method 'dataTable' [/code]
DataTables won't load when async:true, but if async:false is set instead then it works.
We use Dojo as a primary JS framework and it's loaded before jQuery, but DataTables is better than any dojo-based table (kudos) but it doesn't seem to load with an async dojo loader which is a common configuration for anyone using dojo. jQuery seems not to be the issue here.
I have the same problem. Demostrated in fsFiddle!!! i revert to 1.9.3 version to immediately solve it...but i need a solution. Can someone find a workaround?
The problem is for data-dojo-config="async:true" setted before loading jQuery a Datatables library.