Capture value cells
Capture value cells
vacanito
Posts: 9Questions: 2Answers: 0
hello, I need to capture the value of each cell to use a conditional, when using this code I only capture the cells of the first row, which I must modify so that functions in each row. Thanks for the help.
$('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
var idx = table.cell('selected').index();
var data = table.rows( idx ).data();
var vale_1 = data[0]['vale']['data'];
var vale_2 = data[0]['vale']['data_exit'];
console.log(vale_1+" "+vale_2)
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Change:
To be:
Also use
idx.row
to get the row index from the cell index.Allan
Thanks Allan, as always you have the precise answer.
Everything works perfect. What I try to do is to avoid that when one cell is selected another can be selected, the problem is that the alert is activated after the second one is selected, there is an event that activates the alert before on at the same time it is selected