[Prototype-core] [inPlaceEditor] Triggering onSave

2008-09-16 Thread Tokeiito
Hello, I have three elements and i need initialize editor on all of them in same time. Already made that when user clicks External Control element, editor initializes on all elements i need. But now stuck with saving them. I've removed Ok and Cancel buttons/links for all fields. Now i need to mak

[Prototype-core] Re: Foreach Loops

2008-09-16 Thread Yanick
I have seen two responses using filter().each() (or grep().each()) and I just wanted to say that, IMHO, this is not good practice, and thus should not be recommanded as this creates two iterations over the same array for the same purpose and encourages bad coding habbits. The question is not "woul

[Prototype-core] Re: Foreach Loops

2008-09-16 Thread Simon Charette
Sorry Yannick, but even if I agree with you that findAll().each() is the 'Prototype' way which i would prefer to the grep method i suggested. It still creates two iterations while the grep solutions doesn't. Thats the main reason why i suggested this formula. 2008/9/16 Yanick <[EMAIL PROTECTED]>

[Prototype-core] Re: Foreach Loops

2008-09-16 Thread Mark Holton
I agree with you, Simon. The solutions that iterate over the loop 2x have poorer BigO than the grep method. That is, as the array size increases, the two iterations are O(N^2), while the grep method is more on the order of O(N). On Tue, Sep 16, 2008 at 9:08 AM, Simon Charette <[EMAIL PROTECTED

[Prototype-core] Re: Foreach Loops

2008-09-16 Thread Tom Gregory
Err, that line of reasoning is flawed. O (2n) [or, if you prefer, 2 * O (n)] is conceptually equal to O (n); neither are the same as O (n^2). Iterating through a loop twice (e.g. two loops in series) is still linear, not exponential. TAG On Sep 16, 2008, at 10:30 AM, Mark Holton wrote: >

[Prototype-core] Re: Foreach Loops

2008-09-16 Thread holtonma
You are correct. Mea culpa. ...It would only me O(n^2) if the second iteration was in the body of the first loop. On 9/16/08, Tom Gregory <[EMAIL PROTECTED]> wrote: > > Err, that line of reasoning is flawed. > > O (2n) [or, if you prefer, 2 * O (n)] is conceptually equal to O (n); > neither ar