the alert message appears before the Effect.SlideUp even begins. How
can I ensure that the SlideUp completes before executing the next
statement? I've tried setTimeout, and I can kind of get it to work,
but that seems very kludgy, and may not work in all cases.
TIA
=====================
function add_entry( id ) {
var row = $(id).insertRow( journal_rows++ );
var cell0 = row.insertCell(0);
cell0.width="150px";
cell0.innerHTML = "<div id=div_entry" + journal_rows + "
style='display: none;' >Journal Entry " + journal_rows + ":<img src='/
images/notes.gif'>" +
"<textarea id=txt" + journal_rows + " name=txt"
+ journal_rows + " cols=64 rows=5 ></textarea></div>";
Effect.SlideDown('div_entry' + journal_rows);
}
function delete_entry( id, force ) {
if ( journal_rows < 2 ) {
return;
}
if ( force ) {
$(id).deleteRow( --journal_rows );
}
else {
if ( confirm('want to delete journal row: ' + journal_rows +
'?' ) ) {
// The delete happens too fast, tried
setTimeout("deleteRow", 1000), but breaks...
Effect.SlideUp('div_entry' + journal_rows);
alert( 'id: ' + id);
$(id).deleteRow(--journal_rows);
// setTimeout("$(id).deleteRow(--journal_rows)", 2000);
}
}
}