-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
Feature - table-sortable header styles #13804
Comments
Ok, so since this has been tagged I'll put together the PR. |
(For the record, labels and milestones don't indicate approval.) |
Is there anything we can do here to integrate with existing plugins? No one has really standardized these interactions and styles. I'd rather not create dummy code for something that's not interactive, and I don't think we'll get into the table sorting realm within the core. |
I'd say this feature would be similar to the pagination and pagers that bootstrap has available. Most people have server side stuff to do the grunt work and render the proper markup. Without having a dummy code example there is nothing for third parties to latch onto. But with the case of pagination because there is a bootstrap standard php frameworks like laravel output compatible markup by default.
|
We had support for Tablesorter in v1, why was that dropped? It still seems to be maintained. [For reference: Docs and Less of v1] |
For me tablesorter wouldn't really work. At a glacé of the readme it only works with the data on the page. So if I have a large paginated data set then I need Ajax and server side sorting. I can see why the additional js dependency may have been dropped from bootstrap.
|
If you've got specific ideas, I'd be interested in hearing some details on what you'd want implemented. I'm open to seeing if we can standardize and offer something. To be clear though, I'm still not sold it's something we need to address in the core yet. |
I think we should have a Then for the "active" column that is being sorted there should be another selector added to indicate the direction. This selector would change the glyphicon to be Implementation of the sorting can then be handled either on the backend or with a JS plugin. |
Not all columns might be sortable, so I think putting the class on the |
Regarding specific implementation details:
It sounds like not a lot of code, but I'm really hesitant to do a half-implemented feature. Everything else we provide is mostly good to go in a lot of use cases. This is the one thing that requires a lot more. |
I totally understand where you are coming from @mdo This wouldn't be solving a huge problem. But I can definitely see it being used by people. And for those who don't need it can exclude it via the customiser. |
Going to close this out and punt on it. I'm open to seeing a PR if it's lightweight enough, but I'm not seeing a clear picture of how this benefits everyone without providing the JS solution to complete it. <3 |
@mdo - I don't understand your reluctance to implement some version of this feature. I for one would like very much to have it. And when you closed #2327 there were all sorts of upvotes from others who were interested. This functionality is both common and old in things like Excel. End users who deal with tabular data will love it and a lot of devs want to give it to them. If you can't do the JS part, fine, explain that in the readme or whatever, but give us the consistent styling to make it look good. |
@MalikRumi We remain extremely unlikely to include JS for this, as it's complicated enough to be a project in its own right (i.e. TableSorter etc.), and vendoring it would cause bloat for the many folks who don't need that feature. |
I have found this old issue #2327 which I assume is talking about removed bootstrap 2 styles and has been closed. However I am about to implement a feature in my project that I think would be useful to have in the bootstrap core. Sortable table headers.
I feel as thought the implementation of the sorting should be left to the consumer, via either backend sorting JS sorting ect. But that bootstrap should include a
table-sort-up
class or similar that would be applied to a table cell in thethead
I feel like sortable tables are common, and that one of bootstraps nicest features are standard class names that everyone understands. Leaving the implementation of this leads to variances from project to project.
I'd submit a PR for this. Or I'd be equally fine with this feature being rejected. Just wanted to raise the issue.
The text was updated successfully, but these errors were encountered: