Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

sort order in visformsdata.php for list/getDetai

More
10 years 6 months ago #577 by Schuetze
Hi,
i want to sort the output of one visform in frontend.
For the selection i found in visformsdata.php the function getDetail().
I try to add "order by.." but the output is still the same.
I think my practical experience of php/SQL is not very well so i didn't find the mistake.

original:
$query = ' SELECT * FROM #__visforms_'.$this->_id.
' WHERE id = '.$id;

new, test:
$query = ' SELECT * FROM #__visforms_'.$this->_id.' WHERE id = '.$id. ' order by F4 asc';

Could someone please assist?

Thanks a lot

More
10 years 6 months ago #579 by Administrator AV
Replied by Administrator AV on topic sort order in visformsdata.php for list/getDetai
Hi Schuetze,

the getDetail function is the wrong place. It does (as the name says) get the details of one recordset (to display them when you enable the "display details" parameter in form.

If you want to use another field than the "id"-Field as a default to sort the dataview (list) in frontend and you change the components/com_visforms/models/visformsdata.php you will not be able to use more than that one form (because fieldnames are unique in visforms and you have only that one form with the field which you going to write into the php file hard coded).

If that is ok for you try to change the function populateState in the same file.

Replace
Code:
parent::populateState('a.id', 'asc');

with
Code:
parent::populateState('a.F4', 'asc');

(Assuming F4 is the field you want to use) that will solve your problem.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: Schuetze

More
10 years 6 months ago #580 by Schuetze
Thanks a lot.
You made my day. :-)

More
10 years 6 months ago #581 by Administrator AV
Replied by Administrator AV on topic sort order in visformsdata.php for list/getDetai
You're wellcome!

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
9 years 7 months ago #1505 by Algaze

Administrator wrote: the getDetail function is the wrong place. It does (as the name says) get the details of one recordset (to display them when you enable the "display details" parameter in form.

If you want to use another field than the "id"-Field as a default to sort the dataview (list) in frontend and you change the components/com_visforms/models/visformsdata.php you will not be able to use more than that one form (because fieldnames are unique in visforms and you have only that one form with the field which you going to write into the php file hard coded).
If that is ok for you try to change the function populateState in the same file.
Replace

Code:
parent::populateState('a.id', 'asc');
with
Code:
parent::populateState('a.F4', 'asc');
(Assuming F4 is the field you want to use) that will solve your problem.


I saw this and was hoping to change the sort order of a.id from 'asc' to 'desc' but it looks as if this line is missing from the latest update, version 3.4.0, is there another place to make this change in that version?

Thanks,

Louis

More
9 years 7 months ago #1510 by Administrator AV
Replied by Administrator AV on topic sort order in visformsdata.php for list/getDetai
Hi,

I made this menu item options.
You can now set the sort order field and the sort direction for each menu item (tab: Form Data Display Options)
So no code changes required any more :)

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum