Results 1 to 8 of 8

Thread: Problem with Ext.form.Panel

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default Answered: Problem with Ext.form.Panel

    I don't undestand why formpanel is hidden!!!

    Code:
    Ext.define('MyApp.view.MyFormPanel', {
        extend: 'Ext.form.Panel',
    
    
        config: {
            items: [
                {
                    xtype: 'fieldset',
                    title: 'MyFieldSet',
                    items: [
                        {
                            xtype: 'textfield',
                            label: 'Field'
                        },
                        {
                            xtype: 'textfield',
                            label: 'Field'
                        }
                    ]
                }
            ]
        }
    
    
    });

    But panel is empty!!! I don't see something on the screen. Why?

  2. Inspect the DOM and see what's going on for you.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1289
      0  

    Default

    Is it a child of a container or the viewport?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default

    child of navigationview!

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1289
      0  

    Default

    A direct child or nested?

    I added a xtype to the form you have above and did this and it worked

    Code:
    new Ext.navigation.View({
        fullscreen : true,
        items      : [
            {
                xtype : 'myformpanel'
            }
        ]
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default

    Code:
    Ext.define("MyApp.view.Main", {
        extend: 'Ext.navigation.View',
        requires: ['MyApp.view.Home'],
        alias: 'navigationview',
        id: 'navView',
        
        config: {      
            items: [
                {
                    xtype: 'homepanel'
                }
            ]
        }
    
    })


    Code:
    Ext.define('MyApp.view.Home', {
        extend: 'Ext.Panel',
        xtype: 'homepanel',
        
        requires: [
        ],
        
        initialize: function() {
            this.callParent(arguments);
            
            
            var form = {
                xtype: 'formpanel',
                items: [
                    {
                        xtype: 'textfield',
                        name: 'name',
                        label: 'Name'
                    },               
                    {
                        xtype: 'passwordfield',
                        name: 'password',
                        label: 'Password'
                    }
                ]
            };
            
            
            this.add([
                form
            ]);
        },
        
        config: {
            title: 'Home'
         }
    })


    this doesn't work. I don't see formpanel! It is hidden.

  7. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1289
      0  

    Default

    It's not hidden, just has no height. You either need to use a layout like fit on the MyApp.view.Home class or give the form a height.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default

    Code:
    var form = {
                xtype: 'formpanel',
                height: 800,
                items: [
                    {
                        xtype: 'textfield',
                        name: 'name',
                        label: 'Name'
                    },                
                    {
                        xtype: 'passwordfield',
                        name: 'password',
                        label: 'Password'
                    }
                ]
            };
    this also doesn"t work =(((

  9. #8
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1289
      0  

    Default

    Inspect the DOM and see what's going on for you.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •