question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear filterControl with Cookie

See original GitHub issue

I use filterControl and Cookie that store to localstring.

When I filter some column data with input filter and reload the page, the talbe still filtered because the cookie is active. It’s OK. But if I click to “Clear Filter” button and after I reload the page, the filter still aply. To Chrome console, when I click to “Clear Filter”, I see bs.table.filterControl is deleted and is recreated. To resolve it, to BootstrapTable.prototype.clearFilterControl function, I’ve add this line $.each(that.options.filterControls, function (i, item) { item.text = ''; }); after this line:
$.each(that.options.valuesFilterControl, function (i, item) { item.value = ''; });

I’dont’ know if this lines I’ve added could create another problem, but it resolve my problem to clear filterControl.

I’m using filterControl v2.1.3 and cookie v.1.2.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
manukielicommented, Feb 23, 2019

I’ve the same problem with the version v.1.13.5 I’m using localstorage to store filter data. I think this issue it’s produce because when your script invoke function clearFilterControl(), this function create the variable cookies with the function UtilsFilterControl.collectBootstrapCookies(). And this function find only cookie and not into the localStorage.

0reactions
wenzhixincommented, Mar 22, 2019

Merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clear Filter Values in BootstrapTable - jquery - Stack Overflow
filterControl && this.options.filterShowClear) { var that = this, cookies = collectBootstrapCookies(), header = getCurrentHeader ...
Read more >
Clear, enable and manage cookies in Chrome - Google Support
Clear, enable and manage cookies in Chrome. You can choose to delete existing cookies, allow or block all cookies, and set preferences for...
Read more >
ASPxGridView - How to clear filter expression that is saved in ...
Hello, I am using a grid with cookie. The filter (among other properties) is being stored in the cookie . Now I would...
Read more >
Is there an effective cookie management/filter that actuall works?
It is my opinion that if one is concerned about cookies it is far easier to set your browser to delete cookies on...
Read more >
Clear or remove a filter - Microsoft Support
For example, the figure below depicts an example of clearing the filter from the Country column. Clear filter from button. Note: You can't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found