473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Effect.SlideUp is too slow--next statement executes immediately

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);
}
}
}

Nov 8 '07 #1
7 2834
nolo contendere wrote:
Effect.SlideUp('div_entry' + journal_rows);
Use afterFinish callback

--
# Regards || piotr[.]solnica[at]gmail[.]com || jid : s0****@jabster.pl #
# s0lnic || http://blog.solnic.in5.pl || icq : 385935391 #
Nov 8 '07 #2
SAM
nolo contendere a écrit :
the alert message appears before the Effect.SlideUp even begins.
What is Effect.SlideUp() ?
Where is it defined ?
Does it return something in end of job ?
How can I ensure that the SlideUp completes before
executing the next statement?
giving a new special argument to Effect.SlideUp() ?
to fire in end of slide the row's deleting.
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.
=====================
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+'?') ) {
Effect.SlideUp('div_entry' + journal_rows);
setTimeout( function() {
$(id).deleteRow(--journal_rows);
}, 2000);
}
}
}

or ... :

else {
if(confirm('want to delete journal row: '+journal_rows+'?') ) {
Effect.SlideUp('div_entry' + journal_rows);
var this_journal_row = --journal_rows;
setTimeout('$('+id+').deleteRow('+this_journal_row +')', 2000);
}
}
}
but ... perhaps ... :

else {
if (confirm('want to delete journal row: '+journal_rows+'?') ) {
while(!Effect.SlideUp('div_entry' + journal_rows)) '';
$(id).deleteRow(--journal_rows);
}
}
}
Nov 8 '07 #3
SAM wrote:
nolo contendere a écrit :
>the alert message appears before the Effect.SlideUp even begins.

What is *Effect.SlideUp() ?
Where is it defined ?
Does it return something in end of job ?
It's from script.aculo.us JS effects library.

--
# Regards || piotr[.]solnica[at]gmail[.]com || jid : s0****@jabster.pl #
# s0lnic || http://blog.solnic.in5.pl || icq : 385935391 #
Nov 9 '07 #4
SAM
s0lnic a écrit :
SAM wrote:
>nolo contendere a écrit :
>>the alert message appears before the Effect.SlideUp even begins.
What is Effect.SlideUp() ?
Where is it defined ?
Does it return something in end of job ?

It's from script.aculo.us JS effects library.
Ha! OK. (50ko of compressed code ...!)

So the answer isn't it here :
<http://wiki.script.aculo.us/scriptaculous/show/EffectQueues>
?

--
sm
Nov 9 '07 #5
On Nov 8, 6:36 pm, s0lnic <l...@my.sigwrote:
nolo contendere wrote:
Effect.SlideUp('div_entry' + journal_rows);

Use afterFinish callback

This worked! Thanks so much!

Effect.SlideUp('div_entry' + journal_rows, { afterFinish:
function () { $(id).deleteRow(--journal_rows) } } );

Nov 9 '07 #6
On Nov 9, 7:58 am, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
s0lnic a écrit :
SAM wrote:
nolo contendere a écrit :
the alert message appears before the Effect.SlideUp even begins.
What is Effect.SlideUp() ?
Where is it defined ?
Does it return something in end of job ?
It's from script.aculo.us JS effects library.

Ha! OK. (50ko of compressed code ...!)

So the answer isn't it here :
<http://wiki.script.aculo.us/scriptaculous/show/EffectQueues>
?
I believe that would have worked, although I didn't test it. I used
the afterFinish callback suggested by s01nic.

Nov 9 '07 #7
s0lnic wrote:
SAM wrote:
>nolo contendere a écrit :
>>the alert message appears before the Effect.SlideUp even begins.
What is Effect.SlideUp() ?
Where is it defined ?
Does it return something in end of job ?

It's from script.aculo.us JS effects library.
And hopefully the fact that at least two regulars of this newsgroup did not
know that has caused both of you to think in the right direction for a change.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 9 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
2
by: Rhino | last post by:
Is there some kind of requirement that a DECLARE CONTINUE HANDLER statement follow the DECLARE CURSOR statement in an SQL stored procedure? I am running DB2 V8.2.1 on Windows XP and am writing my...
9
by: VenuGopal | last post by:
Hi, why n++ executes faster than n+1..... or does it realli execute faster? thanks Venugopal.B
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
1
by: alisbub | last post by:
DOes anyone know how to get the answer to this?? Please Help me. A simple way to to test the effect of a continue statement in the body of a for loop. What is printed? for (putchar( ' 1 ' );...
11
by: guy | last post by:
I am able to use the Server Explorer to create a dataset containing tables in my database. I am able to bind a table to my combobox and set a filter by including a where clause. But I am unable to...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
3
by: Krishnam | last post by:
thanks for your time Any body please explain the actual mechanism performed while executing the printf()( with the help of stack if possible ) eg: printf("%d%d",a++,--a,a--);
2
AmberJain
by: AmberJain | last post by:
HELLO, Wikipedia defines return statement as: Now there's a C program I have coded---->
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.