所以我在这里有工作视图,可以很好地创建我的网格。
Ext.define('AM.view.user.List' ,{
extend: 'Ext.grid.Panel',
alias: 'widget.userlist',
title: '<center>Results</center>',
store: 'User',
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [
{ xtype: 'tbtext', text: 'Loading...', itemId: 'recordNumberItem' },
'->',
{ text: 'Print', itemId: 'print' },
'-',
{ text: 'Export', itemId: 'export' }
]
}],
initComponent: function() {
this.columns = [
{header: 'Name', dataIndex: 'name', flex: 4, tdCls: 'grid_cell'},
{header: 'ID', dataIndex: 'ID', flex: 2, tdCls: 'grid_cell'},
{header: 'Mid Name', dataIndex: 'mid_name', flex: 3, tdCls: 'grid_cell'},
{header: 'Last Name', dataIndex: 'last_name', flex: 4, tdCls: 'grid_cell'},
{header: 'Address', dataIndex: 'adress', flex: 3, tdCls: 'grid_cell'}
];
this.callParent(arguments); //Calls the parent method of the current method in order to override
var store = this.getStore(); //Retrieving number of records returned
textItem = this.down('#recordNumberItem');
textItem.setText('Number of records: ' + store.getCount());
//var val = Ext.getCmp('criteria_1').getValue();
//store.filter('ID', val);
}
});
我想将网格中的每一行转换为可扩展和可折叠,就像在 Sencha Docs 下的行扩展器中显示的那样:http ://docs.sencha.com/extjs/4.2.1/#!/example/build/KitchenSink /ext-主题-海王星/
我尝试添加插件,但无法使其正常工作。有任何想法吗?