I wan to use DataTables (a jQuery-plugin) for displaying data. Installation and setup is done, searching in my data via DataTables works fine so far. I am using DataTables v1.10.12, my jQuery is stuck to 1.9.1.
I want to disable bindings of events, or have no events at all - how can I do this?
Background
I am developing a plugin for a 3rd party application. This application encapsulates jQuery, I cannot change this.
When using DataTables, I am running into an error
TypeError: Cannot read property 'length' of undefined
Right now, I am working around this issue by
jQuery("#my-table").DataTable({"ordering": false, "paging":false});
I have no clue, where this error comes from, but I have the stack-trace and I am seeing, if I would not bind some events, this problem would not occur. Of course, this is not a good solution, but for time being the only, I can use.
Uncaught TypeError: Cannot read property 'length' of undefined
jQuery.extend.map @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:876
(anonymous function) @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:30520
keyHandler @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:30523
jQuery.event.add @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:4926
jQuery.event.add @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:10312
...
jQuery.fn.extend.bind @ batch.js?analytics-enabled=true&bamboo-nps-dark-feature=true&devtoolbar=true&is-server-instance=tru…:7673
_fnBindAction @ jquery.dataTables.js:6533
_fnSortAttachListener @ jquery.dataTables.js:6154
_fnBuildHead @ jquery.dataTables.js:3210
_fnInitialise @ jquery.dataTables.js:4682
(anonymous function) @ jquery.dataTables.js:1339
With:
jquery.dataTables.js:6526 function _fnBindAction( n, oData, fn )
jquery.dataTables.js:6527 {
jquery.dataTables.js:6528 $(n)
jquery.dataTables.js:6529 .bind( 'click.DT', oData, function (e) {
jquery.dataTables.js:6530 n.blur(); // Remove focus outline for mouse users
jquery.dataTables.js:6531 fn(e);
jquery.dataTables.js:6532 } )
jquery.dataTables.js:6533 .bind( 'keypress.DT', oData, function (e){
#my-table, most likely it has mismatch of columns in thetheadandtbodyelements or some other structural problems.