PDA

View Full Version : How to set field of PropertyGrid like a comboBox?



grigory666
28 Nov 2009, 11:55 AM
I need to set one field of PropertyGrid like a comboBox.
I do that:

var typeStore = new Ext.data.ArrayStore
({
fields: ['type'] ,
data : [['bool'], ['string'], ['img'], ['file'], ['html'], ['text'], ['num'], ['date'], ['ref']]
});


var combo = new Ext.form.ComboBox({
store : typeStore,
value : oldType,
displayField : 'type',
fieldLabel : 'type',
name : 'type',
typeAhead : true,
allowBlank : false,
mode : 'local',
forceSelection : true,
triggerAction : 'all',
emptyText : 'Type is not set',
selectOnFocus : true
});


prop_grid = new Ext.grid.PropertyGrid({
width: 300,
autoHeight: true,
source: { type: combo },
viewConfig : {
forceFit: true,
scrollOffset: 2
}
}); But ‘type’ field in PropertyGrid is just empty. How could I do it correct?