Chcialbym przelozyc przyklad z tego linka: https://editor.datatables.net/examples/simple/multiRow.html
Jednak chcialbym aby dane byly pobierane z tabeli HTML, nie z ajaxa.
Dostaje niestety komunikat: TypeError: $.fn.dataTable.Editor is not a constructor
Moj kod :
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/jquery.dataTables.min.css" > <link rel="stylesheet" href="css/buttons.dataTables.min.css" > <link rel="stylesheet" href="css/select.dataTables.min.css" > <link rel="stylesheet" href="css/editor.dataTables.min.css" > <script> var editor; // use a global for the submit and return data rendering in the examples $(document).ready(function() { editor = new $.fn.dataTable.Editor( { table: "#example", fields: [ { label: "First name:", name: "first_name" }, { label: "Last name:", name: "last_name" }, { label: "Position:", name: "position" }, { label: "Office:", name: "office" }, { label: "Extension:", name: "extn" }, { label: "Start date:", name: "start_date", type: "datetime" }, { label: "Salary:", name: "salary" } ] } ); $('#example').DataTable( { select: true, buttons: [ { extend: "create", editor: editor }, { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ] } ); } ); </script> </head> <body> <table id="example" class="display" cellspacing="0" width="100%"> <thead> <tr> </tr> </thead> <tfoot> <tr> </tr> </tfoot> <tbody> <tr> </tr> <tr> </tr> <tr> </tr> </tbody> </table> </body>
Moze wiecie gdzie lezy przyczyna bledu?
