PDA

View Full Version : setWidth error line 4338, when Combobox event is triggered, only in IE, ok in FF



Laurent Chenet
9 Jun 2010, 1:03 AM
Hello,

Ext versions tested:
3.1 ok
3.2.1 (failed in IE8)

Browsers tested:
FF 3.6.3 ok
IE 8 (failed with ext 3.2.1)
IE 7 (failed with ext 3.2.1)

Code throwing the error:

An ext window is generated with a combo, when the combo store is triggered, an error occur:




var genres = new Ext.data.Store({
reader: new Ext.data.JsonReader({
fields: ['id_unit','label'],//'usp_label',
root: 'rows'
}),
proxy: new Ext.data.HttpProxy({
url: 'modules/users.cfc?method=GetLogedUsers&UserLogin='+JSESSION.USER_LOGIN+'&'+JSESSION.URLTOKEN
}),
autoLoad: true,
listeners:{
load: function(){
//This is used to remove the "loading..." text
Ext.getCmp('MyCombo').setValue('');
//Put focus on the combobox after 1/2 second
setTimeout("$('#MyCombo').focus();",500);
}
}
});

var MyCombo = new Ext.FormPanel({
//renderTo: document.body,
frame: true,
title: 'Please choose an entity',
width: 250,
items: [{
id:'MyCombo',
xtype: 'combo',
name: 'genre',
fieldLabel: 'Entity ',
//disableKeyFilter:false,
//forceSelection:true,
//typeAhead:true,
//disabled:true,
mode: 'local',
store: genres,
displayField:'label',
triggerAction:'all',
valueField: 'id_unit',
displayField:'label',
width: '100%',
value:'loading...',//DEFAULT TEXT WHEN DISABLED
listeners: {
select: function(n) {
//We send both entity id and label
usersObj.SelectedEntity(n.value,n.lastSelectionText);
//Ext.Msg.alert(n.value);
}
}
}]
});



WindowChooseEntity = new Ext.Window
({
//id:'WindowChooseEntityId',
disabled:false,
modal:true,
//buttons: Ext.Msg.OKCANCEL,
width:300,
//minWidth:240,
height:80,
draggable:false,
minHeight:60,
layout:'fit',
closable:false,//[x]
resizable:false,
items:[MyCombo]

});
WindowChooseEntity.show();

When the user trigger the action (partial typing to filter choices in the combo), IE respond with invalid argument at line 4339 (car 13) in ext-all-debug.js

(
ext-all-debug.js extract

setWidth : function(width, animate){
var me = this;
width = me.adjustWidth(width);
!animate || !me.anim ?//THIS IS THE LINE WHERE THE ERROR OCCUR
me.dom.style.width = me.addUnits(width) :
me.anim({width : {to : width}}, me.preanim(arguments, 1));
return me;
},
)

When everything is fine (in FF), and I type fe.e. "Ser", I get this Json answer from the server:


{"success":true,"rows":[{"id_unit":1,"label":"Headquarters"},{"id_unit":3,"label":"Serbia"}]}Everything works in FF, and everything work in IE7/8 if we keep the previous Ext 3.1 files.

Is it a bug or do I do something wrong?

Thank you!

Laurent

simplessus
3 Jul 2010, 1:33 AM
I have exactly the same problem.

simplessus
3 Jul 2010, 2:18 AM
The problem is that "width" isNaN ! This is not catched, I will try to set fixed width now in my source code, maybe there is a problem with 100% in IE8...

brunoflmg
21 Jul 2010, 1:03 PM
I have the same problem... follow the solution I find:

Before the solution the line "columnWidth: " had '20px' of value.
The solution is change this '20px' (string) to .3 integer... so, see the code below after this change:



items:[{
xtype : 'container',
layout : 'column',
defaults:{
xtype: 'container'
},
items:[{
columnWidth: .3, // before was '20px'
items:[{
baseCls : 'x-plain',
html : '<img src="'+ App.baseURL +'images/auth/security.png" border="0" style="margin:10px 8px 0 0"></img>'
}]
},