-
9 Jul 2012 2:43 AM #1
Unanswered: Render items such as combo box in to form panel
Unanswered: Render items such as combo box in to form panel
I have created dynamic combo boxes in the form panel in the render event.
But couldnt make it render with in the form panel.
I have used the following techniques. But nothing worked out. Please help me.
renderTo: Ext.getCmp('formpanelid').getEl()
formpanelid.add(comboboxid);
Generally Html div element will be given in the render To. But still its not working for me.
-
9 Jul 2012 2:53 AM #2
Instead of using ids of those components, try:
Code:formpanel.add(combo);
-
9 Jul 2012 3:01 AM #3Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
Use doLayout()
Use doLayout()
hi jfbk86,
Also you need to call doLayout() method of formPanel after combobox added.
For more information see http://docs.sencha.com/ext-js/4-1/#!...ethod-doLayoutCode:formPanel.add(combo); formPanel.doLayout();
sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
9 Jul 2012 3:47 AM #4
See this example
PHP Code:Ext.create('Ext.form.Panel', {
itemId: 'myForm',
title: 'Simple Form',
bodyPadding: 5,
width: 350,
// The fields
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
},{
fieldLabel: 'Last Name',
name: 'last',
allowBlank: false
}],
tbar: [{text: 'add combo', handler: function (btn) {
var form = btn.up('form');
form.add({
xtype: 'combobox',
fieldLabel: 'dynamic combo',
anchor: '100%',
// combobox config
});
}}],
renderTo: Ext.getBody()
});


Reply With Quote