q-table filtering



  • Hello all,
    I’m looking for a while to find some information about using filtering in a q-table. I’ve simply have a column with a boolean and I want to display only the lines which have the boolean set to true or set to false.
    The online documentation describes the filtering with “filter” and “filter-method” but the example says “see source-code” but there is no example with this topic.
    Anybody with some information will be welcome.
    Regards
    Francis



  • You should give the filter-method a method that filters on what you want to filter on using whatever your data is. It’s that simple. 😄

    If you put together a codepen, I’ll show you.

    Scott



  • Hi Scott,
    I’ve set a codepen at https://codepen.io/fcereja/pen/NWqVXXY do you have access to it with this URL ?
    The two toggles set the filter conditions, how to make the link with the q-table ?



  • @fcereja - This seems to be working.

    https://codepen.io/smolinari/pen/ZEGNPOK?editors=1010

    First thing, it wouldn’t have worked with q-options-group because you need to toggle the one option off, when the other one is on.

    Second, you didn’t even really try to solve the problem, did you? 😄

    At any rate. Problem solved.

    Scott



  • @s-molinari - Effectively it works well, thank you very much for your help.
    After reading your example, it seems quite evident. Regarding the toggles, when both are active, the table is simply not filtered.
    I really tried to solve the problem but I didn’t understand how to apply the filtering.

    I gess thet a little example in the documentation will help newbies.

    Have a nice week-end
    Francis



  • Unfortunately, there are so many things you can do with QTable (and many other components). I’m in three different community conversations at this moment about how to do things additionally to the standard QTable functionality. What we need is a way to capture the examples people come up with (like me) and offer them as extra examples to discover in the docs. We’re working on that idea slowly but surely. 🙂

    Scott



  • This post is deleted!

Log in to reply