-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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/better table options #5018
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely excellent. I have two microscopically tiny points that stylistically, I'd like to see change. But if you completely ignored me it wouldn't bother me in the slightest, as they are extraordinarily simple changes.
|
||
var $table = $('.snipe-table'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this bit can be cleaned up - the only place you reference $table
is within buildTable()
, the only thing you run in your DOM=ready function is buildTable
- you should be able to wrap all that together into the body of the DOM-ready function instead.
|
||
@if (!isset($simple_view)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see this as something like -
{
/* ... */
showMultiSort: {{ !isset($imple_view) && isset($multiSort) }}
}
Because I get weird feelings when I see lots of conditional stuff in a view that dynamically changes javascript. It just freaks me out and it hard to mentally parse and map between multiple different languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not even sure that we use that option anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Hi all,
I've spent the better part of the last 30 hours going through all of our bootstrap tables and beating them up a bit.
What's In This PR
bootstrap-tables.blade.php
is cleaner now -noneless of that awful conditional PHP logic. Switching to use data attributes took FOREVER, but that table partial is so much cleaner now, and less magical.Specifically, this....
Fixes a LOOOOONG time bug where exports would download twice, and wouldn't have a file extension or would be called just "untitled". This is a huge win, as far as I'm concerned. It's been a thorn in my side issue for years.
Basically every table we have now has the ability to export it (yay!). And every export has a USEFUL and MEANINGFUL name. OMG!
Fixes a NEW issue that I think was a newly introduced bug with a later version of the bootstrap tables cookie extension (Table Column Cookies are set to expire on browser close #5014) where the expiration was limited to the browser session, so users had to re-select their columns every time. Ugh. I'm still trying to optimize this by re-using cookie names, but it doesn't seem to preserve that state between different sections (or I'm doing it wrong. Very possible. I'm quite tired.)
A few notes....
A few of the BS tables that are still using client-side tables will eventually need to be switched over to use the API.
The Reports section is well and truly fucked, and I'm not even sure that it makes sense anymore, since the same issue that prevents users from downloading the entire result set when using server side data is the same one we see there. We need to solve that problem once and for all (offer a "selected" vs "all" option and an external "export" button that triggers a PHP stream). Also the reports section doesn't actually provide any information you can't get elsewhere for the most part, so it's likely many of those reports will be retired and new ones developed. That section made sense back when we weren't using server-side BS tables, but many users have too much data and those sections crash.
Any BS tables that were not manually updated through this process WILL BE BROKEN. Hopefully collectively we can find anything I've missed.
Review/Feedback requested!
Please do review these changes when you get a chance, if you can. I've reviewed the code AND the actual UI several times, but it's easy to forget how big this app is.
If you can, please help me test on IE. I've tested it in my VMs, but IE is no friend to Javascript, so I'm worried.
Pinging @uberbrady, @dmeltzer, @HinchK and maybe @fordster78 for extra testing and eyeballs before we merge to develop. <3 You may need to clear your caches, since there was a bit of cookie shenanigans.
Also I did all this with a 4 keys falling off of my laptop, so look for dumb typos. :)