PDA

View Full Version : [CLOSED] [4.0.7] ComboBox list position Incorrect in IE7



kof720551
23 Oct 2011, 11:31 PM
As shown



Ext.create('Ext.form.ComboBox',{
store: store,
ditable :false,
displayField: 'UV',
valueField: 'UV',
width: 100,
renderTo: 'combo'
});

28817

terrycursh
3 Nov 2011, 6:33 PM
I got the same problem ,any good solution?

WebProgrammer
5 Nov 2011, 12:07 AM
Try this override :



Ext.override(Ext.form.field.ComboBox, {
setHiddenValue: function(values){
var me = this, i;
if (!me.hiddenDataEl) {
return;
}
values = Ext.Array.from(values);
var dom = me.hiddenDataEl.dom,
childNodes = dom.childNodes,
input = childNodes[0],
valueCount = values.length,
childrenCount = childNodes.length;

if (!input && valueCount > 0) {
me.hiddenDataEl.update(Ext.DomHelper.markup({tag:'input', type:'hidden', name:me.name + "-hidden"}));
childrenCount = 1;
input = dom.firstChild;
}
while (childrenCount > valueCount) {
dom.removeChild(childNodes[0]);
-- childrenCount;
}
while (childrenCount < valueCount) {
dom.appendChild(input.cloneNode(true));
++ childrenCount;
}
for (i = 0; i < valueCount; i++) {
childNodes[i].value = values[i];
}
}
});

evant
5 Nov 2011, 4:10 PM
This issue has been fixed for 4.1. As @WebProgrammer has suggested, the issue is with the name of the hidden combo field.

faisalv
4 Dec 2011, 8:45 PM
Thank you for posting the patch! (Fixed in 4.1 does not help us 4.0.7 ers)!

Petrushka
21 Dec 2011, 1:19 AM
Thanks to @WebProgrammer!
The override helps me a lot!!!

paipai
12 Jan 2012, 8:47 AM
Thanks for sharing it fix my bug for IE.
I have the problem in chrome too (it depends the number of items). I use this code to fix it:



ret = Ext.create('Ext.form.field.ComboBox', {
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: this.cs.filterGridPanel.hour,
listeners: {
focus: function(obj) {
obj.expand();

// FIX EXT JS 4.0.7 BUG ON COMBO LIST (Y POSITION FIX)
window.setTimeout(function() {
obj.getPicker().el.alignTo(obj.inputEl, 'tl-bl?');
}, 0);

},
collapse: function(obj) {obj.triggerBlur()}
}
});

Farish
1 Feb 2012, 1:17 AM
adding a name config to the combo box fixes the problem but there is one other problem too. when I expand the combobox list the first time, the vertical position is not right and its shown much above the combobox field...

Another fix is to add this to the top of your HTML file:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

sgfrias
11 Jan 2013, 4:41 PM
it works pefectly thanks!;)