1
lunaticalm
How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/3 1:57

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


I want an dropdown menu but sorted alphabetical by the title.
when i'm using this code p.x.
$mytree = new XoopsTree($xoopsDB->prefix("mytable_cat"),"cid","pid");
Then to display the dropdown menu this code p.x.
somefunction{
global $mytree
$mytree->makeMySelBox("title", "title", $cid);
}
The dropdown is not sorted in way that i like.
How can a sort the SelBox titles order by p.x. A,B,C ?
Please someone help me on this.
Thank you wery much.

2
cmagana
Re: How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/3 2:42

  • cmagana

  • Not too shy to talk

  • Posts: 131

  • Since: 2003/11/8


A,B or C must be the names of the fields of your table

3
wtravel
Re: How to ? XoopsTree - makeMySelBox ORDER by A

When you look at the function in class/xoopstree.php you see where you can set the order.
function makeMySelBox($title,$order="",$preset_id=0$none=0$sel_name=""$onchange=""$multiple=0)


If you want to order by field X ascending and then field Y descending, you could use the function like this:

$mytree->makeMySelBox("title""X ASC, Y DESC"$cid);

4
lunaticalm
Re: How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/4 12:57

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


Thank you wery much

5
lunaticalm
Re: How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/15 2:26

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


Ok I dit that byt again the dropdown is not sorted by title ASC.
I have this
$mytreee = new XoopsTree($xoopsDB->prefix("table_links"),"lid","title");

Then i wrote instead
$mytreee->makeMySelBox("title","title");
this
$mytreee->makeMySelBox("title","title ASC");
The dropdown is ok by title is not sorted by title ASC

also i have make change to the
function makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="", $multiple=0)
to
function makeMySelBox($title,$order="title ASC",$preset_id=0, $none=0, $sel_name="", $onchange="", $multiple=0)
but again the title of my dropdown is not sorted bu the title ASC.

Login

Who's Online

191 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits