Different color for empty field

Hi,

we using Orgchart for Office365 where datasource is Sharepoint list, orgchart is based / linked on position and position-to-position reporting. I would like to display different color for “vacant” box / position, where Worker field is empty.

How to do this with code ?

renderer.onBoxRendered(function(event, box, itemData){
if(itemData[“Worker”].contains(’’)){
box.$elem.css({
‘background-color’: ‘red’,
‘border-color’: ‘red’
});
}
});

Hi @MarianDanisek,

Do you store information about vacancies in a separate list?

Then, please, add CSS like this into Custom CSS tab of the configuration wizard to change the color of the vacancies boxes:

.poch-vacancy .pl-item-template{
  background-color: black;
  border-color: black;
}

Anna,

did you read my email correctly ? I guess no.

Hello @MarianDanisek,

If you prefer not to use a separate vacancies list then, indeed, you may display a different color for a box with empty Worker field with help of Custom javascript. Please, use == operator to select such boxes:

renderer.onBoxRendered(function(event, box, itemData){
if(itemData['Worker'] == ''){
box.$elem.css({
'background-color': 'red',
'border-color': 'red'
});
}
});