You are browsing the documentation for version 4.2 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Security Support ends in January 2024. Read version 5.0 (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.

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