>function Populate(instance_en_cours)
>{
>       rowsToShow = culmsName.contains(tbxValue).parent();
>       rows.not(rowsToShow).each(function(){
>               if(instance_fonction!=instance_en_cours)
>               {
>                       return false;
>                       alert("interruption");
>               }
>               $(this).hide();
>       });
>       rowsToShow.each(function(){
>               if(instance_fonction!=instance_en_cours)
>               {
>                       return false;
>                       alert("interruption");
>               }
>               $(this).show();
>       });
>}

If I replace your Populate() with the following:

var oCells = null;

function Populate(instance_en_cours)
{
        if( oCells == null ) oCells = $("td.Name");     

        var sCurrent = tbxValue;
        
        oCells.each(
                function (){
                        var c = $(this), p = c.parent();
                        
                        p[0].style.display =
(c.text().toLowerCase().indexOf(sCurrent) > - 1) ? "" : "none";
                }
        );
}

I get really good performance. 

The biggest hit comes after the first key press when the oCells code runs.
You could probably cache that at an earlier time. I tried doing it at
$(document).ready() but it seems like you move those items during the
window.onload event--so it makes the cache obsolete.

-Dan

Reply via email to