PDA

View Full Version : combo values in IE6



nelmoulaoui
4 Jan 2011, 5:03 AM
Hi, this is my code, it doesn't work in IE6 :


Ext.onReady(function() {



var countries = [
[0, 'United']
,[1, 'Germany']
,[2, 'France']
,[3, 'G-Britain']
];

MyWindowUi = Ext.extend(Ext.Window, {
title: 'My Window',
width: 400,
height: 250,
initComponent: function() {
this.items = [
new Ext.FormPanel({
renderTo:document.body
,width: 400
,height: 300
,style:'margin:16px'
,bodyStyle:'padding:10px'
,title:'Linked Combos'
,defaults: {xtype:'combo'}
,deferredRender: false
,items:[
{
id: 'currencyComboId',
xtype:'combo',
editable: false,
anchor: '98%',
border: false,
store: new Ext.data.SimpleStore({
fields:['value', 'name']
,data:countries
}),
value: 1,
valueField:'value',
displayField:'name',
typeAhead: true,
mode: 'local',
triggerAction: 'all'
}

]
})

];
MyWindowUi.superclass.initComponent.call(this);
}
});

win = new MyWindowUi();

win.show();

});

please any help ?

thinks !

4 Jan 2011, 1:26 PM
first issue:

mixing leading commas with trailing commas, BAD IDEA!

second issue:

Posting that something doesn't work does not help us help you. :(

third issue:

Please post code within closing CODE tags.

fourth issue:

Please post help requests in the proper forum. Moving to Ext help.

4 Jan 2011, 1:28 PM
your code beautified:

Ext.onReady(function () {

var countries = [
[0, 'United'],
[1, 'Germany'],
[2, 'France'],
[3, 'G-Britain']
];

MyWindowUi = Ext.extend(Ext.Window, {
title: 'My Window',
width: 400,
height: 250,
initComponent: function () {
this.items = [
new Ext.FormPanel({
renderTo: document.body,
width: 400,
height: 300,
style: 'margin:16px',
bodyStyle: 'padding:10px',
title: 'Linked Combos',
defaults: {
xtype: 'combo'
},
deferredRender: false,
items: [{
id: 'currencyComboId',
xtype: 'combo',
editable: false,
anchor: '98%',
border: false,
store: new Ext.data.SimpleStore({
fields: ['value', 'name'],
data: countries
}),
value: 1,
valueField: 'value',
displayField: 'name',
typeAhead: true,
mode: 'local',
triggerAction: 'all'
}

]
})

];
MyWindowUi.superclass.initComponent.call(this);
}
});

win = new MyWindowUi();

win.show();

});

4 Jan 2011, 1:29 PM
no need to set renderTo on items that are children of containers, panels, windows, etc.