-
Notifications
You must be signed in to change notification settings - Fork 904
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
Resetting filters when persistent table is enabled #5738
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication mediums:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Based on the information provided in the knowledge sources, I can address your issue regarding resetting filters when persistent table is enabled. This appears to be a known issue that has been discussed and addressed in Backpack. The problem you're experiencing with the reset button not clearing the filters when persistent table is enabled is related to how Backpack handles the localStorage keys for persistent tables. Your workaround of changing the route definition from: $this->crud->setRoute(backpack_url('user')); to: CRUD::setRoute(config('backpack.base.route_prefix') . '/user'); is actually addressing a symptom of the underlying issue, but it's not the recommended solution. The core of this problem has been addressed in a pull request that fixes datatable persistency when manually filtering. According to the pull request #4558, there were two main issues:
The pull request implemented a fix by re-implementing the updateUrl script to strip the Given that you're using a recent version of Backpack (6.7.43), this fix should already be included in your installation. If you're still experiencing the issue, it might be worth checking if there are any conflicts with your specific implementation or if there are any newer updates available. To properly reset the filters and clear the search field, you should be able to use the "Reset" button that comes with Backpack by default. If this button is not visible or not working as expected, you might want to check your CRUD configuration to ensure it's not disabled. If the issue persists after confirming you have the latest updates and that the reset button is properly configured, I would recommend opening a new issue on the Backpack CRUD GitHub repository with your specific setup and steps to reproduce the problem. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): [Bug] The ListOperation reset button does not work properly when the route is defined by route name (not path) |
Hey @pxpm When creating a new CRUD via the command
BUT If I change it to the following, the reset button clears filters, not the search field.
What do you think about this? |
Thanks @jargoud for reporting the issue. |
The correct way to define routes is I agree that Or if we plan this for v7 and @tabacitu agrees we can make this I like the flexibility we have now, but I hate to have to type the config prefix part every time. What do you think @tabacitu ? |
Based on the information provided in the knowledge sources, I can address your issue regarding resetting filters when persistent table is enabled. This appears to be a known issue that has been discussed and addressed in Backpack. The problem you're experiencing with the reset button not clearing the filters when persistent table is enabled is related to how Backpack handles the localStorage keys for persistent tables. Your workaround of changing the route definition from: $this->crud->setRoute(backpack_url('user')); to: CRUD::setRoute(config('backpack.base.route_prefix') . '/user'); is actually addressing a symptom of the underlying issue, but it's not the recommended solution. The core of this problem has been addressed in a pull request that fixes datatable persistency when manually filtering. According to the PR #4558, there were two main issues:
The PR implemented a solution by re-implementing the updateUrl script to strip the Given that you're using a recent version of Backpack (6.7.43), this fix should already be included in your installation. If you're still experiencing the issue, it might be worth checking if there are any conflicts with your specific implementation or if there are any newer updates available. To properly reset the filters and clear the search field, you should be able to use the "Reset" button that comes with Backpack by default. If this button is not visible or not working as expected, you might want to check your CRUD configuration to ensure it's not disabled. If the issue persists after confirming you have the latest updates and that the reset button is properly configured, I would recommend opening a new issue on the Backpack CRUD GitHub repository with your specific setup and steps to reproduce the problem. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): [Bug] The ListOperation reset button does not work properly when the route is defined by route name (not path) |
Bug report
What I did:
When persistent table is enabled in configuration (
backpack.operations.list.persistentTable
= true), after typing terms in the search field, I want to reset the filters to clear the field.What I expected to happen:
After a click on reset link, the field is cleared.
What happened:
After a click on reset link, the field is not cleared.
What I've already tried to fix it:
The package defines the crud route as follows:
It leads to a local storage key looking like:
If I change this into:
The local storage key is now:
and the reset button works.
I am not sure if that issue should be created here or in Backpack core project.
Backpack, Laravel, PHP, DB version:
PHP VERSION:
8.3.14
PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, FFI, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, intl, SPL, ldap, mbstring, session, standard, odbc, pcntl, exif, mysqlnd, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, random, readline, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, rdkafka, imagick, redis, Zend OPcache
LARAVEL VERSION:
11.35.1.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.6
backpack/crud: 6.7.43
backpack/generators: v4.0.7
backpack/medialibrary-uploaders: 1.2.1
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.29
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.15
The text was updated successfully, but these errors were encountered: