Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend / Backend: Enable sorting when the browser loads the table #128

Closed
Theophilix opened this issue Sep 19, 2018 · 4 comments
Closed

Comments

@Theophilix
Copy link
Owner

We should add an option to the backend called "Enable automatic sorting" [ger: "Automatische Sortierung aktivieren"] with yes / no [ger: ja / nein]. If the user chooses "yes", he sees a dropdown menu (title: "sort by" [ger: "Sortieren nach") and can choose the name of the table's columns (column1, column2 etc.).

The code should be like:
"After each editing action - if automatic sorting is on, then sort by selected column and save this as new order to mysql."
We could reload the table completely after each editing action BUT: this might slow down the table's speed extremely, if several users edit a table.

@hofmar2
Copy link

hofmar2 commented Sep 28, 2018

Hallo Theophilix,

hast Du so spontan eine Idee in welcher PHP-Datei ich die Abfrage finde? Habe da jetzt schon mehrere Stunden gesucht aber irgendwie ohne Erfolg.

Also in irgendeiner Datei muss ja eine Abfrage stehen wie z.B.

SELECT CONCAT(\'head_\', a.id) AS head, datatype FROM #__eventtableedit_heads AS a' .
					' WHERE a.table_id = ' . $this->id .
					' ORDER BY a.ordering ASC' .

Und da könnte ich dann ja das "ORDER BY" ändern oder?

Gruß
Markus

@Theophilix
Copy link
Owner Author

Müsste event-table-edit\site\models\etetable.php, Zeile 335 bzw. 384 sein.

@hofmar2
Copy link

hofmar2 commented Oct 1, 2018

Super funktioniert. :-)
Habe in der Funktion "getRowsQuery()"
if ($tid == '14') { $orderCol = 'head_62'; $orderDirn = 'ASC'; } $query->order($orderCol.' '.$orderDirn);
eingefügt.

Gruß
Markus

@Theophilix
Copy link
Owner Author

Fixed in 4.7.3 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants