Thanks, both good ideas. Here's what I was thinking:

On Dec 1, 2008, at 2:27 PM, Matt Foster wrote:

>
> I'd say your DOM traversals might add quite a bit of weight to your
> filter.  Why select the LI element if you're really looking at its
> child A element's innerHTML property ?
> Select those nodes and skip the execution of down, should speed things
> up quite a bit.

It's a chicken-or-egg problem, if I do what you suggest, then I have  
to do up('li') in order to hide and show the parent list item later.  
Since that's two up()s to one down(), I thought this was a good trade.

>
>
> Also if you're using a text input control then why not use keydown or
> keyup events to trigger the filter instead of a timer?  Timers
> (Intervals) add weight to the app, also it could execute as the user
> is typing which could slow down data entry before the user has
> finished what they were hoping to filter by.  If you do go for a key
> event put a timeout on it such that it won't execute until the user
> has *finished* typing, if you filter on each keystroke and the user
> types fast it could really gum things up.

That's an interesting idea. I had tried executing on the change event,  
but that wasn't firing until the field blurred. I didn't think of  
trying to capture the keystrokes. Do you have any examples of this I  
could look at for reference?

Thanks,

Walter

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to