gpt4 book ai didi

extjs - EXTJS 中的嵌套网格

转载 作者:行者123 更新时间:2023-12-04 22:51:00 43 4
gpt4 key购买 nike

你好

如何在 ExtJS 中设计嵌套网格
请提供一些示例(如何在 ExtJS GridPanel 中使用 RowExpander)

最佳答案

尝试这样的事情:

 //Create the Row Expander.
var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.Template('<div id="myrow-{Id}" ></div>')
});

//Define the function to be called when the row is expanded.
function expandedRow(obj, record, body, rowIndex){
//absId parameter for the http request to get the absence details.
var absId = record.get('Id');

var dynamicStore = //the new store for the nested grid.

//Use Id to give each grid a unique identifier. The Id is used in the row expander tpl.
//and in the grid.render("ID") method.
var row = "myrow-" + record.get("Id");
var id2 = "mygrid-" + record.get("Id");

//Create the nested grid.
var gridX = new Ext.grid.GridPanel({
store: dynamicStore,
stripeRows: true,
columns: [
//columns
],
height: 120,
id: id2
});

//Render the grid to the row expander template(tpl).
gridX.render(row);
gridX.getEl().swallowEvent([ 'mouseover', 'mousedown', 'click', 'dblclick' ]);
}

//Add an expand listener to the Row Expander.
expander.on('expand', expandedRow);

您可以在此找到更多信息 Here

关于extjs - EXTJS 中的嵌套网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5632744/

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