I've included the sample in jsFiddle.
My question is, how to get the row drop down selected value when trigger the "click" button at the same row.
This is my HTML:
<table id="table1">
<thead>
<tr>
<th>Item</th>
<th>UOM</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Item 1</td>
<td>
<select>
<option></option>
<option>BAG</option>
<option>UNIT</option>
</select>
</td>
<td>
<button type="button" class="add">Click</button>
</td>
</tr>
<tr>
<td>Item 1</td>
<td>
<select>
<option></option>
<option>BAG</option>
<option>UNIT</option>
</select>
</td>
<td>
<button type="button" class="add">Click</button>
</td>
</tr>
</tbody>
My JavaScript:
oTable = $("#table1").dataTable({
"fnDrawCallback": function(oSetting){
$(".add").click(function(){
var data = oTable.row($(this).parents('tr') ).data();
console.log(data);
});
}
});