Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Sorting a field's values using a different column?

phpMyEdit General     Sorting a field's values using a different column?
Odoslať novú tému   Odpovedať na tému    
 
futurity     Založený: 07.01.2009   Príspevky: 4  
Príspevok Zaslal: 2009-01-07 13:13
Návrat hore  Odpovedať s citátom     

I'm using a simple table lookup, but although I've tried many different methods I can't work out how to sort using the id number rather than the looked up name.

I currently have a field "end_month" that contains an index to the id field in the months table:

$opts['fdd']['end_month'] = array(
'name' => 'End month',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);

To display the month name rather than the id I use the following code:

$opts['fdd']['end_month']['values']['table'] = 'months';
$opts['fdd']['end_month']['values']['column'] = 'id';
$opts['fdd']['end_month']['values']['description'] = 'long_name'; // optional

However it sorts alphabetically on the month name, not on the id stored in the field. It make no difference if I set sort to false. The months and there iIDs are:

1, Jan
2, Feb
etc

But Apr (April) always appears first in the list.

Any help would be much appreciated,

Regards

Neil

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-01-07 14:17
Návrat hore  Odpovedať s citátom     

See the 'orderby' option under "Complex table lookup example" at http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html#AEN963

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov