How to: get array of first column where checkbox is checked in datatables
How to: get array of first column where checkbox is checked in datatables
Putjes
Posts: 8Questions: 2Answers: 0
I need the values of the first column in my datatables. This methode does not work very good... this in oTable.fnGetPosition(this); returns the button and not the checkbox. How to create a method that returns all the values of the first column where the checkbox (in 5th column ) is checked.
$('#saveChangesButton').click(function () {
var dataArr = [];
$("input:checked", oTable.fnGetNodes()).each(function () {
var position = oTable.fnGetPosition(this); // getting the clicked row position
var id = oTable.fnGetData(position)[0]; // getting the value of the first (invisible) column
dataArr.push(id);
alert(dataArr);
});
$('#guidsToBlock').val(dataArr);
});
thanks in advance...
R.
This discussion has been closed.