1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Sort list by the value of a dropdown element

Discussion in 'Community' started by enrb, Jun 26, 2020.

  1. enrb

    enrb Member

    Level: Community
    Hi everyone, I have a list with several elements, I want to sort them alafabetically based on the value of a dropdown element. By choosing the dropdown element in Sort by, the list is sorted by id and not by value.
    How do I go about sorting the list by the value of the dropdown element?
     
  2. Nagtegaal

    Nagtegaal Member

    Level: Community
    Hi, with the dropdown from databasejoin you are storing the child id (value) in the parent database table and not the label.

    A possibility to still sort it on the label is to create a join between the lists. List->Data->Joins. Join the Element of the stored id to the id of the child list and then all elements of the child list will also appear in the parent list. You can hide what is not needed, but now you can sort on the label of the child id.
     

    Attached Files:

  3. enrb

    enrb Member

    Level: Community
    I didn't use the "databasejoin" element type, but I used the simple "dropdown" element type ...
     
  4. Nagtegaal

    Nagtegaal Member

    Level: Community
    Hi, sorry for the misunderstanding. When I set the (dropdown) element as Order By, in my case it does Order By on the dropdown element and not on the id. See screenshot
     

    Attached Files:

Share This Page