flyalaska Posted February 12, 2013 Report Share Posted February 12, 2013 I am having a little trouble getting my hub roster to paginate. Here is the hub page in question - http://www.flyaka.com/index.php/Anchorage I have no problem paginating my other tables. This is the hub roster code: <!-- Hub Roster --> <div class="box"> <?php $pilots = PilotData::getAllPilotsByHub('PANC'); ?> <?php if(!$pilots) { echo 'There are no pilots in that hub, so there must be at least one pilot so the hub can run.'; return; } ?> <table id="mytable"width="100%" border="0" cellspacing="0" cellpadding="0" class="aka_table"> <tr> <tr> <th width="112"><div align="center"><u>Pilot ID</u></div></th> <th width="345"><u>Pilot Name</u></th> <th width="210"><u>Rank</u></th> <th width="170"><u>Hours</u></th> <th width="190"><u>Flights</u></th> </tr> <?php foreach ($pilots as $pilot) { ?> <tr> <td align="left"><div align="center"><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a></div></td> <td><div align="center"><?php echo $pilot->firstname.' '.$pilot->lastname?></div></td> <td><div align="center"><?php echo $pilot->rank;?></div></td> <td><div align="center"><?php echo $pilot->totalhours; ?></div></td> <td><div align="center"><?php echo $pilot->totalflights; ?></div></td> </tr> <?php } ?> </table> <script type="text/javascript"> $(document).ready(function() { $('#mytable').dataTable( { "sPaginationType": "full_numbers" } ); } ); </script> </div> <div class="clear"></div> <!-- Hub Roster --> Any help would be appreciated Quote Link to comment Share on other sites More sharing options...
Strider Posted February 12, 2013 Report Share Posted February 12, 2013 YOu could try using the system I have for my roster. There is a tutorial on how to set it up on the forms, search datatables. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 12, 2013 Author Report Share Posted February 12, 2013 What am I searching for, Keywords? Quote Link to comment Share on other sites More sharing options...
Strider Posted February 12, 2013 Report Share Posted February 12, 2013 http://forum.phpvms.net/topic/5342-to-get-the-pagination-for-the-schedules-to-work/page__hl__datatables there you go Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 12, 2013 Author Report Share Posted February 12, 2013 That is the same exact one I am using. I have it on all my table, Pilot Roster, PIREPS, Downloads, Schedules, etc. Just wont work on the Hub Roster. Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 Try the js script above the table? Maybe it can't see it. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 13, 2013 Author Report Share Posted February 13, 2013 That didn't work either! Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 Try changing the #mytable to .mytable. also try removing the second class, just cut it and paste it somewhere else for now, so you can put it back in, if it isn't the problem. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 13, 2013 Author Report Share Posted February 13, 2013 Didn't work either. This makes no sense, as it works on every other table. Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 You seem to have a stray <tr> try removing that, also try putting the header part of the table in <thead></thead> and the body part in <tbody></tbody>. Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 By the way, where did you get the hub module from? Or did you make it yourself? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 13, 2013 Author Report Share Posted February 13, 2013 I made it myself Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 Ah, anyway, see if that stray <tr> at the top of the table will do anything. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 13, 2013 Author Report Share Posted February 13, 2013 It didn't Quote Link to comment Share on other sites More sharing options...
Strider Posted February 13, 2013 Report Share Posted February 13, 2013 Only thing I can think of, it is not reading the JS file. Also try commenting out the 1.4.2 jquery file and replace it with: <script type="[url=""]text/javascript[/url]" src="[url="view-source:http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"]http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js[/url]"></script> <script type="[url=""]text/javascript[/url]" src="[url="view-source:http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"]http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js[/url]"></script> Quote Link to comment Share on other sites More sharing options...
Strider Posted February 25, 2013 Report Share Posted February 25, 2013 I see that it has been fixed, what was the problem and how did you fix it? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 25, 2013 Author Report Share Posted February 25, 2013 <thead></thead> and the body part in <tbody></tbody>. was eventually the issue. Took crack at it the next day and that fixed it. Quote Link to comment Share on other sites More sharing options...
Strider Posted February 25, 2013 Report Share Posted February 25, 2013 Ah thought so. Some code can be annoying with the way it wants things laid out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.