Documentation

BX.UI.StepProcessing Types

BX.UI.StepProcessing.ProcessOptions


Structure fields for initializing Process.


id: string – Unique process ID within page context.


controller: string – Default process controller.


component: string – Component controller.


componentMode?: 'class'|'ajax' – Type of query handler in the component controller.


method?: 'GET' | 'POST' – HTTP-method for AJAX queries.


params?: {} – Parameters, added to query on all hits to controller.


optionsFields?: Array – Fields, printed at the start dialog. OptionsField.


queue?: Array – Action queue. QueueAction.


handlers?: {} – js-function callback - StateChanged. When changing process at the customer's side:

  • - RequestStart – Callback is executed directly before AJAX-request.
  • - RequestStop – Callback is executed when stopping process by user. When set, cancels the call for the cancel controller action.
  • - RequestFinalize – Callback is executed when performing action with 'finalize' parameter. When set, cancels the call for the finalize controller action.

messages: {} – Phrases, printed in dialog windows and buttons:

  • - DialogTitle – Dialog window title.
  • - DialogSummary – Annotation at the start dialog window.
  • - DialogStartButton – Start button.
  • - DialogStopButton – Stop button.
  • - DialogCloseButton – Close button.
  • - RequestCanceling – Annotation, printed when interrupting the process. By default: «Cancel...».
  • - RequestCanceled – Annotation, printed when the process has been stopped.
  • - RequestCompleted – Text at the final dialog window upon success.
  • - DialogExportDownloadButton – Button for downloading file.
  • - DialogExportClearButton – Button for deleting file and saved parameters.
  • - AuthError – Request error message, when authorization failed on AJAX hit.
  • - RequestError – Message with network on AJAX hit.
  • - WaitingResponse – Default message with response standby on the first step, printed if annotation is missing first action.

All messages already have default and localization phrases. Re-defined phrases required for customization for specific task.


showButtons?: {} – What buttons must be printed to dialog:

  • start?: boolean – Process starts.
  • stop?: boolean – Interrupts current request and executes callback RequestStop or controller's action cancel. Controller must support this action.
  • close?: boolean – Closes process dialog.

dialogMinWidth?: number – Minimal dialog width.


dialogMaxWidth?: number – Maximum dialog width.


BX.UI.StepProcessing.OptionsField


Structure fields for initializing input fields at the dialog window.



name: string – Unique field title within dialog window.


type: 'checkbox' | 'select' | 'radio' | 'text' | 'file' – Field type.


title: string – Field title.


value?: any – Default value.


obligatory?: boolean – Required for completion.


multiple?: boolean – Multiple choice selector. Only for the fields 'checkbox' | 'select'.


emptyMessage?: string – Error text, printed, if data is not completed.


textSize?: number – Text area dimensions.


textLine?: number – Text area dimensions.


list?: {[val: string]: string} – List of values for fields 'checkbox' | 'select'.


size?: number – Number of visible items for the field 'select'.


BX.UI.StepProcessing.QueueAction


Structure fields for initializing process actions.



action: string – Controller action.


title: string – Dialog annotation at a step.


progressBarTitle: string – Brief annotation for progress bar.


method?: 'GET' | 'POST' – HTTP-method for action AJAX-request.


controller?: string – Individual controller at the action's step.


params?: {[name: string]: any} – Additional parameters, added to request.


finalize?: boolean – Final step is not displayed to user. Controller must implement the action with the title finalize, designed to free up resources and clear temp data. Callback RequestFinalize can be set instead.


BX.UI.StepProcessing.ProcessResult


Structure fields for controller response. AJAX controller response must contain required fields:


STATUS?: string – Current action execution status. Accepts only two values:


  • PROGRESS – action is not yet finished, you need to repeat query with the same parameters,
  • COMPLETED – action is complete, you may proceed to the next one.

SUMMARY?: string – text annotation to the executed action result.


PROCESSED_ITEMS?: number – number of already processed items.


TOTAL_ITEMS?: number – total volume of items being processed. Integer.


Optional fields:


WARNING?: string – Warning text about issue non-fatal to the system, printed in the dialog window.


FINALIZE?: boolean – Finalize current process ahead of time.


NEXT_CONTROLLER?: string – Switch forcibly to this controller upon next query.


NEXT_ACTION?: string – Execute this action upon next query.


DOWNLOAD_LINK?: string – Link to downloading generated file.


FILE_NAME?: string – File title for link attribute of type <a href="${downloadLink}" download="${fileName}">.


DOWNLOAD_LINK_NAME?: string – Text, printed on the button for file download.


CLEAR_LINK_NAME?: string – Text, printed on the button for the file deleting.



As well as any additional fields for processing in event handlers and callback functions StateChanged.


BX.UI.StepProcessing.ProcessState


Process status has the following values:



intermediate: 'INTERMEDIATE' – User action standby.


running: 'RUNNING' – Running process.


completed: 'COMPLETED' – Completed.


stopped: 'STOPPED' – Process stopped.


error: 'ERROR' – Process stopped due to error.


canceling: 'CANCELING – Process stopped.


BX.UI.StepProcessing.ProcessCallback


During the action queue processing cycle, the following callback functions are called directly within context of process instance::



StateChanged?: function(ProcessState, ProcessResult) – When changing process status at the customer's side.


StepCompleted?: function(ProcessState, ProcessResult) – Callback is called, if the queue step is finalized.


RequestStart?: function(FormData) – Callback is called directly before AJAX call.


RequestStop?: function(params) – Callback is called when user stops the process. When set, cancels the call for the cancel controller action. Otherwise controller must implement the action with the title cancel.


RequestFinalize?: function(params) – Callback is executed when performing an action with 'finalize' parameter. When set, cancels the call for the finalize controller action, designed to free up resources and clear temp data. Controller implements such action.


© «Bitrix24», 2001-2024
Up