- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::bootstrap-select
::xowiki::formfield::bootstrap-select create ...
Class Relations
::xotcl::Class create ::xowiki::formfield::bootstrap-select \ -superclass ::xowiki::formfield::selectMethods (to be applied on instances)
initialize (scripted)
next ::xo::Page requireCSS "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css" template::add_script -order 20 -src "https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js" security::csp::require script-src https://cdn.jsdelivr.net security::csp::require style-src https://cdn.jsdelivr.netrender_input (scripted)
set value [:value] #set :data-live-search true set :CSSclass "selectpicker form-control" set atts [:get_attributes id name data-live-search {CSSclass class} {placeholder title}] set disabled_p [:is_disabled] if {$disabled_p} {lappend atts disabled true} if {${:multiple}} {lappend atts multiple ${:multiple}} if {!${:required}} { set :options [linsert ${:options} 0 [list "--" ""]] set :descriptions [linsert ${:descriptions} 0 ""] } if {[llength ${:options}] != [llength ${:descriptions}]} { error "incorrect number of descriptions provided ([llength ${:descriptions}]): must be [llength ${:options}]" } ::html::select $atts { foreach o ${:options} d ${:descriptions} { lassign $o label rep set :opt_description $d set atts [:get_attributes {opt_description data-subtext}] if {$disabled_p} {lappend atts disabled true} lappend atts value $rep #:msg "lsearch {$value} $rep ==> [lsearch $value $rep]" if {$rep in $value} { lappend atts selected selected } ::html::option $atts {::html::t $label} ::html::t \n } } :handle_transmit_always $valueVariables
::xowiki::formfield::bootstrap-select set __default_metaclass ::xotcl::Class ::xowiki::formfield::bootstrap-select set __default_superclass ::xotcl::Object
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables