PDA

View Full Version : [SOLVED!] IE combo first render - no drop down?



TopKatz
22 Jan 2009, 6:47 AM
I have a combo that I show when a page loads in a window. This window/combo is used to do a look up.

The first time the page is rendered, the window displays, and the cursor is placed in the combo. However the drop down with the data does not display in ie(7 or 8). There is no error. In fact you can make a selection and the select works as expected. You can also still use type ahead, but there is no drop down.

If I cancel or close the window, and reopen it, it will then render the drop down as expected.

Is there some known issue with this?



Ext.ns('Ihc.app');
Ihc.app.LuWindow = Ext.extend(Ext.Window, {

modal: true,
type:'hca',
callBack:null,
newWin:false,

initComponent:function() {
Ext.apply(this,{
layout: 'fit',
width: 268,
height: 90,
closeAction: 'hide',
plain: true,
buttons: [{
scope: this,
text: 'Close',
handler: function() {
this.hide();
}
}],
items:[ this.luPanel = new Ext.Panel({
height: 33,
collapsible: false
})
]
});

Ihc.app.LuWindow.superclass.initComponent.call(this);
},

showLu:function(){
var select, title, storeRoot, storeId, routine, luType, callBack, selectedId, postPage;
luType = this.type;
callBack = this.callBack;
if(this.luComboField){
this.luPanel.remove( this.luComboField );
this.store.destroy();
}
switch(luType){
case 'hca':
title = 'HCA Look Up';
storeRoot = 'HCAs';
storeId = 'hcaID';
routine= 'getHCAs';
postPage = 'homeCareAide.php?hcaID=';
break;
case 'client':
title = 'Client Look Up';
storeRoot = 'Clients';
storeId= 'clientID';
routine= 'getClients';
postPage ='client.php?clientID=';
break;
}
this.setTitle(title);
this.store = new Ext.data.JsonStore({
root: storeRoot,
totalProperty: 'totalCount',
id: storeId,
fields: [
{name: 'lastName'},
{name: 'firstName'},
{name: 'ihsID'},
{name: storeId},
{name: 'city'}
],
url: Ihc.app.GloblaRequestURL,
baseParams: {
method: "POST",
routine: routine
}
});
select = function(combo, record){
this.hide();
selectedId = record.get(storeId);
if(callBack!=null){
callBack(selectedId, luType, record);
}else{
if(this.newWin){
window.open(postPage + selectedId);
}else{
window.location.href= postPage + selectedId;
}
}
};

this.luComboField = new Ext.form.ComboBox({
store: this.store,
mode: 'local',
scope: this,
displayField: 'lastName',
typeAhead: true,
selectOnFocus: false,
tabIndex: 0,
typeAheadDelay: 120,
fieldClass: 'none',
loadingText: 'Searching...',
width: 250,
listWidth: 250,
collapsed: true,
pageSize: 25,
triggerAction: 'all',
emptyText: 'Look up by name',
hideTrigger: true,
tpl: new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<h4>{lastName}, {firstName}</h4>',
'City: {city} IHS ID: {ihsID}',
'</div></tpl>'
),
itemSelector: "div.search-item",
hideLabel: true,
listeners: {
select: select,
scope: this
}
});
this.luPanel.add(this.luComboField);
this.store.on({
load: function(){
this.luComboField.focus('', 10);
},
scope: this
});
this.store.load();
this.show();
}
});

TopKatz
22 Jan 2009, 7:51 AM
It was the hideTrigger:true bug!

http://extjs.com/forum/showthread.php?p=204998#post204998