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

stateSave - previous state settings not shown in filter boxes #77

Closed
vnijs opened this issue May 24, 2015 · 4 comments
Closed

stateSave - previous state settings not shown in filter boxes #77

vnijs opened this issue May 24, 2015 · 4 comments

Comments

@vnijs
Copy link
Contributor

vnijs commented May 24, 2015

Followup on #76

In contrast to the Search field the filter boxes do not 'remember' their values after refresh. The input list does have the previous values but the boxes don't show them.

Question: Would the state information be shown in the DataTables column filters (i.e., like the 'old' column filters in shiny::datatables)? If so, would it be possible have an option to use the 'old' filter boxes? Obviously the 'new' filter boxes have greatly enhanced functionality but for my app saving and (re)loading state is a key feature.

@vnijs
Copy link
Contributor Author

vnijs commented May 31, 2015

As a follow-up (same issue) can you set the initial search value for column filters? You mentioned in #76 that the initial search and order could be set but didn't mention column filters. If this is possible, and if they would be shown in the column filter boxes, I think (hope) I could use this to save and reset state. I did notice however that saveState overrules the value set for DT using the search = ... option so this approach may not work.

@yihui yihui closed this as completed in 8454495 May 31, 2015
@yihui
Copy link
Member

yihui commented May 31, 2015

I have made the column searches available via input$foo_search_columns (without having to use stateSave = TRUE). You can set set initial searches for individual columns via searchCols: http://datatables.net/reference/option/searchCols e.g.

datatable(iris, filter = 'top', options = list(searchCols = list(
  NULL, list(search='5.4 ... 6.8'), NULL, NULL, NULL, list(search = '["setosa"]')
)))

Note searchCols should be a list of lists or NULLs.

@vnijs
Copy link
Contributor Author

vnijs commented Jun 1, 2015

Great! Does global search and sorting need saveState though?

@yihui
Copy link
Member

yihui commented Jun 1, 2015

For global search, no: http://rstudio.github.io/DT/shiny.html For sorting, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants