Documentation

Timeline base class

Description and methods

Base class for timeline item.

BX.UI.Timeline.Item
Method Description Available from version
constructor(data: {}) Constructor.

Parameters:

params - has the following structure:

  • id - item ID (string and number);
  • action - action type string ID. Uses this ID to select one of descendants. Can receive one of several values:
    • item_create - create item;
    • stage_change - change stage;
    • fields_change - update item's fields;
    • comment - comments.
  • itemClassName - name of descendant's javascript class;
  • title - entry title;
  • description - entry contents;
  • htmlDescription - entry content in html;
  • textDescription - entry content as text;
  • createdTimestamp - timestamp for added entry;
  • userId - user ID, which action created an entry;
  • isFixed - true, when entry must be in the attached items section;
  • data - list with data about associated entities:
    • item - item data before applying changes
      • name - item name.
    • stageFrom - stage data before update:
      • id - stage ID;
      • name - stage name.
    • stageTo - stage data after update (if it has changed);
    • task - data of task with entry created during execution of such task:
      • id - tase ID;
      • title - task title;
      • description - task text.
    • fields - array of fields updated when creating an entry:
      • title - field name.
    • scope - scope name, used to implement the change. Can receive one of the following values:
      • manual - manually;
      • automation - using automation rule;
      • task - when executing a task;
      • rest - via application.
    • events - list with event handlers, they are generated as list.
afterRender()Called after rendering an item.
setIsLast(isLast: boolean): ItemSets attribute specifying the item to be the last in list.
getContainer(): ?Elementreturns container with item, if rendered.
isRendered(): booleanReturns true, if item is rendered.
getCreatedTime(): ?DateReturns date of created entry.
formatTime(time): stringReturns string with formatted creation time without date.
Getters and setters
  • getId(): string|number
  • getTitle(): ?string
  • getUserId(): number
  • getScope(): ?string
  • isScopeManual(): boolean
  • isScopeAutomation(): boolean
  • isScopeTask(): boolean
  • isScopeRest(): boolean
  • getItem(): ?{name: ?string}
  • render(): Element - Renders an object and returns a container.
  • updateLayout() - Fully re-renders a content.
  • clearLayout(isSkipContainer = false): Item - Clears container content and deletes it from document. When passing true, the container will also will cleaned and deleted.
  • getDataForUpdate(): {} - Returns data required for updating an item.
  • updateData(params: {}) - Updates item's data.
  • update(params: {}): Item - Updates item's data and re-renders its content.
  • hasMenu(): boolean - Returns true, when item has a menu.
  • getActions(): Array - Returns array of items for dropdown menu.
  • renderActionsButton(): Element - Renders button for dropdown menu.
  • getActionsButton(): ?Element - Returns button for dropdown menu, if it was rendered.
  • getActionsMenuId(): string - Returns ID for dropdown menu.
  • getActionsMenu(): Menu - Returns item's menu.
  • startProgress() - Shows loader and save processing sate for ajax query.
  • stopProgress() - Hides loader and resets ajax query processing status.
  • getLoader() - Returns object BX.Loader.


© «Bitrix24», 2001-2024
Up