收到类似“无法读取未定义的属性'ext'的错误”在jQuery数据表中 [英] Getting error like "Cannot read property 'ext' of undefined" in Jquery Datatable

查看:102
本文介绍了收到类似“无法读取未定义的属性'ext'的错误”在jQuery数据表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在jquery数据表中显示打印按钮。但是出现类似无法读取未定义的属性'ext'的错误。

I am trying to show print button in jquery data table. But getting error like "Cannot read property 'ext' of undefined.

我使用的脚本是

script_tag('www/js/data-tables/buttons.html5.js').
script_tag('www/js/data-tables/buttons.print.js').
script_tag('www/js/data-tables/dataTables.buttons.js').
script_tag('www/js/data-tables/jquery.dataTables.js')

和CSS,

link_tag('www/js/data-tables/buttons.dataTables.css')

推荐答案

以相反的顺序声明脚本:

Declare the scripts in the reverse order :

script_tag('www/js/data-tables/jquery.dataTables.js')
script_tag('www/js/data-tables/dataTables.buttons.js').
script_tag('www/js/data-tables/buttons.html5.js').
script_tag('www/js/data-tables/buttons.print.js').

dataTables扩展要访问 $。fn.DataTable ext ,如果尚未包含 jquery.dataTables.js ,则不存在。

dataTables extensions wants to access $.fn.DataTable.ext, which not is present if jquery.dataTables.js not yet is included.

这篇关于收到类似“无法读取未定义的属性'ext'的错误”在jQuery数据表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆