Skip navigation
deeciple
Currently Being Moderated

Need help with hyperlinks in repeat region

Jul 9, 2012 10:56 AM

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]

 
Replies
  • Currently Being Moderated
    Jul 9, 2012 11:05 AM   in reply to deeciple

    Please supply a link to your site.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 9, 2012 11:20 AM   in reply to deeciple

    In that case we shall start a guessing game.

     

    Q1. Have you set the column type to html?

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 9, 2012 6:46 PM   in reply to deeciple

    Ken,

     

    I hope you realise that this is going to take a long while. I have got the time, but it's your project and the best way to get help in a case like this is to upload the site (to a temporary location) and supply a link to the site.

     

    In the meantime

    Q2. Did the column type declaration look like the following?

    ds1.setColumnType("Airdate:", "html");

    ds1.setColumnType("Event_type:", "html");

    ds1.setColumnType("Detail:", "html");

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 10, 2012 12:13 AM   in reply to deeciple

    Please post the data table containing about 5 rows of data, i.e. no PHP scripts.

     

    Gramps

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points