Ext4を想定
Ext.require(['Ext.data.*', 'Ext.grid.*']);
Ext.define('Restaurant', {
extend: 'Ext.data.Model',
fields: ['name', 'cuisine']
});
Ext.onReady(function() {
var restaurants = Ext.create('Ext.data.Store', {
storeId: 'restaraunts',
model: 'Restaurant',
data: [{
name: 'Cheesecake Factory',
cuisine: 'American'
}]
});
var grid = Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
store: restaurants,
width: 600,
height: 400,
frame: true,
columns: [{
text: 'Name',
flex: 1,
dataIndex: 'name'
}, {
text: 'Cuisine',
flex: 1,
dataIndex: 'cuisine'
}],
fbar: [{
xtype: 'progressbar',
text: 'Foo',
width: 200
}]
});
});