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]
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
Hi Gramps,
I really wish I could upload the site but I truly can't. I can post any of the code you need to help me troubleshoot.
I do appreciate any suggestions you have for me as I am just learning. To answer your question, yes, that is what the column type declarations looked like.
Kind regards,
Ken
North America
Europe, Middle East and Africa
Asia Pacific