Results 1 to 3 of 3

Thread: Difficulty in creating a form

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2010
    Location
    Italy
    Posts
    9
    Vote Rating
    0
      0  

    Default Difficulty in creating a form

    Hi all,
    I'm trying tocreate a simplelogin formwith twotoolbars,dockedwitha'top' andthe other withdocked'bottom' anda central panel.
    When yourenderthisform, thecentral panelwith adockedtoolbaroverlapsthe'bottom'.I can notfigure out wheremistake.

    Code:
    Ext.define('Ext.FrontEnd.Login', {
        extend: 'Ext.Panel',
        alias: 'FrontEnd.Login',
        xtype: 'login',
        config: {
            items: [
                    {
                        docked: 'top',
                        xtype: 'toolbar',
                        title: 'Login',
                        items: [{ xtype: 'spacer' },
                            {
                                xtype: 'button',
                                ui: 'decline',
                                iconCls: 'delete',
                                iconMask: true,
                                handler: function() { this.destroy(); },
                                scope: this
                            }
                        ]
                    },
                    {
                        docked: 'bottom',
                        xtype: 'toolbar',
                        items: [{
                            xtype: 'button',
                            text: 'Submit',
                            iconMask: true,
                            ui: 'plain',
                            handler: this.EventClickBtnSubmit,
                            scope: this
                        }
                        ]
                    },
                        {
                            xtype: 'container',
                            items: [{
                                xtype: 'fieldset',
                                defaults: {
                                    required: true
                                },
                                items: [{
                                    xtype: 'textfield',
                                    label: this.fieldLabelUser
                                },
                                {
                                    xtype: 'passwordfield',
                                    label: this.fieldLabelPassword
                                }
                            ]
                    ]
                        }
                ]
        },
        constructor: function(params) {
            config = params || {};
    
    
            Ext.applyIf(config, params);
    
    
            this.callParent(arguments);
        },
        initialize: function() {
            this.callParent(arguments);
            this.show();
        }
    });


  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    This works fine for me:

    Code:
    Ext.define('Ext.FrontEnd.Login', {
        extend: 'Ext.Panel',
        xtype: 'login',
        config: {
            fullscreen : true,
            items: [
                {
                    docked: 'top',
                    xtype: 'toolbar',
                    title: 'Login',
                    items: [{ xtype: 'spacer' },
                        {
                            xtype: 'button',
                            ui: 'decline',
                            iconCls: 'delete',
                            iconMask: true,
                            handler: function() { this.destroy(); },
                            scope: this
                        }
                    ]
                },
                {
                    docked: 'bottom',
                    xtype: 'toolbar',
                    items: [{
                        xtype: 'button',
                        text: 'Submit',
                        iconMask: true,
                        ui: 'plain',
                        handler: this.EventClickBtnSubmit,
                        scope: this
                    }
                    ]
                },
                {
                    xtype: 'container',
                    items: [{
                        xtype: 'fieldset',
                        defaults: {
                            required: true
                        },
                        items: [{
                            xtype: 'textfield',
                            label: this.fieldLabelUser
                        },
                        {
                            xtype: 'passwordfield',
                            label: this.fieldLabelPassword
                        }]
                    }]
                }
            ]
        }
    });
    I added fullscreen to render the login, removed alias as you were using it wrong, constructor and initialize were removed as you didn't need them. One last thing to point out, you shouldn't use the Ext namespace, you should use one that is for your app.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2010
    Location
    Italy
    Posts
    9
    Vote Rating
    0
      0  

    Default

    Hello,
    thanks foryour answer,butusing the codeyou have entered, I can notsee thebottom toolbar withdocked.
    If it can be of help, instances of the component login as follows:
    Code:
    Ext.application({
        name: 'Sencha',
        launch: function() {
            Ext.create('FrontEnd.Login');
        }
    });

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •