You are browsing documentation for version 5.0 of OroCommerce, OroCRM, and OroPlatform, maintained until August 2024 and supported until March 2026. See version 5.1 (the latest LTS version) of the Oro documentation for information on latest features.

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

RelatedIdRelationEditorView ⇐ AbstractRelationEditorView

Select-like cell content editor. This view is applicable when the cell value contains label (not the value). The editor will use autocomplete_api_accessor and value_field_name. The server will be updated with the 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}
            NotBlank: ~
            # class: oroentity/js/tools/entity-select-search-api-accessor
            # entity_select is default search api
            # following options are specific only for entity-select-search-api-accessor
            # please place here an options corresponding to specified class
            entity_name: {corresponding-entity}
            field_name: {corresponding-entity-field-name}
              route: '<route>'
                 - '<parameter1>'
                 - '<parameter2>'
      # this line is required to add {column-name-value} to data sent to client
      {column-name-value}: ~

Options in YML

Column Option Name Description
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.editor.view_options.input_delay Delay before user finished input and request sent to server
inline_editing.validation_rules Optional. Validation rules. See JS Validation topic for more information
inline_editing.autocomplete_api_accessor Required. Specifies available choices
inline_editing.autocomplete_api_accessor.class One of the list of search APIs
inline_editing.save_api_accessor Optional. Sets accessor module, route, parameters etc.

Constructor Parameters

Extends: AbstractRelationEditorView

Param Type Description
options Object Options container
options.model Object Current row model
options.input_delay Object Delay before user finished input and request sent to server
options.fieldName string Field name to edit in model
options.className string CSS class name for editor element
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.value_field_name Object Related value field name
options.autocomplete_api_accessor Object Autocomplete API specification