Skip to content

Instantly share code, notes, and snippets.

@antonkhrit
Created October 3, 2017 14:38
Show Gist options
  • Save antonkhrit/f141253fa49fcc37f6a7f7fd571c1d04 to your computer and use it in GitHub Desktop.
Save antonkhrit/f141253fa49fcc37f6a7f7fd571c1d04 to your computer and use it in GitHub Desktop.
Add menu item to expand all Org Chart nodes
//Number of levels to expand
var levelsToExpand = 10;
//Funciton to expand
function addExpandAllMenu(){
//Append menu item
var $menuItem = $("<a href='#' class='poch-wizard-link'>Expand nodes</a>")
$(".poch-sub-menu").prepend($menuItem);
//Expand nodes on menu item click
$menuItem.click(function(){
renderer.showLoadingPanel();
renderer.expandNodeLevels(levelsToExpand, function(){
renderer.hideLoadingPanel();
});
});
}
addExpandAllMenu();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment