OK - So I implemented this and the performance sucked on IE so I made some more performance improvements. After a few iterations I think I'm happy with the way it's working.
We can complain (to put it mildly) about IE's javascript performance all we want but the useful unintended consequence of that is it forces web developers to optimize their code for performance. Here are the things that helped improve performance: 1. Michael G's suggestions for using $("#mydiv)[0].innerHTML = abc instead of $("#mydiv).remove().append(abc), and for using array/join instead of string concatenation to build long HTML strings. 2. When attaching an event to thousands of checkboxes, $("#mydiv input [attr^=val]").live(..) is much faster than $("#mydiv :checkbox").live (..) On Sep 28, 1:38 pm, Mike McNally <emmecin...@gmail.com> wrote: > On Mon, Sep 28, 2009 at 3:34 PM, Michael Geary <m...@mg.to> wrote: > > Mike, the requirement here isn't just to show or hide all 3000 entries in > > one fell swoop. Sid needs to be able to show and hide individual entries > > depending on a filter. So there's no avoiding looping through all the > > entries, whether in JavaScript or on the server. > > Well in that case the alternative solution I described could be tried. > Instead of iterating through the entities calling show() and hide(), > iterate and build (carefully) a CSS block that includes CSS statements > for each entity, giving it a style of either "{ display: block; }" or > "{display: hidden; }". When the CSS is built, drop it into a waiting > <style> element on the page. > > -- > Turtle, turtle, on the ground, > Pink and shiny, turn around.