我想在Windows中显示加载在商店对象中的数据。我可以看到商店加载了正确的数据。但是当它传递给Panel并且Panel传递给Window时,当调用Window.Show时,只显示列名,而不是存储在Store对象中的数据。
请帮我解决这个问题。代码段如下: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();