-
Notifications
You must be signed in to change notification settings - Fork 215
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
Show blank_slate when all records filtered out #275
Comments
i am currently not working on this plugin. But this should be a simple feature/configuration. Look at line if rendering.blank_slate_handler && grid.resultset.size == 0 && !grid.filtering_on? in Running or not running the last check will do the trick. I will accept a pull request. |
Thanks for the tip! I actually found that on my own and tried disabling the last boolean. It does show the blank slate instead of the grid, but it also makes all the filters disappear. I tried to investigate further into the filter generation, but I wasn't able to figure it out. As a workaround, is it possible to determine from the grid instance whether the filtered result set is empty? I tried |
If there are no records, you could display the grid title row and filters as well as the text "No records found" by looking for this in wice_grid_view_helpers.rb#grid_html:
and inserting this line immediately after it:
|
The
blank_slate
feature only works when there are no records in the database. I would like it to also show the blank slate when no records are returned due to filters—at least when using detached filters. I realize this behavior is documented in the readme, but I don't see its value. If this is considered a feature, perhaps it could be an option.The text was updated successfully, but these errors were encountered: