使用dataTables.js时遇到的问题。

代码如下:

 var myTable = $('#dynamic-table')
.dataTable({
bAutoWidth : false,
"aoColumns" : [ {
"bSortable" : false
}, null, null, null ],
"aaSorting" : [],
}); $('#dynamic-table tbody').on( 'click', 'input', function () {
var data = myTable.row( this ).data();
});

解决办法一:

修改第2行的创建接口,修改后的代码如下:

 2       .DataTable({

解决办法二:

修改第11行的调用接口,修改后的代码如下:

11       var data = myTable.api().row( this ).data();

以上方法二选一即可。

[dataTables.js error] Uncaught TypeError: myTable.row is not a function的更多相关文章

  1. jquery.js 3.0报错, Uncaught TypeError: url.indexOf is not a function

    转载自:http://majing.io/questions/432   问题描述 jQuery升级到3.0.0后类型错误 jquery.js:9612 Uncaught TypeError: url ...

  2. jQuery-2.1.4.min.js:4 Uncaught TypeError: Illegal invocation

    jQuery-2.1.4.min.js:4 Uncaught TypeError: Illegal invocation 此错误与crsf有关

  3. index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined

    使用 webpack 编译 Vue 项目时出现报错: index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined ...

  4. 【jQuery】jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined

    jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read p ...

  5. vue项目报错1 Vue is a constructor and should be called with the `new` keyword && jquery.js?eedf:3850 Uncaught TypeError: this._init is not a function...

    Vue is a constructor and should be called with the `new` keyword Uncaught TypeError: this._init is n ...

  6. 使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法

    在使用zepto时,我先引入zepto.min.js,然后引入fx.js,但是在使用animate函数时,控制台却报如下错误: Uncaught TypeError: this.bind is not ...

  7. jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function

    jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function 使用.load()绑定事件时报错,Uncaught TypeError: e.i ...

  8. 简记webpack运行报错 Uncaught TypeError: self.postMessage is not a function

    说好2017Fix的还是能重现,可能项目的版本比较旧了,简要记录解决办法 1.错误: index.js?bed3:67 Uncaught TypeError: self.postMessage is ...

  9. jQuery报错:Uncaught TypeError: _this.attr is not a function

    问题:想通过延时把置灰的按钮再次复原,代码如下: $("#sendEmailCode").on("click", function() { var _this ...

随机推荐

  1. Objective-C语言的面向对象特性

    Objective-C作为一种面向对象的编程语言,具有面向对象的基本特征,即:封装.继承和多态.主要介绍Objective-C中有关面向对象基本概念:类.对象.方法和属性等. 类是Objective- ...

  2. 【python cookbook】【字符串与文本】3.利用shell通配符做字符串匹配

    问题:当工作在Linux shell下时,使用常见的通配符模式(即,*.py.Dat[0-9]*.csv等)来对文本做匹配 解决方案:fnmatch模块提供的两个函数fnmatch().fnmatch ...

  3. spring Aop的一个demo

    面向切面是什么我就不说了. 上代码: package com.foreveross.service.weixin.test; import java.lang.annotation.Documente ...

  4. scala模式匹配

    package com.ming.test /** * 模式匹配 */ object MatchTest { def main(args: Array[String]): Unit = { //mat ...

  5. textarea输入框限制字数(JS)

    第一种: <textarea onkeyup="checkLen(this)"></textarea> <div>您还可以输入 <span ...

  6. MVP MVC MVVM 傻傻分不清

    最近MVC (Model-View-Controller) 和MVVM (Model-View-ViewModel) 在微软圈成为显学,ASP.NET MVC 和WPF 的Prism (MVVM Fr ...

  7. 阅读推荐——深入浅出Mesos

    深入浅出Mesos(一):为软件定义数据中心而生的操作系统http://www.infoq.com/cn/articles/analyse-mesos-part-01 深入浅出Mesos(二):Mes ...

  8. PHP程序中删除字符串最后一个字符的三种方法

    常见的语法格式: foreach ($arr as $key => $value) {$arr_str = $arr['x_id'] . ',' . $arr_str;} 假设字符数组 $arr ...

  9. 删除 SQL Server 2005 Express 工具

    安装sql server 2008 management,提示错误:Sql2005SsmsExpressFacet 检查是否安装了 SQL Server 2005 Express 工具. 失败,已安装 ...

  10. 霸气的jQ插件

    http://codepen.io/ canvas的各种实例 1.The Responsive jQuery Content Slider http://bxslider.com/ 2.ThemePu ...