1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    jfbk86 is on a distinguished road

      0  

    Default 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.

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,088
    Answers
    112
    Vote Rating
    95
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    Instead of using ids of those components, try:

    Code:
    formpanel.add(combo);

  3. #3
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default Use doLayout()

    Use doLayout()


    hi jfbk86,

    Also you need to call doLayout() method of formPanel after combobox added.
    Code:
    formPanel.add(combo);
    formPanel.doLayout();
    For more information see http://docs.sencha.com/ext-js/4-1/#!...ethod-doLayout
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #4
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    42
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    See this example
    PHP Code:
    Ext.create('Ext.form.Panel', {
        
    itemId'myForm',
        
    title'Simple Form',
        
    bodyPadding5,
        
    width350,
        
    // The fields
        
    defaultType'textfield',
        
    items: [{
            
    fieldLabel'First Name',
            
    name'first',
            
    allowBlankfalse
        
    },{
            
    fieldLabel'Last Name',
            
    name'last',
            
    allowBlankfalse
        
    }],
        
    tbar: [{text'add combo'handler: function (btn) {
            var 
    form btn.up('form');
             
            
    form.add({
                
    xtype'combobox',
                
    fieldLabel'dynamic combo',
                
    anchor'100%',
                
    // combobox config
            
    });
        }}],
        
    renderToExt.getBody()
    });