Hi,
I got row selection working in my datatable when I load the data statically in the html file. Ex:
<table id="tblTest" class="display">
<thead>
<tr>
<th>Test</th>
<th>TestID</th>
<th>Release Day</th>
<th>Release</th>
</tr>
</thead>
<tbody>
<tr>
<td>sample test 1</td>
<td>1</td>
<td>Mon</td>
<td class="center"><input type="checkbox" name="check1" value="1"></td>
</tr>
...
But, when I convert the rows of the table to come from data retrieved from a web service (via $.ajax call), the data displays, but the row selection no longer works.
To detect the row selection I tried two methods. First, I used click handler of the form:
$("#tblTest tbody tr").click(function (e) { ..... }
The other selection was done by setting oTableTools objects in the form:
"oTableTools" : {
"sRowSelect" : "single",
"fnRowSelected" : function(node) { alert('Row ' + node.id + ' selected.'); }
Both of these work for the static table and fail for the dynamic table.
Does anyone have an idea of what I am doing wrong?
Thanks,
Jerry
I got row selection working in my datatable when I load the data statically in the html file. Ex:
<table id="tblTest" class="display">
<thead>
<tr>
<th>Test</th>
<th>TestID</th>
<th>Release Day</th>
<th>Release</th>
</tr>
</thead>
<tbody>
<tr>
<td>sample test 1</td>
<td>1</td>
<td>Mon</td>
<td class="center"><input type="checkbox" name="check1" value="1"></td>
</tr>
...
But, when I convert the rows of the table to come from data retrieved from a web service (via $.ajax call), the data displays, but the row selection no longer works.
To detect the row selection I tried two methods. First, I used click handler of the form:
$("#tblTest tbody tr").click(function (e) { ..... }
The other selection was done by setting oTableTools objects in the form:
"oTableTools" : {
"sRowSelect" : "single",
"fnRowSelected" : function(node) { alert('Row ' + node.id + ' selected.'); }
Both of these work for the static table and fail for the dynamic table.
Does anyone have an idea of what I am doing wrong?
Thanks,
Jerry