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

Filter order when have list joins

Discussion in 'Community' started by jh, Aug 16, 2019.

  1. jh

    jh Member

    Level: Community
    Hi

    Ive got a list with a join, using various filters, all working fine.

    One element on the main list is a dbjoin from the other list and so the filter shows all the label values (and hence the FK value is the filter) - as expected. The field on the joined list is a text field where there are duplicate values expected (which is fine) and I want to use those values as the filter value (for example 'Unknown' is a value, which shows multiple times in the dbjoin filter field, but I only want the value to show once and use that as the filter).

    I have both showing in the filters at the moment and would like to move the joined filter up, but it only goes as high as the top of the joined field filters. So can I get this filter higher?

    Hope this makes sense.

    Kind Regards
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    If I'm understanding you correctly, then no, I don't think so. We order the filters as they appear within the group they are in on the form, and order the groups as they appear on the form. You can't split individual filters out from within their own group, for ordering purposes. Kind of the same way on the form itself. You can order the elements within the joined group, but can't move them into another group.

    -- hugh
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    PS ... you porbably could if you overrride the filter layout and manually place the filters, rather than using the default layout of just iterating through the array of filters ... but that would require some PHP knowledge.

    -- hugh
     
  4. jh

    jh Member

    Level: Community
    Hi

    Thanks for your response. What I wondered was if I could do a php events on list load to get the labels into a new field on the first list? I tried the following code but this brings back the keys not the labels (so what I want is fields where duplications are merged - if this makes sense - eg 'Unknown' becomes one filter choice)

    $myDb = JFactory::getDbo();
    $myQuery = $myDb->getQuery(true);
    $myQuery->clear()->update('object_table')->set('pattern_name_lab = pattern');
    $myDb->setQuery($myQuery);
    $myDb->execute();

    Can I get the labels somehow by adapting the code? Hope this makes sense.

    Kind Regards
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Hmmm, I don't think I'm understanding what you are trying to do.
     

Share This Page