3

I have added an Organization browser to a page and was able to have it visible using the below code.

What I am wondering, is how I can have the browser begin with a specifc user and not the viewing user?

Code used:

<script type="text/javascript">
function CreateHierarchyChartControl(parentId, profileId, type, persistControlId) {
  var i = profileId.indexOf("|");
  var claimsmode = profileId.substr(i-1,1);
  if((i >=0 ) & (claimsmode=="w"))
  {
   profileId = profileId.substr(i+1,profileId.length-i-1);
   var initParam = profileId + ',' + type + ',' + persistControlId;
   var host = document.getElementById(parentId);
   host.setAttribute('width', '100%');
   host.setAttribute('height', '100%');
   Silverlight.createObject('/_layouts/ClientBin/hierarchychart.xap',
    host,
    'ProfileBrowserSilverlightControl',
    {
     top: '30',
     width: '100%',
     height: '100%',
     version: '2.0',
     isWindowless: 'true',
     enableHtmlAccess: 'true'
    },
    {
     onLoad: OnHierarchyChartLoaded
    },
     initParam,
     null);
    }
  }
</script>
0

add the 'accountname' parameter to your URL:

http://www.mysite.com/orgbrowser.aspx?accountname=domain/useraccount

Not sure why you created a javascript for this though - there is a web part you can just drop into the page...

  • Thank you, I am sorry, but the link has not been loading has been getting an error 404. This is not on the main site but but a sub-site where the Web Part often will not load without a JS script involved, the script was taken from another post here on stack exchange,. – user24557 Mar 21 '14 at 15:45
0

Try this one. slightly modified, finally worked for me.

<script type="text/javascript">

function CreateHierarchyChartControl(parentId, profileId, type, persistControlId, flowDirection, silverLightControlId)
{
    profileId = "WINDOWS\\username"; //added line

    var initParam = profileId + ',' + type + ',' + persistControlId + ',' + flowDirection + ',' + silverLightControlId;
    var host = document.getElementById(parentId);

    host.setAttribute('width', '100%');
    host.setAttribute('height', '100%');

    Silverlight.createObject('/_layouts/ClientBin/hierarchychart.xap',
        host,
        silverLightControlId,
        {
            top: '30',
            width: '100%',
            height: '100%',
            version: '4.0.50401.0',
            isWindowless: 'true',
            enableHtmlAccess: 'true'
        },
        {
            onLoad: OnHierarchyChartLoaded
        },
        initParam,
        null);
}

</script> ​​ 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.