flyalaska Posted September 19, 2016 Report Share Posted September 19, 2016 I am having trouble getting my pilot list to show in order. It jumps from ID 1 to 900. I want it to go in order by pilot ID not Pilot Number. Any ideas? Quote Link to comment Share on other sites More sharing options...
RuiMiguel Posted September 19, 2016 Report Share Posted September 19, 2016 try it add in core / app.config /* For PILOTS_ORDER_BY use p.[column_name] [ASC/DESC] */ Config::Set('PILOT_ORDER_BY', 'p.pilotid ASC'); Quote Link to comment Share on other sites More sharing options...
flyalaska Posted September 19, 2016 Author Report Share Posted September 19, 2016 Didnt make a difference Quote Link to comment Share on other sites More sharing options...
web541 Posted September 19, 2016 Report Share Posted September 19, 2016 try it add in core / app.config /* For PILOTS_ORDER_BY use p.[column_name] [ASC/DESC] */ Config::Set('PILOT_ORDER_BY', 'p.pilotid ASC'); This won't work because this is the sorting for the default schedules. flyalaska is using dataTables pagination (I think) which again overrides the sorting. There is probably something in the dataTables docs about sorting with this, but what I've done in the past is just a simple check, but it's annoying when you have to do it for multiple numbers. <?php // Check the length of the pilotid and make sure it's less than 4 characters long if(strlen($pilot->pilotid) < 4) { echo '0'.$pilot->pilotid; // put a zero before the pilotid } else { echo $pilot->pilotid; // just show the pilotid } ?> To not show the zero, you could maybe add a div to not echo the 0 onto the page with style="display:none;" or something. Have a mess around with the above and see if you can get it working. I do suggest looking into the dataTables docs as well and see if you ca find anything else. Quote Link to comment Share on other sites More sharing options...
RuiMiguel Posted September 19, 2016 Report Share Posted September 19, 2016 I also have the same problem in pireps_viewall.php Quote Link to comment Share on other sites More sharing options...
flyalaska Posted September 19, 2016 Author Report Share Posted September 19, 2016 (edited) It is an issue with data tables. I removed it and it works perfect. We dont start with a 0. We start with 100. The issue happened after we reached id 1000 bunched all the ids that start with a 1 first, Not in Pilots number. Edited September 19, 2016 by flyalaska Quote Link to comment Share on other sites More sharing options...
web541 Posted September 19, 2016 Report Share Posted September 19, 2016 It is an issue with data tables. I removed it and it works perfect. We dont start with a 0. We start with 100. The issue happened after we reached id 1000 bunched all the ids that start with a 1 first, Not in Pilots number. Yeah, that's what I'm saying. The above was meerly just an example of how to sort them (not ideal). Instead of 100 1000 200 etc. It would be 0100 0200 1000 But again, not ideal. Not sure how to fix this one. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted September 20, 2016 Author Report Share Posted September 20, 2016 Would changing the ID length do the trick?I have set to 4 now. Config::Set('PILOTID_LENGTH', 3); // The length of PID, including 0's 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.