Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my custom XSLT file, I am able to modify a choice field to swap the text for icons.

My choice looks like this; it just checks for the column header name and for the number in parenthesis, then it adds my html. The icons are set via CSS:

(1) Confirmed
(2) Waiting
(3) Unconfirmed

This works in a regular list view, but not in the GANTT view.

    <!-- Convert the Fields into a status icons    -->  
    <xsl:template match="FieldRef[@Name='Confirmation_x0020_Status']" mode="body">
        <xsl:param name="thisNode" select="."/>
        <xsl:variable name="currentValue" select="$thisNode/@Confirmation_x0020_Status" />
        <xsl:variable name="statusRating1">(1)</xsl:variable>
        <xsl:variable name="statusRating2">(2)</xsl:variable>
        <xsl:variable name="statusRating3">(3)</xsl:variable>

        <xsl:choose>
            <xsl:when test="contains($currentValue, $statusRating1)">
                <span class="statusRatingX statusRating1"></span>
            </xsl:when>
            <xsl:when test="contains($currentValue, $statusRating2)">
                <span class="statusRatingX statusRating2"></span>
            </xsl:when> 
            <xsl:when test="contains($currentValue, $statusRating3)">
                <span class="statusRatingX statusRating3"></span>
            </xsl:when> 
            <xsl:otherwise>
                <span class="statusRatingN"><xsl:value-of select="$currentValue" /></span>
            </xsl:otherwise>                    
        </xsl:choose>
    </xsl:template> 

I've gotten this far by making a copy of c:\program files\common files\microsoft shared\web server extensions\14\TEMPLATE\LAYOUTS\XSL\fldtypes.xsl and adding the above snippet to the copy and placing the copy in that same directory. It works on regular lists quite well.

So how do I make this XSLT work in GANTT view?

[edit]

Has anyone ever even tried to use icons in GANTT view? (a few days later)... Wow! this must be a hard question. No votes, no clues, no comments... Really, can anyone help me out here (even just an upvote?)... Is there anybody out there?

share|improve this question
1  
I suppose this is a lousy question? I've posted complete code and examples and explained thouroughly my issue. I should at least get votes for my effort, no? 16 views and no votes. I've discovered that getting upvotes on questions in SSE is like pulling teeth. –  BGM Jul 26 '13 at 13:50
    
Thank you to whoever listened to my rant and upvoted my poor question! –  BGM Aug 1 '13 at 13:25
add comment

1 Answer

Just being trying to find an extension point for the list view web part when it displaying a Gantt Chart view.

If you add a list view to a page of your list and then switch to the Gantt Chart view you get an option to override the XSLLink with custom XSLT. However, if you apply the web part properties then those options disappear.

So, the Gantt chart in SharePoint 2010 seems to do all the rendering in the web control. In SharePoint 2013 there is a SP.Gantt.js which does the rendering.

So the only solution that I can think of would be to override the Microsoft.SharePoint.WebControl.Gantt class (its public and not sealed) (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.gantt_members(v=office.14).aspx) and then create your own custom list definition with a custom list schema and list view.

Sounds a little scary.

share|improve this answer
    
Interesting. Interesting but definitely scary. I suppose I could do it with jQuery by way of a workaround. –  BGM Aug 3 '13 at 14:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.