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

Comments

Projects
None yet
2 participants
@Theophilix
Copy link
Owner

Theophilix commented Sep 19, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Owner Author

Theophilix commented Sep 28, 2018

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

@hofmar2

This comment has been minimized.

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

This comment has been minimized.

Copy link
Owner Author

Theophilix commented Nov 1, 2018

Fixed in 4.7.3 version

@Theophilix Theophilix closed this Nov 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.