Aug 18 2011 at 6:20 PM
Edited Aug 18 2011 at 7:18 PM
|
I know you're wanting to create something without dependencies, but I thought I'd throw this out there anyway and see what you thought. However, I can't figure out how to post XSL in a discussion post. How would I go about doing that?
Edited: here's the XSL. Each of these go through a list and return the HTML that jQuery UI is looking for to make the widget work. As they are, you'd have to do a little editing to update
the select in the value-ofs, but maybe you know of a way to generalize that.
Accordion:
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="dvt_RowCount" select="count($Rows)" />
<xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" />
<xsl:choose>
<xsl:when test="$dvt_IsEmpty">
<xsl:call-template name="dvt_1.empty" />
</xsl:when>
<xsl:otherwise>
<div id="accordion">
<xsl:call-template name="accordionMarkup">
<xsl:with-param name="Rows" select="$Rows" />
</xsl:call-template>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="accordionMarkup">
<xsl:param name="Rows" />
<xsl:for-each select="$Rows">
<h3>
<a href="#">
<xsl:value-of select="@Title" />
</a>
</h3>
<div>
<xsl:value-of select="@panelText" disable-output-escaping="yes" />
</div>
</xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.empty">
<xsl:variable name="dvt_ViewEmptyText">No items.</xsl:variable>
<table border="0" width="100%">
<tr>
<td class="ms-vb">
<xsl:value-of select="$dvt_ViewEmptyText" />
</td>
</tr>
</table>
</xsl:template>
Tabs:
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="dvt_RowCount" select="count($Rows)" />
<xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" />
<xsl:choose>
<xsl:when test="$dvt_IsEmpty">
<xsl:call-template name="dvt_1.empty" />
</xsl:when>
<xsl:otherwise>
<div id="tabs">
<xsl:call-template name="tabsList">
<xsl:with-param name="Rows" select="$Rows" />
</xsl:call-template>
<xsl:call-template name="tabsPanels">
<xsl:with-param name="Rows" select="$Rows" />
</xsl:call-template>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="tabsList">
<xsl:param name="Rows" />
<ul>
<xsl:for-each select="$Rows">
<li><a href="{concat('#tabs-',@ID)}"><xsl:value-of select="@Title" /></a></li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template name="tabsPanels">
<xsl:param name="Rows" />
<xsl:for-each select="$Rows">
<div id="{concat('tabs-',@ID)}">
<xsl:value-of select="@panelText" disable-output-escaping="yes" />
</div>
</xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.empty">
<xsl:variable name="dvt_ViewEmptyText">No items.</xsl:variable>
<table border="0" width="100%">
<tr>
<td class="ms-vb">
<xsl:value-of select="$dvt_ViewEmptyText" />
</td>
</tr>
</table>
</xsl:template>
|