How sort the members of a site on the preview dashlet dashboard of the site?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Established Member II

How sort the members of a site on the preview dashlet dashboard of the site?

Jump to solution

Our teams have developed two shares that work perfectly, the only difference is in the dashlet of the members of the single site are sorted by last name [first name] in one while in the other are sorted by name [last name]. Which property is such a difference?

Greetings.

1 Solution

Accepted Solutions
Highlighted
Advanced II

Re: How set the order of the site members on the dashlet?

Jump to solution

What you are saying like of makes no sense, as the code has an explicit sort by name in code, as you can see here and here

Are you talking about the OOTB colleagues dashlet?

View solution in original post

8 Replies
Highlighted
Advanced II

Re: How set the order of the site members on the dashlet?

Jump to solution

What you are saying like of makes no sense, as the code has an explicit sort by name in code, as you can see here and here

Are you talking about the OOTB colleagues dashlet?

View solution in original post

Highlighted
Established Member II

Re: How set the order of the site members on the dashlet?

Jump to solution

ty for response douglas , your link are been very helpful and i think they can solved by problem and answer to my question, for your question, the dahslet i'm talking about is the standard documented here http://docs.alfresco.com/5.2/concepts/sites-dashlet-use.html.

let you know if i solved my problem with your advise.

Greetings

Highlighted
Established Member II

Re: How set the order of the site members on the dashlet?

Jump to solution

K the response of Douglas help me a lot, i'm not found on alfresco 4 the javascript colleagues.get.js , but i found  the script site-members.js to customize for sort by surname instead name:

 // Sort the member list by name
    items.sort(function (membership1, membership2)
    {
      var name1 = membership1.firstName + membership1.lastName,
         name2 = membership2.firstName + membership2.lastName;
      return (name1 > name2) ? 1 : (name1 < name2) ? -1 : 0;
    });

....................................................................

  if ((firstName !== undefined) || (lastName !== undefined))
         {
            name = firstName ? firstName + " " : "";
            name += lastName ? lastName : "";
         }

............................................................................
 
    // Sort the member list by surname

items.sort(function (membership1, membership2)
    {
      var name1 = membership1.lastName + membership1.firstName,
         name2 = membership2.lastName + membership2.firstName;
      
      return (name1 > name2) ? 1 : (name1 < name2) ? -1 : 0;
    });

.....................................................................

if ((firstName !== undefined) || (lastName !== undefined))
         {
            name = lastName ? lastName + " ": "";
            name += firstName ? firstName : "";        
         }

it's work when i go to the dashlet "All Members" of the site but it's not work for the "preview" in the site dashboard, there is some other javascript i need to modify? here i put a image of the problem:

They are order for name not surname. Someone can help me with that.

Highlighted
Advanced II

Re: How set the order of the site members on the dashlet?

Jump to solution

Hello.

Based on your text and the attached image, I could not understand what is and what is not working.

Can you please elaborate?

Highlighted
Senior Member II

Re: How sort the members of a site on the preview dashlet dashboard of the site?

Jump to solution

...I think Marco wants to sort the Users by lastName+firstName not by firstName+lastName which is the default sorting in the dashlet.

Highlighted
Established Member II

Re: How sort the members of a site on the preview dashlet dashboard of the site?

Jump to solution

yes like martin said, sorry for the misunderstanding

Highlighted
Advanced II

Re: How sort the members of a site on the preview dashlet dashboard of the site?

Jump to solution

Are you on Alfresco 4 yet?

The file colleagues.get.js, at least in Alfresco Share 5.2.e, is the file used for the dashlet Site Members:

   <shortname>Site Members</shortname>
   <description>Lists members in the collaboration site</description>

The file site-member.get.js is used by the webscript responsible to return data for the Site Members "page":

   <shortname>site-members</shortname>
   <description>Site Members component</description>

In this case, I don't know if the name of the file is right, as there are both site-members.js (the client side javascript file) and site-member.get.js (the webscript's controller).

So, there are different places to check/change, and I am not sure if you are talking about what I think you are.

Besides that, I still didn't get what is the preview you mentioned.

Highlighted
Established Member II

Re: How sort the members of a site on the preview dashlet dashboard of the site?

Jump to solution

Sorry Douglas you were right from the start, for some reason my brain is trying to find the colleagues.get.js under alfresco webapp not the share, i have solved all. For anyone have the same issue you can find more detail into this question Sort site members by surname not name on site dashboard.

P.S i don't now how to call the scrool panel of the site-members show on the left side of the site dashboard , i think is acceptable call it "preview panel of the members of the site".

Greetings.