1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    88
    Vote Rating
    0
    newusername is on a distinguished road

      0  

    Default problem with ext form panel

    problem with ext form panel


    I don't know what is wrong with the following code ..

    Code:
    Ext.onReady(function()
            {    
                var myForm = Ext.extend(Ext.FormPanel,{                
                    title : 'login Form',
                    items :  [ 
                                 {
                                        fieldLabel : 'User Name',
                                        xtype : 'textfield',
                                        name : 'uName',
                                        allowBlank : false
                                    }
                                ] ,
                    /*constructor : function (config){
                        config = config || {};
                        Ext.apply(this,config);
                    }*/
                                
                initComponent: function(){
                    myForm.superclass.initComponent.call(this);
                }
                    
                });          
                
                
                var f = new myForm();
                f.render(document.body);
            });
    Please help me out..

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    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


    Hi newusername,

    Try the following code-
    Code:
    Ext.onReady(function(){
        var tab2 = new Ext.FormPanel({
            cls: 'two-column-form',
            labelAlign: 'left',
            labelStyle: 'font-weight:bold;',
            labelWidth: 85,
            title: 'formname',
            bodyStyle:'padding:5px',
            scrollable:'true',
            border:'true',
            width: 500,
            height:400,
            defaults: {layout: 'form', border: false},
                    
            items: [{ 
                            itemCls: 'x-clear-left',
                            xtype:'combo',
                            fieldLabel: 'Company',
                            name: 'company',
                            value: 'Ext JS'
                        }
                    ],
            buttons: [
                {
                    text: 'Save'
                },{
                    text: 'Cancel'
                }
            ]
        });
    
    
        tab2.render(document.body); 
    
    
    });
    here is working sample example -http://jsfiddle.net/4tcbu/
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1