Breadcrumb to always display

Hello,

I’m currently evaluating this product (v 2.2.7). I have a need to always display the breadcrumb when the chart has a root ID set to a particular person. I’d still like to see the breadcrumb show that root ID’s manager, and managers manager if applicable. The breadcrumb only shows when I use the search box, but not when a root is set.

My most basic need is to be able to set the root ID to someone but also be able to see on the chart whom they report too, either by the breadcrumb or as boxes in the chart. However the person with the root ID set is the one in main focus.

Please let me know if you need more information or clarification.

Regards,
Saav.

Hi Saavan,

Thank you for your question.

In your case you need to use drill down to specific user by default instead of root ID. You can put simple JavaScript into JavaScript editor of the configuration wizard. This script will do everything for you.

You can find similar case with drilling down to specific user according to URL parameter here.
Additional information about JavaScript framework is in the documentation.

Please take a look at the code sample below. Just replace “accountNameForDefaultDrillDown” with account name of employee which you want to display by default.

As result breadcrumb will be rendered and you will be able to navigate up from current employee.

[code]var isFirstLoad = true;
var accountName = “accountNameForDefaultDrillDown”;

renderer.onLoadingFinished(function(){

if(isFirstLoad){

isFirstLoad = false;
    
 renderer.drillDown(accountName);

}

});[/code]

Thanks for the swift reply Anton.

I’ve tried your code snippet without luck unfortunately.

Here is the contents of the JavaScript editor within the configuration wizard:

[code]renderer.onBoxRendered(function(event, box, itemData){
//Box rendered event
});

renderer.onTooltipRendered(function(event, tooltip, itemData){
//Tooltip rendered event
});

renderer.onSearchResultRendered(function(event, searchResult, itemData){
//Search result rendered event
});

var isFirstLoad = true;
var accountName = “AAA\000000”;

renderer.onLoadingFinished(function(){

if(isFirstLoad){

isFirstLoad = false;
    
 renderer.drillDown(accountName);

}

});[/code]

The error message I receive is "Cannot find the root item with ID “AAA000000.” (A being the Domain Name, 0 being the User ID. It seems the ‘’ is not kept? I’ve even tried structuring the Account Name without the domain name with no joy.

“” symbol is reserved in JavaScript. You have to escape it like this:

var accountName = "AAA\\000000";

Double “\” symbols instead single “”.

Anton,

Thank you very much, this now works perfectly. Defaulting to the user I specified, but also with the ability to drill up via the on-hover ‘Go to parent’ and ‘Go to root’, with the breadcrumb intact for a second reference point.

I should have remembered to use “\” because this was required in the custom code that is floating around to get the OOB SharePoint Org Browser to work on a site collection other than My Sites.

Thanks again for the advice, much appreciated.

Kind regards,
Saav.

I appreciate your feedback. Feel free to contact us with any additional questions.