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

Select a record in a list

Discussion in 'Community' started by maramauri, Feb 11, 2019.

  1. maramauri

    maramauri New Member

    Level: Community
    Hello everybody,
    In a list I have to shows just the records with a date greater than current date.
    Can I use the field "pre-filter query" placed at the bottom of the pre filter tab?
    If yes can you suggest me please the right sintax to use?
    Thanks a lot for your help!
  2. lousyfool

    lousyfool Active Member

    Level: Community
    Very simple:


    ...assuming the date/time in your DB is stored in UTC. Otherwise use NOW() instead of UTC_TIMESTAMP().
  3. lousyfool

    lousyfool Active Member

    Level: Community
  4. maramauri

    maramauri New Member

    Level: Community
    Hi lousyfool,
    First Sorry for my late reply and second thanks for your help!
    I used your suggestion and I confirm that it works !! but I have not considered (my mistake !!) that by inserting this filter I can not see anymore the previous dates set by the filter on the frontend (date picker) because the prefilter prevails
    Please do you have another suggestion to help me with this further problem?
    thanks a lot.
  5. lousyfool

    lousyfool Active Member

    Level: Community
    Well, as the name says, pre-filters are at work before a list is getting displayed. Thought that's what you wanted.

    If you want to filter "temporarily", you can set up and utilise the list filters (note, no "pre"): http://fabrikar.com/forums/index.php?wiki/list-filters/
    You'll need to also configure the elements you want to filter by, I guess in your case at least the date element in question: http://fabrikar.com/forums/index.php?wiki/elements/#filters
    As it says in the Wiki, for the date element you best want to choose "range" as filter type. Then, when using the filter, you can specify "from" and "to" dates.
  6. maramauri

    maramauri New Member

    Level: Community
    Hi lousyfool, thanks again for your help.
    yes, you are right, you thought correctly but I explained wrong!! Certainly I could understand the meaning of "pre filters" by myself and understand that was not what I needed!!
    Now, as you suggested, I set the date as a search filter, I chose "range" as a filter type and now I can choose the dates by searching "from" date "to" date selecting by two date picker
    This is really OK, but now can I set the filter that when I load the list the date picker "from" is set automatically on today's date and the date picker "a" is set to "today + 7 days"?
    I would like this to avoid to make the choose every time I open or refresh the list and to avoid to load a great number of record.
    Thanks for your attention
  7. lousyfool

    lousyfool Active Member

    Level: Community
    I don't understand...
    First you ask for a pre-filter. But then you say it's not what you want.
    So, you get a list filter. But now you say it's not what you want, either.
    Hmmm, what do you want? You can't have your cake and eat it, too... :p

    Reads like you want the list filtered for records in between "now" and "now +7 days", so it works like a pre-filter on pageload, but still have the option of resetting or changing this in the same list anytime you want?

    If it weren't a date/time range incl "now", I'd say use URL filtering (where you query fields and values in the URL). Don't think that'll work in this case, though.

    You may be able to achieve it with some Javascript, like pre-populating the filter fields, etc etc.

    However, the simplest I can think of:
    Use a pre-filter, configured to display those "in between now and +7 days" records. Eventually make that a copy of the main list, eventually (if you use both main and filtered lists often) make it two menu items. Or make the first list (= used most often) the main menu item, and the second list a "hidden" menu item but put a link to it into the intro of the first list.
  8. maramauri

    maramauri New Member

    Level: Community
    I'm really sorry for the confusing questions, maybe I'm the worst forum user!:(:(
    Thank you very much for your help and patience !!:)
    Anyway, I understand your last suggestion, I think it's the most convenient way and I'll try it.
    Thanks a lot lousyfool for your kind help.

Share This Page