161
rated 0 times
[
167]
[
6]
/ answers: 1 / hits: 25179
/ 10 Years ago, thu, october 30, 2014, 12:00:00
I use datatables (http://datatables.net/) for creating table with JSON and I have a code:
<script type=text/javascript>
$(document).ready(function() {
$('#example').dataTable( {
ajax: objects.txt,
columns: [
{ data: name },
{ data: position },
{ data: office },
{ data: extn },
{ data: start_date },
{ data: salary }
]
} );
} );
</script>
<div class=container>
<table id=example class=table table-striped table-bordered table-responsitive cellspacing=0 width=100%>
<thead>
<tr>
<th>DAN</th>
<th>Aktivnost</th>
<th>Vreme</th>
<th>Rashodi</th>
<th>Prihodi</th>
<th>Beleske</th>
</tr>
</thead>
<tfoot>
<tr>
<th>DAN</th>
<th>Aktivnost</th>
<th>Vreme</th>
<th>Rashodi</th>
<th>Prihodi</th>
<th>Beleske</th>
</tr>
</tfoot>
</table>
</div>
How I can get name of row and name of column when I click on some cell ?
ALso how to get ID of row and ID of column when click on some cell in table?
More From » jquery