Jump to content

Problem with sorting tables


Bueno93

Recommended Posts

Hey guys,

I'm struggeling with the following code, so I really need your help. I'd like to have the abilty to sort my results from searching the flightplan, which should be the schedule_results.tpl. So I tried to use the Tablesorter 2.0 jQuery plugin, that someone posted recently (see here:jQuery plugin:Tablesorter 2.0).

The required jquery-latest.js and jquery.tablesorter.js are located in www.mysite.com/www/lib/skins/crystal/js. The code, which is just a result from following the installing instructions, looks like this:

<script type="text/javascript" src="www.mysite.com/www/lib/skins/crystal/js/jquery-latest.js"></script> 
<script type="text/javascript" src="www.mysite.com/www/lib/skins/crystal/js/jquery.tablesorter.js">
$(document).ready(function() 
   { 
       $("#myTable").tablesorter(); 
   } 
); </script> 
<?php
if(!$allroutes)
{
   echo '<p align="center">No routes have been found!</p>';
   return;
}
?>



<table width="100%" id="myTable" class="tablesorter">
<tr>
   <th>Flug</th>
   <th>Startort</th>
   <th>Zielort</th>
   <th>Startzeit</th>
   <th>Flugzeit</th>
   <th>Flugzeug</th>
   <th>Buchen</th>
   </tr>
<tbody>

// I left the options out here!

?>
<tr>
   <td>
       <a href="<?php echo url('/schedules/details/'.$route->id);?>"><?php echo $route->code . $route->flightnum?></a>
       <?php
       # Note: this will only show if the above code to
       #    skip the schedule is commented out
       if($route->bidid != 0)
       {
           echo 'This route has been bid on';
       }
       ?>
   </td>
   <td><?php echo ''.$route->depicao.''?></td>
   <td><?php echo ''.$route->arricao.''?></td>
   <td><?php echo $route->deptime;?></td>
   <td><?php echo $route->deptime;?></td>
   <td><?php echo $route->aircraft; ?></td>
   <td><?php 
       # Don't allow overlapping bids and a bid exists
       if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0)
       {
       ?>
     <a id="<?php echo $route->id; ?>2" class="addbid" 
               href="<?php echo actionurl('/schedules/addbid');?>">Buchen</a>
     <?php
       }
       else
       {
           if(Auth::LoggedIn())
           {
            ?>
     <a id="<?php echo $route->id; ?>2" class="addbid" 
                   href="<?php echo url('/schedules/addbid');?>">Buchen</a>
     <?php             
           }
       }        
       ?>
       </td>
   </tr>
<?php
/* END OF ONE TABLE ROW */
}
?>
</tbody>
</table>
<hr>

Using this code, nothing happens. The table is just the same, like I had before.

I would really appreciate, if someone knows, what's wrong with the code, 'cause I really have no idea left.

Thank you

Kind Regards

Tim

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...