PDA

View Full Version : remote combo keydown



TopKatz
4 Nov 2009, 4:53 AM
I have a combo that I use for looking up clients. I have around 7k client records. The combo is configured to remotely get the records after two characters are entered. This works very well. The problem is if the user hits the down arrow before entering two records. The result set now is huge.

I know I could use a paggingTool bar, or build a server side trap to not run the query if there is not any thing in the combo value. I was looking for a simple solution that just stopped the combo from opening if there is no data in it, and did not run the query if the down arrow is pressed.

smit_al
4 Nov 2009, 5:16 AM
There is a config option for the combobox "hideTrigger" that removes the arrow from the combo. Not sure if this would also prevent the arrow key from triggering store load.

Condor
4 Nov 2009, 5:19 AM
I don't understand... A ComboBox with minChars:2 shouldn't expand if you enter less than 2 characters and press down (or the trigger).

TopKatz
4 Nov 2009, 5:56 AM
all of mine behave like this. The triggers are all hidden as well. It must be some other config item. I ended up giving them pagging bars. Here is the config for one of them:



this.config = {
store: this.store,
scope: this,
displayField: this.dsp,
selectOnFocus: false,
fieldClass: 'none',
loadingText: 'Searching...',
collapsed: true,
triggerAction: 'all',
minChars:2,
forceSelection:true,
pageSize:100,
hideTrigger: true,
tpl: new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<h4>{lastName}, {firstName}</h4>',
'City: {city} hcaID: {ihsID}',
'</div></tpl>'
),
itemSelector: "div.search-item"

};


when focused in this combo pressing the down arrow fires the query whether there is chars in the field or not.

Condor
4 Nov 2009, 5:58 AM
Shouldn't you be using triggerAction:'query'?

With triggerAction:'all' it will always display all users, independent of the text typed.

TopKatz
4 Nov 2009, 6:01 AM
Shouldn't you be using triggerAction:'query'?

With triggerAction:'all' it will always display all users, independent of the text typed.

that did it, thanks Condor