Ocultar declarativamente a linha do tempo de uma lista de tarefas
-
29-09-2020 - |
Pergunta
Estou tentando ocultar a linha do tempo de uma lista de tarefas de forma declarativa, seja no modo de exibição ou no XSLTListViewWebPart.O XLSTListViewWebPart está sendo adicionado por meio de um módulo e arquivo, assim:
<File Url="default.aspx" Path="default.aspx" Type="GhostableInLibrary" ReplaceContent="TRUE" IgnoreIfAlreadyExists="FALSE" >
<Property Name="Title" Value="Open Issues" />
<Property Name="ContentType" Value="ProjectDashboardContentType" />
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/ProjectPortal-OpenIssues.aspx" />
<Property Name="ContentTypeId" Value="0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811009A4931CEF4F842B9BDFAF179837C58E2" />
<View WebPartZoneID="ProjectPortalZone" WebPartOrder="0" List="Lists/ProjectTasks" DefaultView="FALSE" BaseViewID="6">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="AllowConnect" type="bool">True</property>
<property name="ChromeType" type="chrometype">None</property>
<property name="Title" type="string">Project Tasks</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
</File>
Existe uma propriedade que pode ser adicionada para remover a linha do tempo aqui?Ou talvez seja algo que precise ser definido na exibição referenciada por BaseViewId="6"?
*EDITAR*
Suponho que eu poderia apenas produzir algum CSS ou fazer algum jQuery inteligente que ocultaria toda essa área, mas preferiria removê-lo completamente da renderização.
Solução
Ok, consegui fazer isso removendo a coluna TimelineDueDate da definição de View no meu esquema de lista:
<View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,Late_Tasks;" MobileView="True" MobileDefaultView="False" Url="late.aspx" ReqAuth="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/issuelst.png?rev=23">
<Toolbar Type="Standard" />
<JSLink>hierarchytaskslist.js</JSLink>
<XslLink Default="TRUE">main.xsl</XslLink>
<JSLink>clienttemplates.js</JSLink>
<RowLimit Paged="TRUE">100</RowLimit>
<ViewFields>
<FieldRef Name="Checkmark"></FieldRef><FieldRef Name="LinkTitle"></FieldRef><FieldRef Name="StartDate" /><FieldRef Name="DueDate"></FieldRef><FieldRef Name="AssignedTo"></FieldRef><FieldRef Name="Status" /><FieldRef Name="pdTaskType" /></ViewFields>
<ViewData>
<FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete"></FieldRef>
<FieldRef Name="DueDate" Type="TimelineDueDate"></FieldRef>
</ViewData>
...
Basta remover o DueDate FieldRef do ViewData e funciona!
Outras dicas
Se você adicionar sua webpart usando xml (como nos arquivos .webpart), poderá adicionar a seguinte propriedade
<property name="ShowTimelineIfAvailable" type="bool">False</property>