Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Методы данного класса предназначены для конфигурации списков. Например, для управления действиями UI. 

Использование глобальной переменной


Внутри каждого списка можно использовать преднастроенную глобальную переменную.

Переменная

Описание

currentUiAction

Содержит объект с ID записи UI action. Используйте данную переменную при вызове контекстного меню.

Одним из примеров ее использования является получение информации о действиях UI при вызове контекстного меню.

Image Added

Пример

This class provides methods to configure lists. Use these methods to manipulate them, for example, in the UI actions.

Global variable usage

Within any list, you can use the predefined global variable.

Variable

Description

currentUiAction

Contains an object with an ID of the UI action record. Use it when calling the context menu.

One of the usage cases is receiving information about the UI actions when calling the context menu.

Image Removed

Example:

Code Block
titlecurrentUiAction
linenumberstrue
window.currentUiAction


s_list.addErrorMessage(message)

This method displays an error toast message in the bottom right corner.


Используйте данный метод для вывода всплывающих сообщений об ошибке в правом нижнем углу.


ПараметрыParameter(s):

NameTypeMandatoryDefault ValueДефолтное значение
messageStringYN


Return:

TypeDescription
VoidThis method does not return any value.


Example:

Code Block
languagejs
themeEclipse
titleaddErrorMessage
linenumberstrue
s_list.addErrorMessage('Please enter a valid email address using the following format: joe@example.com');


s_list.addInfoMessage(message, durationMilliseconds)


This method displays info messages when working with lists. They appear in the bottom right corner. The message disappears after a certain period of time. Specify this period in milliseconds in the second parameter.


Parameter(s)Параметры:

NameTypeMandatoryDefault ValueДефолтное значение
messageStringYN
durationMillisecondsNumberNN


Return:

TypeDescription
VoidThis method does not return any value.

Example:

Code Block
languagejs
themeEclipse
titleaddInfoMessage
linenumberstrue
s_list.addInfoMessage('Link copied to clipboard', 2000);


s_list.addSuccessMessage(message, durationMilliseconds)


This method displays success messages when working with lists. They appear in the bottom right corner. The message disappears after a certain period of time. Specify this period in milliseconds in the second parameter.


Parameter(s)Параметры:

NameTypeMandatoryDefault ValueДефолтное значение
messageStringYN
durationMillisecondsNumberNN


Return:

TypeDescription
VoidThis method does not return any value.


Example:

Code Block
languagejs
themeEclipse
titleaddSuccessMessage
linenumberstrue
s_list.addSuccessMessage('Record was successfully updated!', 3000);


s_list.addWarningMessage(message, durationMilliseconds)


This method displays warning messages when working with lists. They appear in the bottom right corner. The messages disappear after a certain period of time. Specify this period in milliseconds in the second parameter.


Parameter(s)Параметры:

NameTypeMandatoryDefault ValueДефолтное значение
messageStringYN
durationMillisecondsNumberNN


Return:

TypeDescription
VoidThis method does not return any value.


Example:

Code Block
languagejs
themeEclipse
titleaddWarningMessage
linenumberstrue
s_list.addWarningMessage('This record has been modified by another user', 3000);


deleteRows(tableName, sysIds)


Use this method to delete one or more selected rows in the table.


Parameter(s)Параметры:

NameTypeMandatoryDefault ValueДефолтное значение
tableNameStringYN
sysIdsArrayYN


Return:

TypeDescription
ObjectThis object returns a promise contains specific data.


Example:

Code Block
languagejs
themeEclipse
titledeleteRows
linenumberstrue
s_i18n.getMessage("Delete the selected record(s)?", async (translationResponse) => {
  if (confirm(translationResponse)) {
    s_list.deleteRows(table, selectedRows)
      .then(() => {
        __resolveServerResponse();
        s_list.refresh(table);
      })
  } else {
    __resolveServerResponse();
  }
});


getCheckedRow(tableName)


Use this method to get information about the strings that are checked on the list.


Parameter(s)Параметры:

NameTypeMandatoryDefault ValueДефолтное значение
tableNameStringYN


Return:

TypeDescription
ArrayAn array containing IDs of the strings checked; if no strings were checked, then the method returns the empty array.


Example:

Code Block
languagejs
themeEclipse
titlegetCheckedRow
linenumberstrue
const table = s_list.getTablesName()[0];
const selectedRows = s_list.getCheckedRow(table);
if (!selectedRows.length) {
  s_i18n.getMessage("No selected rows.", (translationResponse) => {
    __resolveServerResponse();
    alert(translationResponse);
  });
}


getQuery()


This method returns the list condition.


Return:

TypeDescription
StringA condition formatted as an encoded query.


Example:

Code Block
languagejs
themeEclipse
titlegetQuery
linenumberstrue
; (() => {
  const url = new URL(`${API_BASE_URL}/list/${s_list.getTablesName()[0]}`);
  url.searchParams.set('condition', s_list.getQuery());
  window.open(url, '_blank');
})();


getTablesName()


This method returns a list of the tables.


Return:

TypeDescription
ArrayThe tables list.


Example:

Code Block
languagejs
themeEclipse
titlegetTablesName
linenumberstrue
; (() => {
  const url = new URL(`${API_BASE_URL}/list/${s_list.getTablesName()[0]}`);
  url.searchParams.set('condition', s_list.getQuery());
  window.open(url, '_blank');
})();


refresh(tableName)

This method refreshes data on the list specified in the tableName parameter.

Parameter(s):


Используйте этот метод, чтобы обновить данные в списке, заданном в параметре tableName.


Параметры:

НазваниеТипОбязательныйДефолтное значениеNameTypeMandatoryDefault Value
tableNameStringYДNН


ReturnВозврат:

TypeТипDescriptionОписание
VoidThis method does not return any valueДанный метод не возвращает значения.


ExampleПример:

Code Block
languagejs
themeEclipse
titlerefresh
linenumberstrue
if (confirm(translationResponse)) {
  s_list.deleteRows(table, selectedRows)
    .then(() => {
      s_list.refresh(table);
    })
}


Table of Contents
absoluteUrltrue
classfixedPosition