Problem with firebug and sAjaxSource and row details example
Problem with firebug and sAjaxSource and row details example
aaronw
Posts: 89Questions: 3Answers: 4
So I have this, partial row details implemented:
[code]
var oTable = $('#example').dataTable( {
/* "aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[1, 'asc']],
*/
"bJQueryUI" : true,
"bStateSave": true,
"sAjaxSource": 'iosload.php'
});
var nCloneTh = document.createElement( 'th' );
var nCloneTd = document.createElement( 'td' );
nCloneTd.innerHTML = '';
nCloneTd.className = "center";
nCloneTh.className="ui-state-default";
$('#example thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[0] );
} );
$('#example tbody tr').each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );
} );
[/code]
The JSON is well formed (checked via JSONLINT) and it works fine when I don't try to do the row details example. This is on 3.6.13 firefox for Linux, if it matters.
When I just run the page straight up, it does make a new cell, but the cells don't seem to be propagated through the table. The example has the cloning and the insertion of the td cells before the call to dataTable(), but since I'm using the sAjaxSource, the table isn't there yet. The strange thing is when I use firebug to make some breakpoints on the .each functions of the thead or tbody, it does work. So I'm kind of baffled...
[code]
var oTable = $('#example').dataTable( {
/* "aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[1, 'asc']],
*/
"bJQueryUI" : true,
"bStateSave": true,
"sAjaxSource": 'iosload.php'
});
var nCloneTh = document.createElement( 'th' );
var nCloneTd = document.createElement( 'td' );
nCloneTd.innerHTML = '';
nCloneTd.className = "center";
nCloneTh.className="ui-state-default";
$('#example thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[0] );
} );
$('#example tbody tr').each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );
} );
[/code]
The JSON is well formed (checked via JSONLINT) and it works fine when I don't try to do the row details example. This is on 3.6.13 firefox for Linux, if it matters.
When I just run the page straight up, it does make a new cell, but the cells don't seem to be propagated through the table. The example has the cloning and the insertion of the td cells before the call to dataTable(), but since I'm using the sAjaxSource, the table isn't there yet. The strange thing is when I use firebug to make some breakpoints on the .each functions of the thead or tbody, it does work. So I'm kind of baffled...
This discussion has been closed.
Replies
[code]
$('td').editable('https://www.example.com/test/update.php');
[/code]
Again, it does not attach click handlers to the elements unless I put a breakpoint in firebug on that lline of the .editable function call, then it does. I installed the eventbug plug-in for firebug to be able to check on this sort of thing..... I'm really not sure what's going on...