Class: Glib::JsonUi::ViewBuilder::Fields::Select

Inherits:
AbstractField show all
Defined in:
app/helpers/glib/json_ui/view_builder/fields.rb

Instance Attribute Summary collapse

Attributes inherited from JsonUiElement

#json, #page

Instance Method Summary collapse

Methods inherited from AbstractField

#autoValidate, #context, #default_url_options, #determine_value, #disableDirtyCheck, #hint, #hint_args, #label, #label_args, #name, #placeholder, #placeholder_args, #prop, #validation, #value

Methods inherited from View

component_name

Methods inherited from JsonUiElement

action, any, array, badgeable, bool, color, component_name, date, date_time, enum, float, hash, icon, #initialize, int, length, menu, panels_builder, #props, required, singleton_array, string, text, url, views

Constructor Details

This class inherits a constructor from Glib::JsonUi::JsonUiElement

Instance Attribute Details

#_optionsObject (readonly)

Returns the value of attribute _options.



565
566
567
# File 'app/helpers/glib/json_ui/view_builder/fields.rb', line 565

def _options
  @_options
end

Instance Method Details

#createdObject



592
593
594
595
596
597
598
599
# File 'app/helpers/glib/json_ui/view_builder/fields.rb', line 592

def created
  super

  if @searchable.nil?
    @searchable = _options.size >= 10
  end
  json.set! 'searchable', @searchable
end

#options(value) ⇒ Object



583
584
585
586
# File 'app/helpers/glib/json_ui/view_builder/fields.rb', line 583

def options(value)
  @_options = value
  json.set! 'options', value&.to_a
end

#searchable(value) ⇒ Object



588
589
590
# File 'app/helpers/glib/json_ui/view_builder/fields.rb', line 588

def searchable(value)
  @searchable = value
end