open two window with tree panel using extjs

465 views Asked by At

I want to open two windows. Here is the code I am trying to do this with:

Ext.define('DTApp.view.MyViewport', {
    extend: 'Ext.container.Viewport',

    requires: [
        'DTApp.Class_Util'
    ],

    id: 'MainWindow',
    autoScroll: true,
    layout: {
        type: 'border'
    },

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'treepanel',
                    region: 'west',
                    split: false,
                    autoRender: true,
                    autoShow: true,
                    cls: 'detail-view + x-panel-header',
                    width: 170,
                    autoScroll: true,
                    resizable: true,
                    resizeHandles: 'e',
                    bodyPadding: '0 0 0 0',
                    animCollapse: true,
                    collapseFirst: true,
                    collapsed: false,
                    collapsible: true,
                    frameHeader: false,
                    title: 'Menu',
                    titleAlign: 'left',
                    titleCollapse: false,
                    columnLines: false,
                    deferRowRender: true,
                    forceFit: false,
                    hideHeaders: true,
                    store: 'MyJsonPTreeStore',
                    animate: true,
                    rootVisible: false,
                    singleExpand: false,
                    useArrows: true,

                    viewConfig: {
                        autoShow: true,
                        data: {

                        },
                        id: 'MainWindow_Left_Tree',
                        itemId: 'MainWindow_Left_Tree',
                        autoScroll: false,
                        resizable: false,
                        deferInitialRefresh: true,
                        loadMask: true,
                        preserveScrollOnRefresh: true,
                        enableTextSelection: false,
                        animate: true,

                    }
                },
                {
                    xtype: 'panel',
                    region: 'center',
                    id: 'MainWindow_Right_Panel',
                    itemId: 'MainWindow_Right_Panel',
                    autoScroll: true,
                    animCollapse: true,
                    collapsed: false,
                    collapsible: false,
                    header: false,
                    title: 'My Panel',
                    listeners: {
                        render: {
                            fn: me.onMainWindow_Right_PanelRender,
                            scope: me
                        }
                    }
                }
            ]
        });

        me.callParent(arguments);
    },

    onMainWindow_Right_PanelRender: function(component, eOpts) {

    }

});

When I try to open the second window, the tree panel on the first window is removed and in the second window, it shows double nodes and events are not working.

0

There are 0 answers