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

Filters (Lists)

Discussion in 'Community' started by mariluzrm, Feb 24, 2021.

  1. mariluzrm

    mariluzrm Member

    Level: Community
    Hello.

    I have a complex list with several joins that I display in a form with several Tabs. To access it I use a simpler list because if I show the other one, as it has many joins it takes a long time to load. I need to be able to do filters (Advanced search or otherwise) on the simple list but using the fields from the complex list. It's possible? How can I do it?

    Thanks
     
  2. juuser

    juuser Well-Known Member

    Level: Community
    So you don't have the joins existing at all in your "simple form" or you have just set the joined list groups to "display=no" or similar?

    In the first case I cannot see any way to do this as the elements/fields simply do not exist in your list where you are making your search.
     
  3. mariluzrm

    mariluzrm Member

    Level: Community
    Ok, I understand then that it is impossible in this case.

    And with this:

    It will work? Where do I have to do this set?

    Thanks.
     
  4. juuser

    juuser Well-Known Member

    Level: Community
    In group setting "layout" tab there is an option called "Show in form/details". In your "simplified" form you can set some groups to "yes, but hidden" and should still be able to use it's elements in list "search all" field.
     
  5. mariluzrm

    mariluzrm Member

    Level: Community
    I only want the "simplified" form to appear in the list (and also to be able to filter), it would not be better then to put "Show in form / details" = NO?

    Then, the form that is shown from the list is the "complex form" and here I do show all the groups (but with a single record and this does not take long to load).

    That is, what it takes to load is the "complex list", that's why I have a "simplified list", but I need to be able to filter all the fields of the "complex list" in it. I don't know if I explain myself ...
     
    Last edited: Feb 24, 2021
  6. juuser

    juuser Well-Known Member

    Level: Community
    OK, then I misunderstood a bit.

    In this case hide the elements from list view which you do not need to show. If the list is "slow" you can set the option per every hidden element not to include in list query (Element settings -> List view Settings -> Include in list query = No)
     
  7. mariluzrm

    mariluzrm Member

    Level: Community
    It works perfectly. Many thanks!!!
     
  8. mariluzrm

    mariluzrm Member

    Level: Community
    Is it possible to do this for a set of elements or is it necessary do it for each element (that is, do it one by one)?

    Thanks!!
     
  9. juuser

    juuser Well-Known Member

    Level: Community
    Cannot think of any way to batch update this setting for several elements except changing this with database queries which is only recommended when you know 100% what you're doing.

    If the hidden elements are not e.g. calc elements calculated on the fly ("only calc on save" set to "no"), I doubt there will be significant gain in list loading time.

    You can make a test:
    1) check the page loading time in browser console before setting the elements to not include in list query.
    2) Then change the setting for a few elements and make the test again to see if there's any gain in page loading.

    On the other hand, if you have several repeat groups in this list, this could affect the loading time quite a lot.

    In this case you can make a copy of your list, remove the joins (repeat groups) from this list which you do not need to display in list view. And then in "reduced list" settings add a custom "add", "details" and "edit" link to refer to your "full" form.
     
  10. mariluzrm

    mariluzrm Member

    Level: Community
    But in this case the elements of repeat group don't appear in avanced search, true? That was my initial problem..

    (In localhost) It takes 20 seconds to load a two-column list (about 250 records), too slow. How can I speed up the load?
     
    Last edited: Feb 26, 2021
  11. juuser

    juuser Well-Known Member

    Level: Community
    I seem to have lost your original point by multitasking too much :) Yes, the last approach wouldn't work if you need to search those fields.

    20 seconds is definitely too much. Check for the missing indexes in these database tables and add if necessary.

    Also changing list filters from "dropdown" to "field" might help when the field has a lot of different values.
     
  12. mariluzrm

    mariluzrm Member

    Level: Community
    Please can you explain it to me? I am not clear what you mean. Change the type of those elements?

    Thanks
     
  13. juuser

    juuser Well-Known Member

    Level: Community
    No, not the element type. I mean the list filter type in element Filter settings.
     
  14. mariluzrm

    mariluzrm Member

    Level: Community
    Ok, I will try it.
    Another thing, I have seen in the wiki that it is possible also search by doing a form search and using the seach plugin as well. What are the differences between these and the advanced search of the lists? Are there other ways to search or filter? Thanks for everything!!!
     
  15. troester

    troester Well-Known Member Staff Member

    Level: Community
    A bit off topic to these last posts:

    Multiple list joins with repeat are going to create an exponentiell number of records, so be aware of enabling "Big selects" and setting memory limit high enough even if you only have the joins in your forms.

    What I have done in a list where you need several repeat groups in the form view but this would crash your "full" list view:

    create a MySql view to a repeat group table like

    select
    `person_repeat_f`.`parent_id` AS `parent_id`,
    group_concat(`person_repeat_f`.`notes` separator '<br>') AS `notes`
    from `person_repeat_f` group by `person_repeat_f`.`parent_id`

    Then in your "slim" list (without the joins to the repeat groups) add a join (id to parent_id, repeat=no) to this view.
    Now you can display and filter the "notes" in the slim list.
    For form/edit view add custom links to the "full" forms.
     
    juuser likes this.
  16. mariluzrm

    mariluzrm Member

    Level: Community
    Thank you!! I'll try it
     
  17. mariluzrm

    mariluzrm Member

    Level: Community
    But the views are not updateables. So what happens if new records are inserted?
     
  18. troester

    troester Well-Known Member Staff Member

    Level: Community
    This only for the list view in a "slim" list (a copy of the "full" list without joins to repeat groups), i.e only display and filtering.

    For form/edit view add custom links (in the "slim" list) to the "full" forms.
     
  19. mariluzrm

    mariluzrm Member

    Level: Community
    Ok, but if there are a lot of new records, won't the slim list be out of date?
     
  20. troester

    troester Well-Known Member Staff Member

    Level: Community
    You can have multiple Fabrik lists (created via list "Copy" or by linking a new list to an existing database table) on the same underlying database table, so it's always the identical records.
     

Share This Page