Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURES REQUEST :) #76

Open
razorkyle opened this issue Jul 19, 2024 · 4 comments
Open

FEATURES REQUEST :) #76

razorkyle opened this issue Jul 19, 2024 · 4 comments

Comments

@razorkyle
Copy link

razorkyle commented Jul 19, 2024

  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 )
@tofsjonas
Copy link
Owner

  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

@AdamDawes
Copy link

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.

@razorkyle
Copy link
Author

yes sir you got it right

@tofsjonas
Copy link
Owner

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 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants