Selecting row (tr) after fnAddRow() problem
Selecting row (tr) after fnAddRow() problem
Hi,
I'm using this code for selecting current row in table
[code]
$("#routingTable tr").click(function(event) {
currRoutePos = routingTable.fnGetPosition(this); // current selected row position
currRouteData = routingTable.fnGetData(currRoutePos);
$("#routingTable tr td").removeClass('selected');
$(this).find("td").addClass('selected');
});
[/code]
It works just fine, but when I add a new row in table...
[code]
routingTable.fnAddData([
name.val(),
nenabled,
destination.val(),
netmask.val(),
gateway.val()
]);
[/code]
That row cannot be selected? Any suggestions?
Jan
I'm using this code for selecting current row in table
[code]
$("#routingTable tr").click(function(event) {
currRoutePos = routingTable.fnGetPosition(this); // current selected row position
currRouteData = routingTable.fnGetData(currRoutePos);
$("#routingTable tr td").removeClass('selected');
$(this).find("td").addClass('selected');
});
[/code]
It works just fine, but when I add a new row in table...
[code]
routingTable.fnAddData([
name.val(),
nenabled,
destination.val(),
netmask.val(),
gateway.val()
]);
[/code]
That row cannot be selected? Any suggestions?
Jan
This discussion has been closed.
Replies
[code]
$("#routingTable tr").live('click', function() {
[/code]
instead of
[code]
$("#routingTable tr").click(function(event) {
[/code]
Allan