czesc
Chcialbym przelozyc przyklad z tego linka:
https://editor.datatables.net/examples/simple/multiRow.htmlJednak 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>
<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" >
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 }
]
} );
} );
<table id="example" class="display" cellspacing="0" width="100%"> <td>Software Engineer
</td> <td>Brielle Williamson
</td> <td>Integration Specialist
</td>
Moze wiecie gdzie lezy przyczyna bledu?
Ten post edytował Tomasz7755 13.07.2016, 21:52:49