pyite
November 1, 2017, 4:57pm
1
Hello there, I am a relatively new user but I was able to get a basic form working with MySQL. The next step is to have the ability to select/deselect some results based on checkboxes. There are a million examples out there, but I am shooting for something like the way NewEgg lets you choose vendors and other options, e.g.: https://www.newegg.com/Product/ProductList.aspx?Submit=ENE&DEPA=0&Order=BESTMATCH&Description=1060&N=-1&isNodeId=1
Is there an easy way to do this in Shiny or will I have to do a lot of JavaScript/Ajax hand-hacking to make this work?
Thanks
jcheng
November 1, 2017, 7:56pm
2
Here's a somewhat similar example you could adapt:
filters.R
library(shiny)
columnFilterUI <- function(id) {
ns <- NS(id)
uiOutput(ns("filter_container"))
}
columnFilter <- function(input, output, session, df, col_num, choice_filter) {
# This renders a selectInput and only re-renders when the selected data
# frame changes. (i.e. it doesn't re-render when filters change state.)
This file has been truncated. show original
You'd have to change the selectInputs to checkboxGroupInput (and updateSelectInput to updateCheckboxGroupInput) and change the UI to move the filter controls to the sidebar, but a lot of the core logic would stay the same I think.
pyite
November 6, 2017, 7:13pm
3
Excellent, thanks for the suggestion.