Clear filterControl with Cookie
See original GitHub issueI 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:
- Created 5 years ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top GitHub Comments
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.
Merged