嵌套行的getRow
getRow for nested row
我有一个带有嵌套数据树的 table,我需要折叠特定行但似乎无法获取嵌套行的行实例。我可以使用顶级行的索引来执行 table.getRow(1) 但 table.getRow(2) 失败。我可以获得第 68 行的行实例,它是下一个顶级行,所以我似乎无法获得行(2),因为它是行(1)的子行。有没有其他方法来获取子行? table.getRow(1).getRow(2)?
检查documentation check this jsfiddle并检查控制台
use `var children = row.getTreeChildren();`
// Get all rows
const allRows = table.getRows();
console.log('allRows',allRows);
const firstRow = table.getRow(1);
console.log('firstRow',firstRow);
const firstRowChildren = firstRow.getTreeChildren();
console.log('firstRowChildren',firstRowChildren);
$('#toggle').click(function(){
firstRow.treeToggle();
});
我有一个带有嵌套数据树的 table,我需要折叠特定行但似乎无法获取嵌套行的行实例。我可以使用顶级行的索引来执行 table.getRow(1) 但 table.getRow(2) 失败。我可以获得第 68 行的行实例,它是下一个顶级行,所以我似乎无法获得行(2),因为它是行(1)的子行。有没有其他方法来获取子行? table.getRow(1).getRow(2)?
检查documentation check this jsfiddle并检查控制台
use `var children = row.getTreeChildren();`
// Get all rows
const allRows = table.getRows();
console.log('allRows',allRows);
const firstRow = table.getRow(1);
console.log('firstRow',firstRow);
const firstRowChildren = firstRow.getTreeChildren();
console.log('firstRowChildren',firstRowChildren);
$('#toggle').click(function(){
firstRow.treeToggle();
});