Ich möchte Zeilen löschen, indem Sie einfach auf verwandte Schaltfläche klicken .. Datentabellen funktioniert, kann ich einige grundlegende Funktion wie Sortieren und suchen in Datentabelle, aber wenn ich auf die Schaltfläche nur klicken einfach gesagt undefiniert Fehler:Datatables .row() ist undefined
zu Ihrer Information, im Datentabelle 1.10 und jquery 1.10.2
Code verwendet:
<table cellpadding="0" cellspacing="0" border="0" class="row-border" id="table">
<thead>
<th>Video ID</th>
<th>Filename</th>
<th>Action</th>
</thead>
<tbody>
<td>1</td>
<td>ABCD</td>
<td><input type='button' name='deleteBtn' value='Delete' />
</tbody>
<tfoot>
<tr>
<th>Video ID</th>
<th>Filename</th>
<th>Action</th>
</tr>
</tfoot>
</table>
<script src="jquery.min.js"></script>
<script src="jquery.dataTables.min.js"></script>
<script type="text/javascript">
var table = $('#table').dataTable({});
$('#table tbody').on('click',"input[type='button']",function() {
table
.row($(this).parents('tr'))**
.remove()
.draw();
});
</script>
</body>
</html>
setzen Sie Ihr Skript in $ neu zu laden (document) .ready (function {}); –