// JS entry
Ext. onready (function (){
// Create table data
VaR DATA = [
['1', 'name1', 'scn1 '],
['2', 'name2', 'scn2 '],
['3', 'name3', 'desc3'],
['4', 'name4', 'scn4 '],
['5', 'name5', 'desc5']
];
// Specify the data field
VaR store = new Ext. Data. Store ({
Proxy: New
Ext. Data. memoryproxy (data), // method for obtaining data
Reader: New
Ext. Data. arrayreader ({}, [// arrayreader parses the Array
{Name: 'id '},
{Name: 'name '},
{Name: 'desc '}
])
});
Store. Load (); // data Initialization
// Create a Grid Object
VaR grid = new Ext. Grid. gridpanel ({
Autoheight: True,
Renderto: 'grid', // the place to render
Enablecolumnmove: false, // sets whether to drag and drop columns.
Enablecolumnresize: false, // sets whether the column size can be changed.
Striperows: True, // zebra Effect
Store: store,
CM: cm,
Autoexpandcolumn: 'desc', // you can specify the column width to automatically stretch. Only one column ID can be specified.
Viewconfig :{
Forcefit: True // each column is automatically filled with Grid
}
});
}