gpt4 book ai didi

javascript - Ag-grid - 没有详细数据时,主/详细隐藏人字形图标

转载 作者:行者123 更新时间:2023-12-05 00:36:44 25 4
gpt4 key购买 nike

在主/详细示例中,设置 [masterDetail]=true 时始终存在展开/折叠图标.但是,我的数据有时没有详细信息行,我想在这种情况下隐藏 V 形。在我的示例中,callRecords 属性将出现在数据上,但它为空:

getDetailRowData: function(params) {
params.successCallback(params.data.callRecords);
},

当数据为空时,如何不在主网格上显示 V 形?注意:此处可见示例: https://www.ag-grid.com/javascript-grid-master-detail-detail-grids/#detail-grid-options

最佳答案

here 涵盖了这一确切要求在文档中。

基本上你实现 isRowMaster -

this.isRowMaster = function(dataItem) {
return dataItem ? dataItem.callRecords.length > 0 : false;
};

从文档 -

In specify which rows should expand, provide the grid callback isRowMaster. The callback will be called once for each row. Return true to allow expanding and false to disallow expanding for that row.

关于javascript - Ag-grid - 没有详细数据时,主/详细隐藏人字形图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62304785/

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