vendredi 20 mars 2015

Select one row in an xsl grid using a radio button and storing data to a variable


I am using an xsl sheet that has a data grid. I have a radio button at the end of each row. The user is only allowed to select one radio for the entire grid. So if there are 50 rows of data, the user can only select one row. This will then take Field 1 and add it to the value of the variable below name capturedData. My question is how can I have the ui only allow one selected radio button to occur and take Field 1 and add it to the variable using jquery?



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR" xmlns:java="http://ift.tt/Y48VNG" exclude-result-prefixes="java">
<xsl:output method="html" media-type="text/html" encoding="UTF-8" />

<xsl:template match="/">

<table class="config-table table" id="field-table">
<thead>
<tr>
<th>Field1</th>
<th>Field2</th>
<th>Field3</th>
<th>Field4</th>
<th>Field5</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="//Row">
<xsl:sort select="Field2"/>
<xsl:sort select="Field1"/>
<tr><xsl:attribute name="id"><xsl:value-of select="Field1"/></xsl:attribute>
<xsl:if test="position() mod 2 = 0"><xsl:attribute name="class">alt</xsl:attribute></xsl:if>
<td><xsl:attribute name="name">Field1</xsl:attribute><xsl:value-of select="Field1"/></td>
<td><xsl:attribute name="name">Field2</xsl:attribute><xsl:value-of select="Field2"/></td>
<td><xsl:attribute name="name">Field3</xsl:attribute><xsl:value-of select="Field3"/></td>
<td><xsl:attribute name="name">Field4</xsl:attribute><xsl:value-of select="Field4"/></td>
<td><input type="radio" id="selectField" value=""></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<script>

var capturedData;

</script>
</xsl:template>
</xsl:stylesheet>




Aucun commentaire:

Enregistrer un commentaire