gpt4 book ai didi

extjs4 - 带有 extjs 4 的嵌套网格

转载 作者:行者123 更新时间:2023-12-01 09:35:49 24 4
gpt4 key购买 nike

我可以把网格放在另一个网格的插件中。

这是我的网格,我想放入配置 'plugins' ext 网格。

 var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{ header: 'Customer Name', dataIndex: 'CustomerName', width: 212 },
{ header: 'Charge Date', dataIndex: 'ChargeDate', width: 212 },
{ header: 'Package Plan', dataIndex: 'PackagePlan', width: 212 },
{ header: 'Current Invoice Sum', dataIndex: 'CurrentInvoiceSum', width: 212 }
],
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: ['<div style="background-color:#CBDDF3; width:643px;margin-left:147px;margin-bottom: 20px;border: 1px solid;">',
'<p><b>Customer Details:</b><br/>{CustomerName}<br/> {CustomerAddress}, {CustomerPhone}, {CustomerEmail} </p>',
'<p><b>Package Type:</b> {PackagePlan}<br/>',
'<b>Invoice Details:</b></p>',
'<div class="nestedO" id="{InvoiceId}"></div> </div>',
]
}],
width: 900,
height: 450,
renderTo: Ext.get('Ongoing')
});

有可能吗?

最佳答案

嵌套网格是可能的。这是 Sencha 论坛的解决方案:

http://www.sencha.com/forum/showthread.php?151442-Nested-EXTJS-4-Grids&p=668193&viewfull=1#post668193

你几乎明白了。在插件部分,我们将创建一个空的 div,我们将在其中渲染我们的嵌套网格:

plugins: [{
ptype: "rowexpander",
rowBodyTpl: ['<div id="SessionInstructionGridRow-{ClientSessionId}" ></div>']
}],

当用户展开网格行时,我们会将嵌套网格渲染到其中。

expandbody : function(rowNode,record, expandbody) {
var targetId = 'SessionInstructionGridRow-' + record.get('ClientSessionId');
if (Ext.getCmp(targetId + "_grid") == null) {
var sessionInstructionGrid = Ext.create('TS.view.client.SessionInstruction', {
renderTo: targetId,
id: targetId + "_grid"
});
rowNode.grid = sessionInstructionGrid;
sessionInstructionGrid.getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);
sessionInstructionGrid.fireEvent("bind", sessionInstructionGrid, { ClientSessionId: record.get('ClientSessionId') });
}
}

关于extjs4 - 带有 extjs 4 的嵌套网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8254113/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com