Finally, change this line (appears TWICE in source!):
$sql = "SELECT * FROM " . $this->dbtablename . " " . $additionalwhere . " ORDER BY " . $this->orderbyfield->dbfieldname . " " . $this->ascordesc;
to this:
$sql = "SELECT * FROM " . $this->dbtablename . " " . $additionalwhere . " ORDER BY " . $this->orderbyfields;// . " " . $this->ascordesc;
Now, if you want the old functionality, just use positive Sequence numbers. But, if you want multi-field sorting, specify these fields with negative sequence numbers. This will also force those fields to appear on the left, but that makes the most sense anyway...
Hope you can use this, I know I could :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You want sorting on multiple fields at the same time? Try this: In Table.php change this part:
var $orderbyfield;
to this:
var $orderbyfield;
var $orderbyfields;
And change this:
$this->orderbyfield = NULL;
to this:
$this->orderbyfield = NULL;
$this->orderbyfields = NULL;
Then change the whole if() block that start with this:
if (($this->fields[$count]->type != "id") && ($this->fields[$count]->dispintable == true) && (!$orderfound)) {
to this:
if (($this->fields[$count]->type != "id") && ($this->fields[$count]->dispintable == true)) {
if (!$orderfound) {
$this->orderbyfield = $this->fields[$count];
$this->orderbyfields = $this->fields[$count]->dbfieldname;
if ($this->fields[$count]->type == "date")
$this->ascordesc = "DESC";
else
$this->ascordesc = "ASC";
}
else {
if ($this->fields[$count]->sequence < 0)
$this->orderbyfield .= ", " . $this->fields[$count]->dbfieldname;
}
$orderfound = true;
}
Finally, change this line (appears TWICE in source!):
$sql = "SELECT * FROM " . $this->dbtablename . " " . $additionalwhere . " ORDER BY " . $this->orderbyfield->dbfieldname . " " . $this->ascordesc;
to this:
$sql = "SELECT * FROM " . $this->dbtablename . " " . $additionalwhere . " ORDER BY " . $this->orderbyfields;// . " " . $this->ascordesc;
Now, if you want the old functionality, just use positive Sequence numbers. But, if you want multi-field sorting, specify these fields with negative sequence numbers. This will also force those fields to appear on the left, but that makes the most sense anyway...
Hope you can use this, I know I could :)