Documentation

rpa.fieldscontroller

Extension for handling list of user fields.

BX.Rpa.FieldsController

Methods

Method Description Available from version
constructor(params: {}) Constructor. List params has the following structure:
  • fields: ?Object - array with user field settings data to be rendered
  • hiddenFields: ?Object - array with user field settings data to be displayed in dropdown list "Select field"
  • factory: ?Factory - instance [link=11307294]BX.UI.UserFieldFactory.Factory[/link]
  • fieldSubTitle: ?string - subtitle to be displayed above each field in list
  • errorContainer: ?Element - node DOM for displaying error messages
  • settings: ?{} - list for field visibility settings:
    • inputName: string - name for visibility switch input
    • values: ?Object - set of existing settings
  • typeId: number - process ID
  • languageId: string - language ID
getFields(): Map Returns list of user fields [link=11278086]BX.UI.UserField[/link], to be rendered in list.
addField(userField: UserField): this Adds field userField to the list of displayed fields.
removeField(userField: UserField): this Deletes field userField from the list of displayed fields.
addHiddenField(userField: UserField): this Adds field userField to the list of hidden field.
removeHiddenField(userField: UserField): this Deletes field userField from hidden fields.
render(): Element Renders list with buttons and returns DOM element.
renderContainer(): Element Returns container node. If it's rendered, it will be rewritten.
getContainer(): ?Element Returns container node, if it was rendered.
getFieldRow(userField: UserField): ?Element Returns node, that have have rendered user field.
renderField(userField: UserField): Element Renders user field userField.
static getSwitcherId(inputName: string, fieldName: string): string Returns ID of switch BX.UI.Switcher.
renderSwitcher(userField: UserField): Element Renders the switch BX.UI.Switcher and returns node.
renderFooter(): Element Renders lower portion with buttons, if it wasn't rendered yet.
updateSelectButtonAppearance(): this Shows / hides the button "Select field",depending on the availability of hidden fields.
getCreateButton(): Element Renders the button "Create field", if it wasn't rendered.
handleCreateButtonClick() Called when clicking on the button "Create field".
getSelectButton(): Element Renders the button "Select field", if it wasn't rendered.
handleSelectButtonClick() Called when clicking on the button "Select field".
handleUserFieldTypeClick(fieldType: string) Called when clicking on the field type in the "Create field" button menu.
showFieldConfigurator(userField: UserField) Shows settings form for the userField field.
hideFieldConfigurator(userField: UserField) Hides settings form for the userField field.
handleFieldSave(userField: UserField) Called when saving userField settings field in the form.
isProgress() Returns true when processing ajax query in the moment.
startProgress(): this Starts ajax query processing.
stopProgress(): this Resets status of ajax query processing.
getLoader() Returns instance of BX.Loader.
showError(error, errorContainer: ?Element) Shows error.
getSettings(): Object Returns actual set of settings.
getSelectFieldsMenuId(): string Returns menu ID for the button "Select field".
getSelectFieldsMenuItems(): Array Returns array with description of elements for the "Select field" button menu.
getSelectFieldsMenu(): Menu Returns menu for button "Select field".
handleHiddenUserFieldClick(userField: UserField) Called when clicking on the field "Select field" button menu.
getSettingsMenu(button: Element, userField: UserField): Menu Returns menu for cogwheel button for the field userField.

Events

namespace: BX.Rpa.FieldsController.

Event Description Available from version
onFieldSave Event is triggered after saving settings for user field.

Event handler receives saved field object BX.UI.UserField:

{
    "userField": BX.UI.UserField
}


© «Bitrix24», 2001-2024
Up