How to autosize form fields
I use form.fields from EXTJS API. My application is totally dynamically.
It is possible to autosize combobox thanks to value which are on store ? Or i need to make my own method... ?!
Actually, my combobox , is declared as following :
itemId : 'materialid',
xtype : 'combobox',
anchor : '35%',
store : materialstore,
id : 'Material',
queryMode: 'local',
displayField: 'data',
width : 50,
valueField: 'data',
editable : false,
grow : true,
enforceMaxLength : true,
listeners : {
render : function(me){
var obj = materialstore.findRecord('data',materialdefaultvalue);
me.setValue(obj.get('data'),obj);
}
},
padding : '0 30 0 30',
fieldLabel : 'Material',
name : 'material',
listeners : {
blur : function(me){
var fieldva开发者_运维知识库lue = me.getValue();
var sel = monPretree.getView().getSelectedRecords();
for ( var i = 0 ; i < sel.length ; i++){
alert(sel[i].get('id') + ' && ' + material);
}
}
}
Thanks :)
Unfortunately not. Your best bet would be either to set a fixed width (like you have) or set it to '100%'
.
A quick note for future questions: it is better to ask them over on the Sencha forums, as you will get a quicker response.
精彩评论