Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Panel with two child panels as a separate xtype #65

Open
sam-ghosh opened this issue May 27, 2014 · 0 comments
Open

Adding a Panel with two child panels as a separate xtype #65

sam-ghosh opened this issue May 27, 2014 · 0 comments

Comments

@sam-ghosh
Copy link

I downloaded the latest version of the file and in the view/Main.js , for the Item1/Group 1 item, added toolbar + 2 panels, instead of toolbar + 1 panel, the code works fine:

{
    title : 'Item1',
    group : 'Group 1',

    xtype : 'container',

    // Enable the slide button using the
    // defaults defined above in
    // `slideButtonDefaults`.
    slideButton : true,
    layout: 'vbox',

    items : [
                {
                    xtype : 'toolbar',
                    title : 'Item 1',
                    docked : 'top'
                },
                {
                    xtype : 'panel',
                    style: 'background: red',
                    html: 'New1',
                    flex: 1,

                    // Mask this item when the
                    // container is opened
                    maskOnOpen : true
                },
                {
                    xtype : 'panel',
                    style: 'background: green',
                    html: 'New2',
                    flex: 2,

                    // Mask this item when the
                    // container is opened
                    maskOnOpen : true
                } 

            ]
},

The code works fine - it replaces the image you have in your demo with a panel with two vertically placed subpanels in red and green
1

I am trying to refactor the code into into separate view

Ext.define('Volt.view.FeedView', {
    extend: 'Ext.Panel',

    requires: [
        'Ext.TitleBar',
        'Ext.Button',
        'Ext.Toolbar',
        //'Ext.Panel'
    ],

    xtype: 'feedViewCard',


    config: {

        iconCls: 'action',
        title: 'FeedView',

        layout: 
        {
            type: 'vbox'
        },

        items : [
                    {
                        xtype : 'toolbar',
                        title : 'FeedView',
                        docked : 'top'
                    },
                    {
                        xtype : 'container',
                        style: 'background: red',
                        html: 'New1',

                        flex: 1

                        // Mask this item when the
                        // container is opened
                        //maskOnOpen : true
                    },
                    {
                        xtype : 'container',
                        style: 'background: green',
                        html: 'New2',
                        flex: 1

                        // Mask this item when the
                        // container is opened
                        //maskOnOpen : true
                    } 

                ]
    }
});

and use the following code in view/Main.js , removing the earlier code- there are no errors, but only the green box shows up

 { 
     xtype: 'feedViewCard',
     title : 'Home Page',
     group : 'Group 1',
     slideButton : true

 },

2

Also, this refactored FeedView.js shows up as two child panels when used in a TabPanel view - so it is definitely working fine. Any advice? Thanks much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant