function getDataSourceNodes() {
let rowDim;
var props={
"derivedTreeConfig":
"deriveTreeFromSource":
"dynDataNodes":
"maxChild":
"nodesExceededMaxChild":
}
/* console.log(props.derivedTreeConfig);
console.log(props.deriveTreeFromSource);
console.log(props.dynDataNodes);
console.log(props.maxChild);
console.log(props.nodesExceededMaxChild); */
const withDerivedChildren = props.derivedTreeConfig.reduce((nodes, config, i) => {
if (config.deriveChildren && config.cMeth == "") { // Ignore derived config if node is not from Source
nodes.push({ config: config, index: i })
}
return nodes
}, []);
if (!withDerivedChildren.length) {
return;
}
props.deriveTreeFromSource = true;
props.nodesExceededMaxChild = {};
if(props.dynDataNodes.length) {
rowDim = props.dynDataNodes;
// Change the configuration of the nodes based on the source:
$.each(withDerivedChildren || [], (i, node) => {
let tmpl = props.derivedTreeConfig[node.index];
tmpl.cMeth = tmpl.derivedSim == 'P' ? '' : 'A' // Make the node aggregate the children
tmpl.locked = tmpl.level == 0 ? 'X' : (!tmpl.derivedSim ? '' : 'X')
})
// We now have all the rows in the right order and can now enrich the tree config where they belong:
for (let j = withDerivedChildren.length - 1; j >= 0; j--) {
const node = withDerivedChildren[j];
const tmpl = node.config;
let level = -1;
const children = [];
const maxChildMap: any = {};
for (let i = 0; i < rowDim.length; i++) {
var d = rowDim[i];
const nextRow = rowDim[i + 1] ||...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.