3

I have a user who is using a SharePoint list with a gantt view as MS Project-lite. For each Project, there are 4 entries in the list: Project, Phase 1, Phase 2, Phase 3. Each entry has a reference to the master project information (in another list), a start date, and end date. The gantt view is grouped by project and each group is sorted by start date (e.g. Project 1 starts before Project 2). Our gantt rows currently look like this:

Project: Project 1
    Project 1
    Phase 1
    Phase 2
    Phase 3

Project: Project 2
    Project 2
    Phase 1
    Phase 2
    Phase 3

My user wants to have certain "promoted" projects that are sorted to the top, regardless of start date. I have created a field for this, but for some reason the gantt view won't promote them even when I have this as my primary sort (e.g. Promoted = yes)

I can group on Promoted Yes/No to achieve the sorting I want, but don't want this grouping row to show as it wastes valuable real estate on the page:

Promoted: Yes
  Project: Project 2
     Project 2
     Phase 1
     Phase 2
     Phase 3

Promoted: No
  Project: Project 1
     Project 1
     Phase 1
     Phase 2
     Phase 3

  Project: Project 3
     Project 3
     Phase 1
     Phase 2
     Phase 3

How do I get Project 2 to appear above Project 1 if it's flagged as promoted, without showing the "promoted" grouping? I can use javascript/jquery in a script web part to achieve this (but don't know the specifics - I'm new to SP scripting), but cannot install custom tools on the server.

  • 1
    are you tried to sort with promoted Desc, not Asc to show Yes before No – Mohamed El-Qassas MVP May 12 '17 at 22:38
  • Yes, that sort doesn't work at all, asc or desc. Project 2 stays in the middle. I'm not sure why. – Kalea May 12 '17 at 23:09
1

Found the solution I was looking for, which involves:

  1. Creating a calculated field concatenating the Promoted and Project Name fields. Result is "True:Project 2" or "False: Project 1".
  2. Grouping on the calculated field
  3. Adding a bit of jquery to hide the "True:" and "False"

I even made it work with my lookup-type fields!

https://social.technet.microsoft.com/wiki/contents/articles/16827.sharepoint-2010-group-by-view-with-order-by-on-datetime-field.aspx

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.