DataTables get values from multiple selected rows
DataTables get values from multiple selected rows
Serialcek
Posts: 2Questions: 0Answers: 0
Hi to everyone :)
I would like to get values from more than one selected row.
This is my code for getting the value from one row..
$(document).ready(function () {
$('#example').dataTable({
"scrollY": "500px",
"scrollCollapse": true,
"paging": false,
"processing": true,
"serverSide": true,
"ajax": "datatables-scripts/server_processing.php"
});
var table = $('#example').DataTable();
var x;
var y;
$('#example tbody').on('click', 'tr', function () {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
} else {
table.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
}
$('#example tbody tr').click(function () {
y = $(this).index();
});
$('#example tbody td').click(function () {
x = $(this).index();
});
});
$('#delete').click(function () {
var tablee = document.getElementById('example');
var name = tablee.rows[y + 1].cells[0].innerHTML;
alert(name);
});
});
Can anyone help me.. :)
This discussion has been closed.
Replies
Anyone?