You are browsing the documentation for version 4.2 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get the updated information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

RelatedIdSelectEditorView ⇐ SelectEditorView

Select-like cell content editor. This view is applicable when the cell value contains label (not the value). The editor will use provided choices map and value_field_name. The server will be updated with value only.

Column configuration sample:

Please pay attention to the registration of the value_field_name in query and properties sections of the sample yml configuration below

      enable: true
    # <grid configuration> goes here
          # please note that both fields(value and label) are required for valid work
          - {entity}.id as {column-name-value}
          - {entity}.name as {column-name-label}
          # query continues here
            view: oroform/js/app/views/editor/related-id-select-editor-view
              placeholder: '<placeholder>'
              css_class_name: '<class-name>'
              value_field_name: {column-name-value}
              # choices: @choiceProvider->getAll
              choices: # required
                key-1: First
                key-2: Second
            NotBlank: ~
              route: '<route>'
                 - '<parameter1>'
                 - '<parameter2>'
      # this line is required to add {column-name-value} to data sent to client
      {column-name-value}: ~

Options in YML

Param Type Description
inline_editing.editor.view_options.choices Key-value set of available choices  
inline_editing.editor.view_options.value_field_name Related value field name.  
inline_editing.editor.view_options.placeholder Optional. Placeholder translation key for an empty element  
inline_editing.editor.view_options.placeholder_raw Optional. Raw placeholder value  
inline_editing.editor.view_options.css_class_name Optional. Additional css class name for editor view DOM element  
inline_editing.validation_rules Optional. Validation rules. See JS Validation topic for more information  
inline_editing.save_api_accessor Optional. Sets accessor module, route, parameters etc.  

Constructor Parameters

Extends: SelectEditorView

Param Type Description
options Object Options container
options.model Object Current row model
options.className string CSS class name for editor element
options.fieldName string Field name to edit in model
options.placeholder string Placeholder translation key for an empty element
options.placeholder_raw string Raw placeholder value. It overrides placeholder translation key
options.validationRules Object Validation rules. See JS Validation
options.choices Object Key-value set of available choices
options.value_field_name Object Related value field name