antoniandre / wave-ui

A UI framework for Vue.js 3 (and 2) with only the bright side. ☀️
https://antoniandre.github.io/wave-ui
MIT License
549 stars 40 forks source link

Async/backend table filtering #104

Open dflock opened 1 year ago

dflock commented 1 year ago

Thanks for your hard work on this great UI framework! The support for async sorting for the table component is great - allowing backend sorting. It seems that there's no support currently for async filtering, to allow the backend to do the filtering? Something similar to the async sorting for filtering would be a great addition!

iamgabrielsoft commented 1 year ago

You have an idea of any UI framework with this feature?

dflock commented 1 year ago

Yes, off the top of my head, PrimeVue, Naive UI & Quasar both support this on their data table components.

antoniandre commented 1 year ago

Hi @dflock, thanks for your feedback and request. I've been willing to answer you earlier but wanted to take a closer look before I do. I am not sure I understand the purpose of having a backend filtering integrated in the table. Having a frontend filter function is a nice thing for fast instant sorting of the same table rows already loaded. But if you sort the rows from a filter box outside of the table and it does a query to the backend then gets different rows to display in the table, why would you even need to pass the filter function to the w-table component? If it is just to have the loading bar, there is already a loading prop. It seems useless to me if everything is external, but maybe I need to see your UI to understand it :)

iamgabrielsoft commented 1 year ago

@antoniandre those it mean your not moving further with the idea?

antoniandre commented 1 year ago

I will if I am convinced of the added value - I just don’t see it right now but I am open to view your use case. I could be missing something. for now the same feature is completely possible and not complicated from outside the w-table, using the filter example of the w-table documentation, you just need to call your backend and the rows received become the table items. While loading you can even use the loading prop. 🤷‍♂️

DerrikMilligan commented 6 months ago

You can still do back end filtering. Just hook into the event for ordering and have your filters pull new data to be rendered in the table.

I'm currently using the w-table component with filters that connect to the backend. It's not something that is fully managed by the w-table, but you can achieve something similar using the fetch method if you want to try and use the w-table for everything.