Theophilix / event-table-edit-old

Event Table Edit is a free table plugin for Joomla 3.x to create a responsive, editable table with CSV / XML import and export, and a simple appointment booking system function. Any help in the development is highly appreciated.
GNU General Public License v3.0
10 stars 6 forks source link

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

Closed Theophilix closed 5 years ago

Theophilix commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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

hofmar2 commented 5 years ago

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

Gruß Markus

Theophilix commented 5 years ago

Fixed in 4.7.3 version