Is it possible for a chart that is using User Profile Service data to display vacant positions in a hierarchy? Long shot, I know. I feel it may be easier to do when using a list as the data source. Is there functionality for this when using UPSS?
In the case that there is, is there also a way to then target that particular box for custom CSS/JavaScript styling? Additionally how do I target ‘Assistant’ boxes for styling?
Thank you for your question. Currently Org Chart doesn’t support vacant positions for User Profiles data source. You are right, you can easily achieve this with SharePoint list as a data source. If you need this functionality for user profiles you can send request for paid support to support@plumsail.com and we will provide estimation. It can be separate list with vacancies mapped to structure from user profiles.
Regarding styling assistants with JS\CSS.
It is easy to do with CSS. There is CSS class “poch-assistant”. You can use it to apply styling to assistant box only. Please find the example below:
You also can detect if current box is assistant in HTML template of the box and add custom markup for assistant only. In the example below I added new CSS class to fields DIV. Pay attention to:
There is no direct way to detect if current box is an assistant from JavaScript event, but you can check if there is parent tag with class “poch-assistant” as workaround. The example is below:
It seems I wasn’t able to get the CSS working to change the colour of the boxes. Instead I wrote this work around before I read your reply.
//Script for dynamically loading person based on 'accountName', leaving the breadcrumb and drilldown intact.
var isFirstLoad = true;
var accountName = "000\\AAAAAA";
renderer.onLoadingFinished(function(){
if(isFirstLoad){
isFirstLoad = false;
renderer.drillDown(accountName);
}
});
//On render, apply a custom colour to all boxes and their borders.
renderer.onBoxRendered(function(event, box, itemData){
box.$elem.css({
'background-color': '#006652',
'border-color': '#006652'
});
});
//On render for those boxes that have a value in 'Assistant', change their styling.
renderer.onBoxRendered(function(event, box, itemData){
if(itemData["Assistant"]){
box.$elem.css({
'background-color': '#00ad93',
'border-color': '#00ad93'
});
}
});