【问题标题】:$fromInput.datepicker is not a function yadcf on datatables$fromInput.datepicker 不是数据表上的函数 yadcf
【发布时间】:2016-07-04 15:16:01
【问题描述】:

我试图在 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" />

缺少什么?

【问题讨论】:

    标签: yadcf


    【解决方案1】:

    你缺少 jquery ui 库 - 确保你的 js 中有 jquery ui 滑块,你可以得到它from here

    【讨论】:

    • 谢谢。它没有记录在案。只是想知道 - 是否有您正在使用的样式表,也许引导程序想让它看起来更现代和酷?来自耶路撒冷的你好
    • 它也写在展示页面和github页面上“日期输入 - 使用jQuery UI Datepicker小部件(有一些增强)”,你也可以使用Bootstrap datepicker(eonasdan-bootstrap-datetimepicker ) , 阅读docs on how - datepicker_type
    猜你喜欢
    • 1970-01-01
    • 2014-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多