1
Hello!
I would like a help regarding the click on a table.
When I clicked on the row came the data of this row, except when clicked on a specific column (column 3 for example), because I want to do another action in the column in question.
To bring the table data I already have, it is only necessary to put in exception the column I would like.
Thanks...
$("tr").on('click',function() {
var tableData = $(this).children("td").map(function(){
return $(this).text();
}).get();
var codigo = $.trim(tableData[0]) ;
alert('Codigo: '+codigo);
})
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<table class="table table-responsive table-hover">
<thead>
<th>ID</th>
<th>Nome</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Carlos</td>
<td>Ativo</td>
</tr>
<tr>
<td>2</td>
<td>Charles</td>
<td>Inativo</td>
</tr>
<tr>
<td>3</td>
<td>Ozeias</td>
<td>Ativo</td>
</tr>
</tbody>
</table>
This exception column has some particular class?
– Sergio
has no. At least yet
– adventistaam