Hi,
I have requirement where I have to build a tree view which has skills in it and they are categorized under different domains.
As the data tree has almost 8 levels of drilldown we went with Load on demand mode as the page will be responsive and lite.
But make it easier for the users we are providing them search option where they type in the skill and ajax suggestion come in showing the skills available with the name under different parent nodes.
But to make it even easier we are providing suggestions with radio buttons when user select them they tree will be expanded to that particular skill.
I'm using the following function to expand the tree
function findNodes(node, searchString) {
var nodesarray = new Array();
nodesarray = searchString.split(".");
for (var i = nodesarray.length - 1; i >= 0; i--) {
if ((node.get_value() == nodesarray[i]) && i!=0) {
node.set_expanded(true);
node.set_visible(true);
for (var j = 0; j < node.get_nodes().get_count(); j++) {
findNodes(node.get_nodes().getNode(j), searchString);
}
} else if ((node.get_value() == nodesarray[i]) && i == 0) {
node.set_checked(true);
}
}
This function works fine with tree view which is already preloaded but doesn't work with load on demand tree.
It fails at
for (var j = 0; j < node.get_nodes().get_count(); j++) {
findNodes(node.get_nodes().getNode(j), searchString);
}
to be specific node.get_nodes().getNode(j),
It can expand the first level but not able to get nodes after that ...
Any suggestions or workarounds ?
Regards,
Mohan
I have requirement where I have to build a tree view which has skills in it and they are categorized under different domains.
As the data tree has almost 8 levels of drilldown we went with Load on demand mode as the page will be responsive and lite.
But make it easier for the users we are providing them search option where they type in the skill and ajax suggestion come in showing the skills available with the name under different parent nodes.
But to make it even easier we are providing suggestions with radio buttons when user select them they tree will be expanded to that particular skill.
I'm using the following function to expand the tree
function findNodes(node, searchString) {
var nodesarray = new Array();
nodesarray = searchString.split(".");
for (var i = nodesarray.length - 1; i >= 0; i--) {
if ((node.get_value() == nodesarray[i]) && i!=0) {
node.set_expanded(true);
node.set_visible(true);
for (var j = 0; j < node.get_nodes().get_count(); j++) {
findNodes(node.get_nodes().getNode(j), searchString);
}
} else if ((node.get_value() == nodesarray[i]) && i == 0) {
node.set_checked(true);
}
}
This function works fine with tree view which is already preloaded but doesn't work with load on demand tree.
It fails at
for (var j = 0; j < node.get_nodes().get_count(); j++) {
findNodes(node.get_nodes().getNode(j), searchString);
}
to be specific node.get_nodes().getNode(j),
It can expand the first level but not able to get nodes after that ...
Any suggestions or workarounds ?
Regards,
Mohan