Bruno Sartori Bruno Sartori - 6 months ago 32
Javascript Question

How to get multiple input values inside one DataTables column?

I have a DataTables wich i need to set 2 inputs in the same column, i know how to get the value if there is one input per column as below:

var table = $('#example').DataTable();

table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var cell = table.cell({ row: rowIdx, column: 0 }).node();

console.log($('input', cell).val());

How can i get the two values ?

table.cell({row: rowIdx, column:0}).node().find('#inputOne');


Map the values to array

var values = $(cell).find(':input').map(function(){
    return this.value