1. #1
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    JoepRonde is on a distinguished road

      0  

    Default Answered: Extended Class of a formpanel doesn't show a frame

    Answered: Extended Class of a formpanel doesn't show a frame


    I want to extend a formpanel with default frame = true. The code below defines a custom class for a floating, draggable formpanel with a frame. Creating an instance of this class doesn't show a frame. It seems that the initConfig doesn't set the frame to true. Why not?
    Only when I create a instance of this class with a config object with frame = true it shows a frame.
    Can anyone explain this?

    Code:
    Ext.define('MyForm', {
        extend: 'Ext.form.Panel',
    
    
        config: {
            title: 'This panel wants a frame',
            width: 200,
            height: 100,      
            frame: true, // setting frame to true should give a frame, but it doesn't
            floating: true ,
            draggable: true
        },
        constructor: function(config) {
            // Calling the constructor of the parent class.
            this.callParent(arguments);
    
    
            // Initializing the config settings.       
            this.initConfig(config);
        }
    });
    
    
    Ext.create('MyForm').showAt(10,10);
    Ext.create('MyForm', {title: 'Now it has a frame', frame: true}).showAt(250,10);

  2. In Ext JS, you should really not use the config object. Some things may work but all in all, it's not fully implemented in the framework classes.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    436
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    In Ext JS, you should really not use the config object. Some things may work but all in all, it's not fully implemented in the framework classes.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  4. #3
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    JoepRonde is on a distinguished road

      0  

    Default


    I think you're right, but then Sencha should update the documentation on this. I got this example from the Ex.Class documentation.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Class-cfg-config