jQuery dataTables makeEditable() is not a function

前端 未结 3 1499
误落风尘
误落风尘 2021-01-14 12:02

I\'m new to Datatables and I\'m trying to make the table editable, but I keep getting this error:

TypeError: $(...).dataTable(...).makeEditable is not

相关标签:
3条回答
  • 2021-01-14 12:30

    For jQuery version 1.9.1 jQuery datatable won't work. Try using jQuery version 1.7.1 instead.

    0 讨论(0)
  • 2021-01-14 12:34

    The imports have to be in certain order:

    jquery.min.js

    jquery-ui.min.js

    jquery.dataTables.min.js

    jquery.jeditable.js

    jquery.dataTables.editable.js

    jquery.validate.js

    After fixing this, update to latest versions fixed the problem!

    0 讨论(0)
  • 2021-01-14 12:44

    My situation was:

    (jQuery 3.x)

    from jQuery DataTables website I had following:

    <script>
        $(element).DataTable().makeEditable();
    </script>
    

    So - at first I had to change "DataTable" to "dataTable" giving:

    <script>
        $(element).dataTable().makeEditable();
    </script>
    

    Then it threw the error (in jquery.dataTables.editable.js): TypeError: $(...).live is not a function. Which I fixed according to this topic jQuery 1.9 .live() is not a function :

    line 655:

    //$(".table-action-deletelink", oTable).live("click", function (e) {
    $(oTable).on("click", ".table-action-deletelink", function (e) {
    
    0 讨论(0)
提交回复
热议问题