我正在尝试使用带有数据表的"yadcf"过滤插件,并将"未捕获的TypeError:undefined不是函数"作为调用yadcf函数的错误.
我已经验证插件已加载,我不确定是什么问题.
以下是要加载的库:
<script type="text/javascript" charset="utf-8" src="/DataTables/media/js/jquery-1.10.2.js"></script>
<script type="text/javascript" charset="utf-8" src="/DataTables/jquery-ui-1.10.3/ui/jquery-ui.js"></script>
<script type="text/javascript" charset="utf-8" src="/DataTables-1.10.0/media/js/nightly2.js"></script>
<script type="text/javascript" charset="utf-8" src="/yadcf-0.7.4/jquery.dataTables.yadcf.js"></script>
Run Code Online (Sandbox Code Playgroud)
css文件:
<style type="text/css" title="currentStyle">
@import "/DataTables/media/css/demo_table.css";
@import "/yadcf-0.7.4/jquery.dataTables.yadcf.css";
@import "/DataTables/examples/examples_support/themes/ui-lightness/jquery-ui-1.8.4.custom.css";
</style>
Run Code Online (Sandbox Code Playgroud)
数据表:
oTable = $('#FE_Time_Table').DataTable( {
"ajax":{"url": 'FE_Data.php', "dataSrc":'data'},
"jQueryUI": true, //Allow use of jquery-ui plug-in for themes
"dom": 'W<"H"frCi>tS<"">', //Settings for where all the options appear on the page
"columns": [
{ "name": "plate_no", "data": "plate_no", "className": "center_text" },
{ "name": "job_no", "data": "job_no", "className": "center_text" },
{ "name": "customer", "data": "customer" },
{ "name": "device", "data": "device" },
]
}).yadcf([{column_number : 0}]);
Run Code Online (Sandbox Code Playgroud)
Dan*_*iel 10
你需要使用最新的yadcf版本0.8.2,从github repo中获取它
然后你应该使用yadcf的新init函数,就像这样
var Table = $('#FE_Time_Table').DataTable(...);
yadcf.init(Table , [{column_number : 0}]);
Run Code Online (Sandbox Code Playgroud)
你可以在展示中看到这个新的init函数
ps我是yadcf的作者
| 归档时间: |
|
| 查看次数: |
4911 次 |
| 最近记录: |