-
Notifications
You must be signed in to change notification settings - Fork 2.1k
DataTables view #3444
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
DataTables view #3444
Conversation
This is based on #3414 because it has a convenient helper for populating the table headings. (Should we be using the datastore ids or the labels for the table headings now?) |
This PR is really good stuff, i would ask if this could be patched back to 2.5 version. It has better support for displaying numbers for other languages. https://datatables.net/reference/option/language |
Great stuff! Some observations you may want to consider. These comments are based on a dev instance with this PR applied:
|
Finished the all but the "future enhancement" one from above. Cherry-picked #3467 over for the speed-up too. I still need to add the interactive filter embedded in the view like on the recline grid, and enable handling for multiple column sorting. Neither should present any significant problems. |
This is feature complete. looking for direction regarding required tests+docs |
This is looking fantastic. For tests, can I suggest this be one of the rare things that gets one of the mocha UI tests? It'd probably be a good way to confirm the basic functionality from top to bottom. |
Section on the docs: http://docs.ckan.org/en/latest/maintaining/data-viewer.html |
I need to move JS/CSS into vendor directory. I might also switch to the bootstrap theme to fit in with the rest of the look and feel a little better. |
My vote goes to making this a stand-alone extension as well, so that older installations can use it, as well as encourage third-party contributions. |
certainly can do. I'll name the stand-alone extension slightly differently to avoid conflicts and copy the helper that's on master into the extension under a different name as well. |
@TkTech it's this or JS-based package management. I'm just following http://docs.ckan.org/en/latest/contributing/frontend/index.html#frontend-development-guidelines For comparison the recline JS is 70k lines or so, but that includes grid, graps and maps |
Yes, the export buttons are all "what you see on the page rigtht now" and done in the browser. If you don't want those included (it's probably a big part of the JS load) we could take it out of this PR and people that need it could add it themselves, like other datatables extensions. |
data-fixed-header="true" | ||
data-fixed-columns="true" | ||
data-dom='"Blifrtip"' | ||
data-buttons='[ |
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.
Is this param being used? I can't find the "Hide/Unhide Columns" option anywhere ( I suggest we use "Show" if it actually displayed). Also where are the options for CSV and PDF if export_buttons
is True?
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.
@wardi i get this error
DataTables warning: table id=dtprv - Ajax error
I think this might be a good idea. It is a neat feature but we also need to think about how it relates to the existing download/dump of the database (are the CSVs generated the same?). The UX becomes confusing with too many places to dowload the data from. Other than that and my previous comments about the viewport and I'm happy for it to go. Also yes, we should start thinking about using a package manager for js requirements and use it as part of the install. |
Fixed show/hide columns feature, user-provided filters and removed export buttons |
I like how it works, but have one concern about filtering. Is there any simple way to add some delay before changes of search field triggers update of view? Real-time search would be cool with cached results, but hitting server for each letter (if you typing quite slow) is the only disadvantage in comparison with recline data grids. |
@smotornyuk looks like it defaults to 400ms https://datatables.net/reference/option/searchDelay do you still think that's going to cause a problem? It would be easy to pass in another value |
No, i think that this is quite reasonable value. |
@smotornyuk sure, that would be best implemented as a change to the datatables code (or possibly a separate JS extension) because it would be nice for all datatables users. I'll merge this now and that sort of thing can be a future improvement. |
@wardi Great extension. I tried today setting it as the default for auto-creation for datastore views, and it almost works. It throws a 500 with this:
Which raises two questions:
|
Problem:
|
Is reclineview going to be removed or is it gonna stay for a while in master? |
@klikstermkd no plans to remove it in the short term. Depending on adoption we might consider making Data Tables the default choice |
how to add the plugin? |
@jitopdeveloper add this to your ini file:
|
@amercader I've tried it but the result is error 500 |
@jitopdeveloper Which version of CKAN are you using? |
@klikstermkd upgraded to 2.7 and this is few of log |
@amercader @klikstermkd problem solved |
https://datatables.net/ is a very nice alternative to the recline grid view we have now. This is my first attempt at a resource view plugin, be gentle 😄