Bruno Sartori Bruno Sartori - 1 year ago 111
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');

Answer Source

Map the values to array

var values = $(cell).find(':input').map(function(){
    return this.value
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download