× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

GroupSelect Order

  • jamesrose01.gmail
  • Offline
More
8 years 8 months ago #3523 by jamesrose01.gmail
GroupSelect Order was created by jamesrose01.gmail
Is there a way to change the order of GroupSelect inputs?
On my SQL table I use "Set", and I want the order to always be as per my SQL table input, not alphabetical.

Interestingly it has worked on "Tempo", but not the others. Despite the SQL setup being identical.

This message has attachments images.
Please log in or register to see it.

Please Log in to join the conversation.

More
8 years 7 months ago - 8 years 7 months ago #3540 by Dirk
Replied by Dirk on topic GroupSelect Order
JooDB sorts the values in the groupselect fields alphabetically ascending

function getColumnVals in the catalog model
$query = "SELECT count(distinct(`".$this->_joobase->fid."`)) AS count,a.`".$column."` AS value, '' AS delimeter FROM `".$this->_joobase->table."` AS a ".$cw." GROUP BY a.`".$column."` ORDER BY a.`".$column."` ASC";
$values = $this->_getList($query);

But you want the SET-List from your column.
If you replace these two lines by the following statement it should do the trick.
if (!empty($type[1])) {
	$values = (!empty($type[1])) ? preg_split("/,/",str_replace(array(")","'"),"",$type[1])) : null;
} else {	
	$query = "SELECT count(distinct(`".$this->_joobase->fid."`)) AS count,a.`".$column."` AS value, '' AS delimeter FROM `"
		.$this->_joobase->table."` AS a ".$cw." GROUP BY a.`".$column."` ORDER BY a.`".$column."` ASC";
	$values = $this->_getList($query);
}
Last edit: 8 years 7 months ago by Dirk.

Please Log in to join the conversation.

  • jamesrose01.gmail
  • Offline
More
8 years 7 months ago - 8 years 7 months ago #3544 by jamesrose01.gmail
Replied by jamesrose01.gmail on topic GroupSelect Order
Thank you... unfortunately it just emptied out all of the groupselect boxes (see attached)

James
Last edit: 8 years 7 months ago by jamesrose01.gmail.

Please Log in to join the conversation.

Moderators: Dirkjoest