Pregunta

Estoy tratando de ocultar la línea de tiempo de una lista de tareas de forma declarativa, ya sea en la Vista o en XSLTListViewWebPart.El XLSTListViewWebPart se agrega a través de un módulo y un archivo, así:

<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>

¿Hay alguna propiedad que se pueda agregar para eliminar la línea de tiempo aquí?¿O tal vez es algo que debe establecerse en la vista a la que hace referencia BaseViewId="6"?

* EDITAR *

Supongo que podría generar algo de CSS o hacer un jQuery inteligente que oculte toda esa área, pero preferiría eliminarla del renderizado por completo.

¿Fue útil?

Solución

Ok, pude hacer esto eliminando la columna TimelineDueDate de la definición de Vista en mi 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> 
...

Simplemente elimine DueDate FieldRef de ViewData, ¡y funciona!

Otros consejos

Si agrega su parte web usando xml (como en los archivos .webpart), puede agregar la siguiente propiedad

<property name="ShowTimelineIfAvailable" type="bool">False</property>
Licenciado bajo: CC-BY-SA con atribución
scroll top