In the model structure tree, how to obtain the dbid of all leaf nodes under the parent node according to the dbid of the parent node at one level above the leaf node

in the model structure tree, how to obtain the dbid of all leaf nodes under the parent node according to the dbid of the parent node one level above the leaf node

Oct.28,2021

calling L_GetAllChildIdList will get the dbid of all child components (not all parent objects by default). Good luck

let _treeData=viewer.impl.model.getData().instanceTree.nodeAccess;
function _RecursionGetChild (id, list) {
    let length = _treeData.getNumChildren(id);
    if (length < 1) {
        if (list.indexOf(id) == -1) {
            list.push(id);
            // console.log(" >LJason< :--",id,list);
        }

        return;
    }
    // api
    // enumNodeChildrenfindNodeChild 
    _treeData.findNodeChild(id, function (id) {
        // 
        // if(list.indexOf(id)!=-1){
        //     list.push(id);
        // }
        _RecursionGetChild(id, list);
    });
},
function L_GetAllChildIdList () {
    let targets = viewer.getSelection();
    let list = [];
    if (targets) {
        for (let i = 0; i < targets.length; iPP) {
            _RecursionGetChild(targets[i], list);
        }
    } else {
        console.error(" >LJason< :");
        return;
    }
    console.log(" >LJason< :", list);
    return list;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3333f-2be5a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3333f-2be5a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?