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

We use SharePoint and DVWP for getting items from InfoPath Form library. In DVWP we enabled 4-level grouping. And rows with group headers looks like this:

  • Month: Value
    • Type: Value
      • Category: Value
        • Subcategory: Value

And this looks good except behavior when one of grouping fields contains blank values. In this case - we can see expanded grouping rows with group headers which looks like "field_name: " except "field_name: value".

Is it possible (with jQuery or with XSL) to hide this rows (which contain group header with blank field value) from DVWP?

Any help will be appreciated.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

I assume that you just want to remove the grouping header row and not the items in the grouping. I think that addressing this directly in XSL would be the best way. In your XSL template, add a validation against the group field value (should be $fieldvalue)

You can put this in your specific grouping template :

<xsl:if test="$fieldvalue != ''"> <!-- grouping header --></xsl:if>

or in the body template :

<xsl:if test="$groupheader0 != ''"> 
    <xsl:call-template name="dvt_1.groupheader0">
    <!-- params -->
    </xsl:call-template>
</xsl:if>

Before

Month: July

  Type:

    Item1

After

Month: July

   Item1

share|improve this answer
    
This is exactly what I want. Thank you very much! –  user18523 Jul 29 '13 at 9:35
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.