payment-request icon indicating copy to clipboard operation
payment-request copied to clipboard

FEATURES REQUEST :)

Open razorkyle opened this issue 1 year ago • 1 comments

  1. optional column input text filter and still sortable (can be multiple columns having text filter)
  2. optional sticky/fixed table header style
  3. optional table with search bar and pagination ( either top pagination or bottom or both )

razorkyle avatar Jul 19 '24 11:07 razorkyle

  1. I don't get it 🤔
  2. 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
  3. Hehe

tofsjonas avatar Jul 24 '24 14:07 tofsjonas

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.

AdamDawes avatar Nov 15 '24 15:11 AdamDawes

yes sir you got it right

razorkyle avatar Nov 16 '24 08:11 razorkyle

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 😉

tofsjonas avatar Nov 17 '24 13:11 tofsjonas

A good start I think: https://github.com/tofsjonas/searchable!

tofsjonas avatar Oct 26 '25 01:10 tofsjonas

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?

AdamDawes avatar Oct 26 '25 06:10 AdamDawes

Yes they can :)

tofsjonas avatar Oct 26 '25 13:10 tofsjonas