A Profile Grid will display a list of profiles. The grid will be sortable by name and date.
The grid also supports paging, by default displaying five profiles per page.
How to Create a Profile Grid
The first step is to create a div element in the HTML file, which the grid will attach to.
Give the div an ID like the following
The second step is to instantiate a grid object in the Javascript file.
The files dom.js and ProfileGrid.js are needed so these will be added to the require statement
require(["sbt/dom", "sbt/connections/controls/profiles/ProfileGrid"],
function(dom, ProfileGrid) {
Next a profile grid object is created, a type and user id must be passed as arguments
var grid = new ProfileGrid({
type:
userID:
});
There are different types of profile grids outlined below.
"profile" | This will display the profile of the specified user |
"reportingChain" | This will display the reporting chain of the specified user. |
"colleagues" | This will display the specified user's colleagues. |
"peopleManaged" | This will display a list of profiles that the specified user manages. |
"connectionsInCommon" | This will display profiles of people who are connected to the two specified users. |
A userId argument is also passed this specifies the user who's profile, reporting chain etc you wish to view.
In the case of connectionsInCommon, userId1 and userId2 parameters are needed.
When the grid object is created it needs to be attached to the page, to do this get a reference to the div
specified in the HTML file by its Id, and call the elements appendChild() function
dom.byId("gridDiv").appendChild(grid.domNode);
Finally call the grids update() function, to retrieve the profile data.
Complete code listing for reporting chain profile grid.
require(["sbt/dom", "sbt/connections/controls/profiles/ProfileGrid"], function(dom, ProfileGrid) {
var grid = new ProfileGrid({
type : "reportingChain",
userid : "%{sample.userId1}"
});
dom.byId("gridDiv").appendChild(grid.domNode);
grid.update();
});