我在可折叠面板中使用工具栏渲染网格时遇到了麻烦。正如您在底部的代码中看到的那样,我有阅读器、存储、带有 bbar 和面板的网格。当我将面板的可折叠属性设置为假网格时,工具栏会完美呈现。但是,当我将面板可折叠属性设置为true然后展开面板时,我看不到工具栏。我想在面板上显示带有工具栏的网格和数据展开没有任何麻烦。如何修复此代码?
谢谢大家。
var reader_DailyActivity = new Ext.data.JsonReader({
totalProperty : 'total',
successProperty : 'success',
root : 'data',
fields : [
{name: 'date'},
{name: 'time'},
{name: 'description'},
{name: 'speed'},
{name: 'distance'},
{name: 'type'},
{name: 'source'}
]
});
var store_DailyActivity = new Ext.data.Store({
id : 'dailyActivityStoreID',
reader : reader_DailyActivity
});
var pagingToolbar = new Ext.PagingToolbar({
pageSize : 20,
buttonAlign : 'center',
store : store_DailyActivity
});
var DailyActivityGrid = new Ext.grid.GridPanel({
id : 'dailyActivityGrid',
store : store_DailyActivity,
loadMask : true,
height : 300,
autoScroll : true,
viewConfig : {
emptyText : 'No Record Found',
deferEmptyText : false,
forceFit : true
},
columns :[
{header: 'Date', dataIndex: 'date'},
{header: 'Time', dataIndex: 'time'},
{header: 'Description', dataIndex: 'description'},
{header: 'Speed', dataIndex: 'speed'},
{header: 'Distance', dataIndex: 'distance'},
{header: 'Type', dataIndex: 'type'},
{header: 'Source', dataIndex: 'source'}
],
bbar : pagingToolbar
});
var VehicleDetail = new Ext.Panel({
title : 'Activity Details',
id : 'panel_DetailID',
collapsible : true,
collapsed : true,
renderTo : 'renderedDivID',
items : DailyActivityGrid,
listeners : {
'expand' : function(hede)
{
var panelMask = Ext.getCmp('panel_DetailID');
// mask grid panel
panelMask.getEl().mask('Please Wait');
Ext.Ajax.request({
url: 'url comes here',
params:
{
param1 : reqParam1,
start : 0,
limit : 20
},
success: function (result, request)
{
var resData = Ext.util.JSON.decode(result.responseText);
store_DailyActivity.loadData(resData);
// unmask grid panel
panelMask.getEl().unmask();
},
failure: function ()
{
console.log('error');
}
});
}
}
});