$fromInput.datepicker 不是数据表上的函数 yadcf
$fromInput.datepicker is not a function yadcf on datatables
我试图在 yadcf 中使用 range_date 列,但我得到:
$fromInput.datepicker is not a function
我的代码:
var table = $('#{{ table.opts.id }}').dataTable({
"buttons": [
'csv', 'excel', 'pdf', 'print'
],
....
}).yadcf([
{
column_number: 0,
filter_type: "range_date",
date_format: "mm/dd/yyyy",
filter_delay: 500
},
{
column_number: 1,
filter_type: "text",
filter_delay: 500
},
{
column_number: 2,
filter_type: "text",
filter_delay: 500
},
{
column_number: 3,
filter_type: "text",
filter_delay: 500
},
{
column_number: 4,
filter_type: "text",
filter_delay: 500
},
]);
});
我导入以下文件:
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.1/css/buttons.dataTables.min.css">
<script src="//code.jquery.com/jquery-1.12.3.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js" ></script>
<link href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Export buttons -->
<script src="https://cdn.datatables.net/buttons/1.2.1/js/dataTables.buttons.min.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.flash.min.js" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js" ></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js" ></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.print.min.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.html5.min.js" ></script>
<script type="text/javascript" charset="utf-8" src="/static/datatable/jquery.dataTables.yadcf.0.8.9.js"></script>
<link href="/static/datatable/jquery.dataTables.yadcf.0.8.9.css" rel="stylesheet" type="text/css" />
缺少什么?
您缺少 jquery ui 库 - 确保您的 js 中有 jquery ui 滑块,您可以得到它 from here
我试图在 yadcf 中使用 range_date 列,但我得到:
$fromInput.datepicker is not a function
我的代码:
var table = $('#{{ table.opts.id }}').dataTable({
"buttons": [
'csv', 'excel', 'pdf', 'print'
],
....
}).yadcf([
{
column_number: 0,
filter_type: "range_date",
date_format: "mm/dd/yyyy",
filter_delay: 500
},
{
column_number: 1,
filter_type: "text",
filter_delay: 500
},
{
column_number: 2,
filter_type: "text",
filter_delay: 500
},
{
column_number: 3,
filter_type: "text",
filter_delay: 500
},
{
column_number: 4,
filter_type: "text",
filter_delay: 500
},
]);
});
我导入以下文件:
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.1/css/buttons.dataTables.min.css">
<script src="//code.jquery.com/jquery-1.12.3.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js" ></script>
<link href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Export buttons -->
<script src="https://cdn.datatables.net/buttons/1.2.1/js/dataTables.buttons.min.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.flash.min.js" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js" ></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js" ></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.print.min.js" ></script>
<script src="https://cdn.datatables.net/buttons/1.2.1/js/buttons.html5.min.js" ></script>
<script type="text/javascript" charset="utf-8" src="/static/datatable/jquery.dataTables.yadcf.0.8.9.js"></script>
<link href="/static/datatable/jquery.dataTables.yadcf.0.8.9.css" rel="stylesheet" type="text/css" />
缺少什么?
您缺少 jquery ui 库 - 确保您的 js 中有 jquery ui 滑块,您可以得到它 from here