yes, but why doesn't interruption work even if the callback function
fromonkeyup event is called with a setTimeout ?
Dan G. Switzer, II wrote:
>
>
>>function Populate(instance_en_cours)
>>{
>> rowsToShow = culmsName.contains(tbxValue).parent();
>> rows.not(rowsToShow).each(function()
>function Populate(instance_en_cours)
>{
> rowsToShow = culmsName.contains(tbxValue).parent();
> rows.not(rowsToShow).each(function(){
> if(instance_fonction!=instance_en_cours)
> {
> return false;
> alert("interru
It doesn't work : I write this :
var instance_fonction = 0;
function tbxSearch_keyup()
{
instance_fonction++;
Populate(instance_fonction);
}
function Populate(instance_en_cours)
{
rowsToShow = culmsName.contains(tbxValue).parent();
rows.not(rowsToShow).each(function()
>this test : if( tbxValue != lastTbxValue ) will always return false because
>the function each() monoplize the unique thread. The event "onkeyup" from
>the textbox couldn't occur while each() is running, so tbxValue remains the
>same in the meantime.
As I stated, you'll want to use a setTimeout(
>Using $("td.Name") should also improve the scripts performance as
>well. When you use $(".Name") it will go through all tags on the page.
>If the class name is on other tags as well, you could always add
>another selector (e.g. $("td.Name, li.Name").
The best thing to do would be to cache those
Using $("td.Name") should also improve the scripts performance as
well. When you use $(".Name") it will go through all tags on the page.
If the class name is on other tags as well, you could always add
another selector (e.g. $("td.Name, li.Name").
On Jun 11, 3:02 am, "Dan G. Switzer, II" <[EMAIL
this test : if( tbxValue != lastTbxValue ) will always return false because
the function each() monoplize the unique thread. The event "onkeyup" from
the textbox couldn't occur while each() is running, so tbxValue remains the
same in the meantime.
Dan G. Switzer, II wrote:
>
>
>>Thank you.
>Thank you.
>
>Is it possible to interrupt the script each time the user enter a new
>letter
>in the search box ?
What I'd recommend doing is building in a setTimeout() delay that would only
fire off the event if the user pauses typing--that way you're not trying to
fire it off for every keystrok
Thank you.
Is it possible to interrupt the script each time the user enter a new letter
in the search box ?
Dan G. Switzer, II wrote:
>
>
>>http://fra.orkos.com/produits/tarifs.aspx Here is a page which I made.
>>This
>>page presents a list of products classified in a hierarchy. I have a
>
>http://fra.orkos.com/produits/tarifs.aspx Here is a page which I made.
>This
>page presents a list of products classified in a hierarchy. I have a
>textbox
>that allows the user to filter these products. Try to type a text in this
>textbox (for example the word "apple") and observe the speed of
10 matches
Mail list logo