PDA

View Full Version : [CLOSED]Combo Box loading during option load



GordS
05-24-2010, 12:33 PM
I have many combo boxes in this option. They load when I select the option. I only want them to load, if the user clicks on the drop down arrow.

Here is the code for the combo box.


xtype: 'combo',
id: 'edit_EAACTMANGR',
fieldLabel: 'Account Manager',
triggerAction: 'all',
emptyText: 'Select Account Manager...',
valueField: 'UMUSERNAME',
displayField: 'UMNAME',
store: new Ext.data.JsonStore({
url: 'vvcall.pgm',
fields: ['UMUSERNAME', 'UMNAME'],
root: 'APACTMGR',
autoLoad: 'false',
baseParams: {
action: 'getComboActMgr',
pgm: 'apgetcombo'
}
}),
mode: 'remote'

What do I change in this code, so that it only loads if the user wants to select any entry from the drop down list?

richard.milone
05-24-2010, 12:37 PM
You might want to try specifying autoLoad: false instead of autoLoad: 'false' (i.e., without the quotes). I think that might be confusing the store.

GordS
05-24-2010, 12:53 PM
That worked. But just one more twist to make it interesting. After testing the change I realized in some cases I do want it to load the list if a selection was made so it displays correctly. What is the best way of doing this? Or is the best way to load everythiong up at the beginning as I was orginally doing? Thanks.

richard.milone
05-24-2010, 12:59 PM
You can initiate the load at anytime like this:

Ext.getCmp('edit_EAACTMANGR').getStore().load();

GordS
05-24-2010, 01:31 PM
That worked. Thanks