Showing newly added table row using .show("slow")
- by Sam Mackrill
I am cloning a hidden table row then populating it and after validation I want to show the row using a jquery effect ... say .show("slow")
var baseRow = $("#tasks tr#baseTaskLine");
var newRow = baseRow.clone();
var lastRow = $("#tasks tr[id^='TaskLine_']" + dayClass + ":last");
var newRowId;
if (lastRow.length == 0) {
newRowId = "TaskLine_new0";
}
else {
newRowId = "TaskLine_new" + lastRow[0].rowIndex;
}
newRow.attr("id", newRowId);
:
[populate new row]
:
if (lastRow.length == 0) {
baseRow.after(newRow);
}
else {
lastRow.after(newRow);
}
newRow.hide();
:
:
[validate via webservice call]
:
newRow.show("slow");
This does show the row but it appears instantly. I have tried hiding all the <td> elements of the row then showing those and that does seem to work but some strange styles get added to each <td> which interfere with the formatting i.e. style="display: block;"