How to reset bStateSave cookie?
How to reset bStateSave cookie?
int14
Posts: 8Questions: 3Answers: 0
We have a problem regarding bStateSave cookie. We have used bStateSave=true. The feature is working fine.
It remembers the state even after the user logs out of the application. So the next time when user again log in to the application, the settings are still there.
Is there have any way to clear the setting at the time of logout?
This discussion has been closed.
Answers
Hi @int14 ,
Yep, just call
state.clear()
,Cheers,
Colin
Hi @colin,
I have tried using the below mentioned ways.
1. $('#RFPDetailsGridDataTable').state.clear(); < RFPDetailsGridDataTable is my table name>
2. table.state.clear();
in my layout page but it is not working.
state.clear()
works here:http://live.datatables.net/qejamizu/1/edit
To diagnose your issue please provide a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi @kthorngren,
my project is in development phase so I will not be able to provide you the link. I am explaining you the issue which I am facing.
In my dashboard there is a datatable where "bStateSave": True, and according to the setting everything is working fine. But If I search any thing from search textbox
The box retain that value until I manually delete that value. even if I log out from the application and then login in that case the box retain the same value.
Please let me know if this helps.
I am working on a MVC(Asp.net) application.
Then you will want to use
stateSaveParams
to adjust how the parameters are saved. The docs have an example of what you are looking for. Plus I updated the test case so you can see it in action:http://live.datatables.net/qejamizu/2/edit
Kevin
One more thing I am not clearing the state using button I have to clear the state from my another(layout page).
So, How I can call the table.state.clear();
The example I provided is clearing the state. Try these steps:
If this is not working on your page then please update my example to replicate your issue.
Kevin