7 Replies Latest reply: Jul 10, 2012 12:13 AM by Ben Pleysier RSS

    Need help with hyperlinks in repeat region

    deeciple

      Hi All,

       

      I don't know if this is the best way to do this but it's working, sort of.  I created a repeat region from a table row that displays master records from a recordset and made these into hyperlinks to link to the detail info for each master record.

       

      I wanted to add the ability to sort the repeat region so I wrapped this in a spry data set.  My problem is that the sorting is not working properly.  When I click on a column header, the records are re-ordered but not properly.  I suspect that it is sorting on the code that creates my hyperlinks but that is just a guess.  I tried making the table row be the link but this prevents the data set from displaying any records.  I am stumped.  Any help is appreciated.  Here is the code for my repeat region and data set:

       

      [CODE]

         <table width="100%" border="0" id="results">

           <tr align="left">

          <th scope="col">Airdate:</th>

          <th scope="col">Event type:</th>

          <th scope="col">Detail:</th>

          <th scope="col">Variance:</th>

           </tr>

            <?php do { ?>

              <tr>

            <td><a href="on-air-results-detailed.php?tblOnAirActivityID=<?php echo $row_rstOnAirActivity['tblOnAirActivityID']; ?>"><?php echo $row_rstOnAirActivity['Airdate']; ?></a></td>

            <td><a href="on-air-results-detailed.php?tblOnAirActivityID=<?php echo $row_rstOnAirActivity['tblOnAirActivityID']; ?>"><?php echo $row_rstOnAirActivity['DiscrepType']; ?></a></td>

            <td><a href="on-air-results-detailed.php?tblOnAirActivityID=<?php echo $row_rstOnAirActivity['tblOnAirActivityID']; ?>"><?php echo $row_rstOnAirActivity['DiscrepDetail']; ?></a></td>

            <td><a href="on-air-results-detailed.php?tblOnAirActivityID=<?php echo $row_rstOnAirActivity['tblOnAirActivityID']; ?>"><em><span id="AirAffected">

               <?php if (!(strcmp($row_rstOnAirActivity['OnAirVariance'],-1))) {echo "Air affected";} ?>

                  </span></em></a></td>

          </tr>

          <?php } while ($row_rstOnAirActivity = mysql_fetch_assoc($rstOnAirActivity)); ?>

         </table>

         <div class="results" spry:region="ds1">

           <table width="100%" border="1" align="left">

          <tr>

            <th width="24%" align="left" spry:sort="Airdate:">Airdate:</th>

            <th width="25%" align="left" spry:sort="Event_type:">Event type:</th>

            <th width="23%" align="left" spry:sort="Detail:">Detail:</th>

            <th width="28%" align="center" spry:sort="Variance:">Air Affected:</th>

          </tr>

          <tr spry:repeat="ds1" spry:setrow="ds1" spry:odd="oddRow" spry:even="evenRow" spry:hover="hoverRow" spry:select="selectRow">

            <td>{Airdate:}</td>

            <td>{Event_type:}</td>

            <td>{Detail:}</td>

            <td align="center">{Variance:}</td>

          </tr>

           </table>

                </div>

      [/CODE]