<!DOCTYPE html>
<html>
<head>
<title>demo</title>
<script src='http://dev.sencha.com/deploy/ext-4.0.7-gpl/ext-all.js'></script>
<link rel="stylesheet" href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/resources/css/ext-all.css">
<script>
Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
fields:['name', 'email', 'phone'],
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
Ext.create('Ext.grid.Panel', {
title: 'test',
store: store,
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Email', dataIndex: 'email', flex: 1 },
{ header: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
renderTo: Ext.getBody(),
tbar: [{
text: 'изменить поля' ,
handler: function() {
var gd = this.up('grid');
gd.reconfigure(gd.getStore(), [
{ header: 'aaaa', dataIndex: '1111' },
{ header: 'bbbb', dataIndex: '2222', flex: 1 },
{ header: 'cccc', dataIndex: '3333' }
]);
}
}]
});
});
</script>
</head>
<body></body>
</html>