FEATURES REQUEST :)
- optional column input text filter and still sortable (can be multiple columns having text filter)
- optional sticky/fixed table header style
- optional table with search bar and pagination ( either top pagination or bottom or both )
- I don't get it 🤔
- I would say that is outside the scope of this package. However, since it is quite a simple thing I will add it to the sortable.scss, it can't hurt
- Hehe
I believe the request for 1. is to allow a filter function for columns within the table, so that in addition to sorting by a column, the user can also filter the table by a column by typing in some search text. Any rows where the value in the filtered column doesn't match the filter text would then be hidden.
This would certainly be a useful feature though is perhaps taking things beyond the scope of a sortable table.
yes sir you got it right
Yeah, that would be a bit outside the scope of sortable.
....though a "filterable" solution shouldn't be rocket science. 🤔
It could work almost the same with an eventListener. If the table has the "filterable" class, a click on a table header could show an input. All items in that column that don't match the search string would be given a data-filtered=1, and then we could have a css-thingy
.filterable tbody tr:has(td[data-filtered="1"]) {
display: none;
}
It would be a bit tricky to get it to work side by side with sortable, but not incredibly so. Just a matter of either sorting or filtering, but hey, wait a minute, I don't have time for this!
So, unless you guys want to do it, I'll put it on my todo list 😉
A good start I think: https://github.com/tofsjonas/searchable!
Ooh, exciting! I will take a look at this shortly, thank you! Can searchable and sortable both be used on the same table at once?
Yes they can :)