Skip to content
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

Need help to set custom cookies for custom filters #7198

Closed
umefarooq opened this issue Feb 25, 2024 · 4 comments
Closed

Need help to set custom cookies for custom filters #7198

umefarooq opened this issue Feb 25, 2024 · 4 comments
Labels
filter-control Issues for the filter-control extension. help-wanted Issues we need or would love help from the community to resolve. not-supported Issues or features that are not supported.

Comments

@umefarooq
Copy link

umefarooq commented Feb 25, 2024

Description

Hi,
How can I set cookies for custom filters. Cookie is working for textSearch I want set cookie for 2 dropdown as shown in image below. I am using ajax request to fetch data and filters.

Screenshot 2024-02-26 at 12 44 51 AM

An example will be really helpful.

Regards,

@umefarooq umefarooq added the help-wanted Issues we need or would love help from the community to resolve. label Feb 25, 2024
@wenzhixin
Copy link
Owner

Please provide an Online Example to show your problem. Thanks!

@wenzhixin wenzhixin added needs example Need an example in order to confirm the issue or the PR. filter-control Issues for the filter-control extension. labels Mar 11, 2024
@UtechtDustin
Copy link
Collaborator

We got no example, so we will close this issue.
Also i'm not sure what do want to know in that issue.

If you want to implementent multiple cookies per filter:
But you can implement you're own cookie handler using cookieStorage, cookieCustomStorageSet, cookieCustomStorageGet and https://bootstrap-table.com/docs/extensions/cookie/#cookiecustomstorageget.

If you want to implement custom filters using e.g. filterBy you have to implement that you're self.

@umefarooq
Copy link
Author

sorry for delay, here is example I have added 2 fields in toolbar locale and price when i select and filter data and refresh the page it should stay same what i have selected before refresh page.

https://live.bootstrap-table.com/code/umefarooq/17754

@UtechtDustin UtechtDustin reopened this Jun 3, 2024
@UtechtDustin
Copy link
Collaborator

That is a custom modification/addition to the bootstrap-table, so we can't cover that cases.
But should be easy to self implement it.
You just have to update you're filter data using the localstorage or cookies.
Minimal example: https://live.bootstrap-table.com/code/UtechtDustin/17758
That is just a PoC, so you can improve it for sure :)

@UtechtDustin UtechtDustin added invalid Issues we can't resolve because it is not related or the information provided is not completed. not-supported Issues or features that are not supported. and removed invalid Issues we can't resolve because it is not related or the information provided is not completed. needs example Need an example in order to confirm the issue or the PR. labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filter-control Issues for the filter-control extension. help-wanted Issues we need or would love help from the community to resolve. not-supported Issues or features that are not supported.
Projects
None yet
Development

No branches or pull requests

3 participants