0
我有默認4個標籤與車輛管理,駕駛員管理,位置管理,路由管理。
和我能夠重新車輛管理標籤
這是工具欄,我有提到,所以當我們創建一個新的車輛管理選項卡,將導致非功能所有選項卡的工具欄。也許我在新的車輛管理中重新使用網格面板?
這裏是我的示例代碼:
vehicle.js
Ext.define('MyApp.view.MyVehicleGridPanel', {
extend: 'Ext.grid.Panel',
id : 'mygridpanel',
//renderTo : 'vehiclebody',
alias: 'widget.mygrid',
header: false,
store: UserStore,
multiSelect: false,
columns: [
{
xtype: 'gridcolumn',
dataIndex: '_id',
text: 'Vehicle ID'
},
{
xtype: 'gridcolumn',
width: 126,
dataIndex: 'Plat_No',
text: 'Plat Number'
},
{
xtype: 'gridcolumn',
width: 200,
dataIndex: 'Name',
text: 'Added By'
}
]
})
當用戶點擊toorbar將再次使用別名mygrid
。
這是我的工具欄的代碼:
var BtnVehicle = Ext.getCmp('BtnVehicle');
BtnVehicle.on('click', function(){
tabs.add({
closable: true,
xtype : 'mygrid',
//html: '<div style="width:100%; height:100%; background-color:#cccccc;"><iframe src="vehicle/vehicle.html" frameborder=0 scrolling="no" style="width:100%; height:100%;"></iframe></div>',
iconCls: 'bus32',
title: 'Vehicle Manage'
}).show();
})
只要用戶能夠以相同的設計相同的GridPanel創建無限制選項卡。
怎麼來的時候創建第二個相同的xtype: 'mygrid'
然後該標籤將變得不起作用?從GridPanel
配置
不要在GridPanel中使用'id'例如id:'mygridpanel'' – MMT
@MMT如果沒有'id'我怎麼能像'var grid = Ext.getCmp('mygridpanel')那樣獲取gridpanel? ?有其他方法嗎? –
檢查[Ext.ComponentQuery](http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.ComponentQuery) – MMT