写一个extjs6使用 Store.reload()的完整例子
时间: 2023-05-28 14:04:05 浏览: 226
Ext.define('MyApp.view.MyGrid', {
extend: 'Ext.grid.Panel',
xtype: 'mygrid',
store: {
type: 'mystore'
},
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email' },
{ text: 'Phone', dataIndex: 'phone' }
],
tbar: [{
text: 'Reload Store',
handler: function() {
var store = this.up('grid').getStore();
store.reload();
}
}]
});
Ext.define('MyApp.store.MyStore', {
extend: 'Ext.data.Store',
alias: 'store.mystore',
fields: [
'name', 'email', 'phone'
],
data: [
{ name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
{ name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
{ name: 'Homer', email: 'homer@simpsons.com', phone: '555-222-1244' },
{ name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
]
});
阅读全文