Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top