views:

777

answers:

2

I use Ext.form.ComboBox in very similar way as in this example: http://extjs.com/deploy/dev/examples/form/forum-search.html

What annoys me is that when the ajax call is in progress it shows loading text and I cannot see any results from before.

Eg I input 'test' -> it shows result -> I add 'e' (search string is 'teste') -> result dissapear and loading text is shown, so for a second I cannot see any result and think about if it's not what I'm searching for...

How can I change this to simply not to say anything when 'loading'...

A: 

If you don't show loading message to user how user will know what is happening? User will notice that its already loading results so may wait to see the results, but if nothing displayed then user wouldn't know if its bringing new data or not.

Bhushan
that's true, but the second when I cannot see anything is much worse for me. Google doesn't show anything but result and it's very natural to me. Information that something is happening has some added value only for first time. Every other time user is already expecting that search is present in background....
Supowski
+1  A: 

The solution is to override 'onBeforeLoad' method of Ext.form.ComboBox:

  Ext.override(Ext.form.ComboBox, 
    { onBeforeLoad: 
        function() {this.selectedIndex = -1;}
    });

Please be warned, that this overrides the class method, so all of the ComboBox instances will not have the LoadingText showing. In case you would like to override only one instance - please use plugins (in quite similar way).

You may also look at Ext.LoadingMask to set an appropriate loading mask to aside element if you wish.

Thevs
I use plugins as you mention. Thx for answer...
Supowski