简体   繁体   中英

Extjs 4.2.2 Ext.Window.Show is not showing the data loaded in Store

I want to display the data loaded in the store object in Windows. I can see the store is loaded with the correct data. But when it is passed to the Panel and Panel is passed to the Window, when Window.Show is called, only the column names are displayed, but not the data which is stored in the Store object.

Please help me with this. The code snippet is as follows: enter code here

var store1 = new Ext.data.Store({
                autoLoad:true,
            fields: [{
                name: 'Index'
            }, {
                name: 'VrfNames'
            }]
        });
        var vrfData = [
            ["HI", "Hello"]
        ];
        store1.loadData(vrfData);
        console.log("Loaded " + store1.getCount() + " records");
        //Could verify data is loaded properly


        // creation of panel
        var vrfNamesPanel = new Ext.grid.Panel({
            store: store1,
            columns: cm,
            height: 250,
            width: 700,
            enableHdMenu: false,
            buttons: this.buildVrfNamesPanelButtons(),
            buttonAlign: 'center',
            renderTo: Ext.getBody(),
            //floating: true,
            //closable : true//,
            listeners: {
                scope: this
            }

        });


        // creation of new window
        this.vrfNamesWindow = new Ext.Window({
            layout: 'fit',
            closeAction: 'hide',
            plain: true,
            title: "VRF Names ",
            items: vrfNamesPanel,
            enableTabScroll: true,
            autoScroll: true,
            width: 700
        });

        this.vrfNamesWindow.show();

Here is working fiddle for you.

I dont know what is your cm columns settings so I added it, I believe that issue was there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM