“Collection” and “Reference” display mode

The display modes of the “Collection” and “Reference” view types are the following constant in the platform:

module.exports = {
  TEXT_SIMPLE: 0,
  TEXT_AUTOCOMPLETE: 1,

  COLLECTION_LIST: 0,
  COLLECTION_LINK: 1,
  COLLECTION_LINKS: 2,
  COLLECTION_TABLE: 3,
  COLLECTION_HASHTAGS: 4,

  REF_STRING: 0,
  REF_LINK: 1,
  REF_INFO: 2,
  REF_HIERARCHY: 3,
  REF_SPECIFY: 4,

  GEO_MAP: 0,
  GEO_LOCATOR: 1,
  GEO_CANVAS: 2,

  GROUP_VERTICAL: 0,
  GROUP_HORIZONTAL: 1
};

For an attribute with the “Collection” type, the "mode" display modes are implemented on the view form:

  • "mode": 0 - List
  • "mode": 1 - Reference
  • "mode": 2 - List of references
  • "mode": 3 - Table
  • "mode": 4 - Tag cloud

For an attribute with the “Reference” type, the "mode" display modes are implemented on the view form:

  • "mode": 0 - String
  • "mode": 1 - Reference
  • "mode": 2 - Form
  • "mode": 3 - Hierarchical reference
  • "mode": 4 - Refining Search

“Hierarchical reference” in more details

In the Hierarchical fieldmode, the filter parameters for the hierarchy levels are displayed based on the specified nested fields. When the field is initially initialized, an ajax request is made to the controller to get the first selection list (the filter is not set). When a response is received from the server, the first filter field is displayed with a selection list. Next, when you select a value in each of the filter fields, the values of the following fields are reset and a new selection list is requested for the next field. Fields that do not have a selection list are hidden. If one option is received in the selection list, it is automatically assigned to the filter and the selection list is determined for the next level of the hierarchy. When a special “transit” value is obtained, the current value is assigned to the next filter instead of the selection list, and the procedure for obtaining the selection list for the next hierarchy level is performed, and the field corresponding to the filter is hidden. When the values of all the filter fields are set, the controller returns a list of object selection by reference, which is automatically displayed in a separate field located after the filter fields.

“Refining search” in more detail

The refinement search fields are used to simplify the search for objects in the reference. The designer of the meta, based on the subject area, can define part of the attributive composition of the sought object as “refining” and, thus, make the task easier for both the database and the user. That means, that instead of selecting from the entire set of products, we first select the value of the “manufacturer” field, then the value of the “product type” field, the options of which are already limited by the previous filter, and so on, thus significantly reducing the selection only to those products that correspond to the refinement attributes. For such a field, it becomes possible to specify fields that will refer to the attributes of the class by reference and become “refining”.