Created
October 3, 2017 14:38
-
-
Save antonkhrit/f141253fa49fcc37f6a7f7fd571c1d04 to your computer and use it in GitHub Desktop.
Add menu item to expand all Org Chart nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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