-
Notifications
You must be signed in to change notification settings - Fork 180
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
stateSave overides option parameters #146
Comments
It seems that datatables has a I tried to use this feature in a minimal example (see https://github.com/vnijs/dt_state/blob/master/ui.R) but get the following error.
|
I can only answer the datatable(..., callback = JS("
$('a#refresh').on('click', function() {
table.state.clear();
window.location.reload();
});
")) |
Finally got around to trying your suggestion. Works great with one table (see https://github.com/vnijs/dt_state)!! Thanks. However, is it possible that conflicts occur when you have multiple DT tables in an app you want to use stateSave for? When I use this in Radiant with Data > View it works great but strange things happen when I try to add the same functionality to Data > Pivot. If this should work I'll try to trace back what is going on. |
I'm relatively sure that |
@yihui I'm not sure exactly what the cause is but there is an issue that pops-up when I use If I turn a filter in the View or Pivot tab in the dt_state app ( |
The best solution I found to maintain state (
As the main issue is resolved I will close this one and open a new issue about removing filters for factors when using |
As of Shiny v1.4,
|
Thanks for the heads-up @jcheng5! Works as expected.
|
This is a follow up on #66, #76, and #77. I setup a repo with a minimal example to see if I can save and reset state for a DT table (see https://github.com/vnijs/dt_state). Column and global search work fine without
stateSave = TRUE
. The remaining parts (sorting, page, show) requirestateSave = TRUE
.My goals are to (1) maintain state, (2) restore state from a file, and (3) 'flush' state when needed.
state
that can take an object with the same structure asinput$outputId_state
and parse it.stateSave
stores its values and over-rides the parameters passed through options. To simulate what I'm looking for see line 15 in server.R. I would expect this value to be used on each refresh because it is passed to thesearchCols
option.stateSave
overrides it.The current
stateSave
setup probably works really well for client-side processing. However, for server-side processing it would be great if there was an optionstate
that can take an object with the same structure asinput$outputId_state
and parse it. In my example I would assign this state to the r_state list that I can easily flush or I can load a new r_state from file and use that.The text was updated successfully, but these errors were encountered: