This topic is locked

Change Default List Order

8/8/2008 10:29:09 PM
PHPRunner General questions
T
tyguy author

Hi guys,
I have searched and searched with no avail. How do I change the default list order.... currently my list page has the order by ID and starts at 1 and accends. How can I change the code so when you go to the list page, the last entries were posted?
Thank you. I am sure it is a simple change to a few characters... I just don't know how.
Thanks!

T
thesofa 8/9/2008

Edit SQL query page, query designer tab, chose the field you want it ordered by, use the sort order and sort type field boxes in the grid in the lower half of the screen.

HTH
OR
just add the code to the bottom of the SQL tab

like

ORDER BY <tablename>.<fieldname> DESC



or ASC

T
tyguy author 8/9/2008

Edit SQL query page, query designer tab, chose the field you want it ordered by, use the sort order and sort type field boxes in the grid in the lower half of the screen.

HTH
OR
just add the code to the bottom of the SQL tab

like

ORDER BY <tablename>.<fieldname> DESC



or ASC


Thank you... is there a way to do it without going back into phprunner... I have made many changes to templates and do not want to rebuild the whole thing.. if possible. Thank you!

T
thesofa 8/9/2008

just click on the column head in the list page to sort by that column

T
tyguy author 8/9/2008

just click on the column head in the list page to sort by that column


Thank you, however I know how to do it through an internet browser, but I am looking for how to to change the code so it loads the list decending by default, rather than ascending.

T
thesofa 8/9/2008

just look in the <tablename>_list.php file for a section like this

// process session variables

// order by

$strOrderBy="";

$order_ind=-1;
$smarty->assign("order_dir_id_det","a");

$smarty->assign("order_dir_datestamp","a");

$smarty->assign("order_dir_pup_id","a");

$smarty->assign("order_dir_reason","a");

$smarty->assign("order_dir_department","a");

$smarty->assign("order_dir_day4det","a");

$smarty->assign("order_dir_done","a");

$smarty->assign("order_dir_comment","a");

$smarty->assign("order_dir_Teacher","a");


if the letter in quotes after the field name is "a", the search order is ascending, change it to anything else to make it descending.

Change it in the project too so you can keep the change when you next re-compile!

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=32013&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

T
tyguy author 8/9/2008

just look in the <tablename>_list.php file for a section like this

// process session variables

// order by

$strOrderBy="";

$order_ind=-1;
$smarty->assign("order_dir_id_det","a");

$smarty->assign("order_dir_datestamp","a");

$smarty->assign("order_dir_pup_id","a");

$smarty->assign("order_dir_reason","a");

$smarty->assign("order_dir_department","a");

$smarty->assign("order_dir_day4det","a");

$smarty->assign("order_dir_done","a");

$smarty->assign("order_dir_comment","a");

$smarty->assign("order_dir_Teacher","a");


if the letter in quotes after the field name is "a", the search order is ascending, change it to anything else to make it descending.
Perfect... just what I was looking for!!!!

Change it in the project too so you can keep the change when you next re-compile!

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=32014&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />