SharePoint Experts Blog

Posts Tagged Conditional formatting

How to use JavaScript and CSS for conditional formatting in SharePoint org chart

Update: Since version 2.0 we moved JavaScript framework functions from jQuery ($) object to renderer object. Now you can call functions like this: renderer.onBoxRendered. You still can use standard jQuery ($) functions.

In this article I will show how to conditionally format org chart boxes and search results according to field values from data source, for example User Profile Service or SharePoint list. SharePoint Org Chart 1.7.1 and higher allows to add dynamics to boxes using JavaScript. Usually we need to highlight boxes according to some quite simple rule, but sometimes we need to implement more difficult logic. In this article I will show how to simply highlight boxes with specific color as well as show more complex case with displaying awards and search result highlighting. As result I want to change background of boxes and search results according to field values from data source and add gold, silver or bronze medals to boxes of the best employees.

Read more…

Posted in: Org Chart