在 EXTJS 3 中,如何在弹出窗口中显示网格?
我有这个编码,为什么它不起作用?
var myData = [['ddd', '1111'], ['eee', '2222']];
var store = new Ext.data.ArrayStore({
fields: [
{ name: 'FLD' },
{ name: 'VAL' }
]
});
store.loadData(myData);
var grid = new Ext.grid.GridPanel({
store: store,
loadMask: true,
colModel: new Ext.grid.ColumnModel({
defaults: {
width: 120,
sortable: true
},
columns: [
{ header: 'FLD', dataIndex: 'FLD' },
{ header: 'VAL', dataIndex: 'VAL' }
]
}),
viewConfig: {
forceFit: true
}
});
var myWin = Ext.create("Ext.Window", {
layout: 'fit',
title: 'Exception Detail',
width: 400,
height: 300,
closable: false,
buttonAlign: 'center',
items: [grid],
modal: true
});
myWin.show();