Skip to contents

[Experimental]

This defines the input for the sample variable specification.

Usage

sampleVarSpecInput(
  inputId,
  label_vars = "Select sample variable",
  label_levels_button = "Combine factor levels"
)

Arguments

inputId

(string)
the ID used to call the module input.

label_vars

(string)
label for the sample variable selection.

label_levels_button

(string)
label for the levels combination button.

Value

The UI part.

See also

sampleVarSpecServer() for the module server and a complete example.

Examples

sampleVarSpecInput("my_vars", label_vars = "Select faceting variable")
#> <div class="row">
#>   <div class="col-sm-8">
#>     <label class="control-label">Select faceting variable</label>
#>   </div>
#>   <div class="col-sm-4">
#>     <button class="btn btn-default action-button pull-right list-genes" id="my_vars-levels_button" title="Combine factor levels" type="button">
#>       <span>
#>         <i class="fas fa-table" role="presentation" aria-label="table icon"></i>
#>       </span>
#>     </button>
#>   </div>
#> </div>
#> <div class="custom-select-input">
#>   <div>
#>     <script>
#>         $(function() {
#>           $('#my_vars-sample_var').on('change', function(e) {
#>             var select_concat = $(this).val().length ? $(this).val().join(', ') : 'NULL';
#>             $('#my_vars-sample_var_selected_text').html(select_concat);
#>           })
#>         })</script>
#>     <div>
#>       <div id="my_vars-sample_var_input" style="display: block;">
#>         <div class="form-group shiny-input-container">
#>           <label class="control-label shiny-label-null" for="my_vars-sample_var" id="my_vars-sample_var-label"></label>
#>           <select data-actions-box="false" data-none-selected-text="- Nothing selected -" data-max-options="1" data-show-subtext="true" data-live-search="false" data-state-input="true" id="my_vars-sample_var" class="selectpicker form-control" autocomplete="off" multiple="multiple"><option value=""></option></select>
#>         </div>
#>       </div>
#>       <div id="my_vars-sample_var_fixed" style="display: none;">
#>         <label class="control-label"></label>
#>         <code id="my_vars-sample_var_selected_text">NULL</code>
#>       </div>
#>     </div>
#>   </div>
#> </div>