我想在其他网格的工具提示上添加此网格请帮帮我。 下面的代码是我的网格面板示例使用Extjs创建。 它检查网格是否已经创建,以便显示另一个网格。 function createAdminGridView(){ var myGrid = Ext.getCmp(' AdminReportGrid');
if (myGrid) {
Ext.getCmp('AdminReportGrid').destroy();
}
var extAdminReportGrid = Ext.create('Ext.grid.Panel', {
renderTo: CFM.Common.Common.GetExtID('divGridViewAdminDisplay', 'ReportAdminOption'),
requires: [
'CFM.store.PayeeReportStore',
'CFM.Common.Common'
],
id: 'AdminReportGrid',
singleSelect: false,
columnLines: true,
width: 700,
height: 230,
store: CFM.MySharedData.PayeeReport,
emptyText: 'No record found.',
autoCreate: false,
loadMask: true,
selModel: {
selType: 'rowmodel',
pruneRemoved: false
},
multiSelect: true,
viewConfig: {
trackOver: false
},
verticalScroller: {
variableRowHeight: true
},
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
ptype: 'cellediting',
clicksToEdit: 1,
listeners: {
}
}
)
],
/* listeners: {
beforeedit: function (editor, e, eOpts) {
if ((e.record.get('PaidStatus') == 'True' ))
{
alert('Cannot edit column');
return false;
}
else {
return true;
}
}
},*/
columns: [
{
hidden: true,
dataIndex: 'CompanyID'
},
{
hidden: true,
dataIndex: 'AccountantCommissionID'
},
{
header: 'Company Name',
dataIndex: 'CompanyName',
width: 190,
cls: 'report-grid-header'
},
{
header: 'Accoutant Name',
dataIndex: 'AccoutantName',
width: 190,
cls: 'report-grid-header'
},
{
header: 'Payment Date',
width: 100,
dataIndex: 'PaymentDate', // the name of the field in the model
renderer: Ext.util.Format.dateRenderer('d-m-Y'), // the column type
cls: 'report-grid-header'
},
{
header: 'Commission Amount',
dataIndex: 'CommissionAmount',
width: 140,
cls: 'report-grid-header',
align: 'right',
renderer: Ext.util.Format.numberRenderer('000000000.00')
},
{
xtype: 'checkcolumn',
header: 'Paid Status',
id: 'PaidStatus',
/* header:ColumnHidden,*/
dataIndex: 'PaidStatus',
width: 80,
cls: 'report-grid-header',
/* baseCls: 'my-custom-grid-lightskyblue',*/
stopSelection: false,
listeners: {
beforecheckchange: function (column, row, checked, opts) {
if (Ext.getCmp('AdminReportGrid').getStore().data.items[row].dirty == false) {
var PaidStatus = Ext.getCmp('AdminReportGrid').getStore().data.items[row].data['PaidStatus'];
if (PaidStatus == true) {
Ext.MessageBox.alert('Paid Status', 'Commission is Already paid...');
return false;
}
else {
return true;
}
}
}
},
editor:
{
xtype: 'checkboxfield'
}
}
]
});
答案 0 :(得分:0)
我不确定我是否理解您的问题,但您无法在工具提示中加入ExtJS组件。
但是你可以在工具提示中加入一些html,这样你就可以将基本表显示为工具提示。