Property editor specification

TypeScript type: PropertyEditorSpecification.

This specification allows assigning a custom property editor to specific properties.

Attributes

Name Required? Type Default
editorName Yes string

Attribute: editorName

Name of the property editor that's going to be used in UI components. This name is carried over to Field.editor and it's up to the UI component to make sure appropriate editor is used to edit the property.

Type string
Is Required Yes
// There's a content rule for returning content of given `bis.Subject` instance. In addition,
// it assigns the `UserLabel` property a custom "my-editor" editor.
const ruleset: Ruleset = {
  id: "example",
  rules: [
    {
      ruleType: "Content",
      specifications: [
        {
          specType: "SelectedNodeInstances",
          propertyOverrides: [
            {
              name: "UserLabel",
              editor: {
                editorName: "my-editor",
              },
            },
          ],
        },
      ],
    },
  ],
};
// Ensure the `UserLabel` field is assigned the "my-editor" editor
const content = (await Presentation.presentation.getContentIterator({
  imodel,
  rulesetOrId: ruleset,
  keys: new KeySet([{ className: "BisCore:Subject", id: "0x1" }]),
  descriptor: {},
}))!;
expect(content.descriptor.fields).to.containSubset([
  {
    label: "User Label",
    editor: {
      name: "my-editor",
    },
  },
]);

Last Updated: 03 April, 2024