Versions Compared

Key

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

This class provides methods to configure for configuring lists. Use these methods to manipulate manage them, for example, in the scripts of 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 the UI action record. It is used Use it when calling the context menu is called.

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

Example:

Code Block
languagejs
titlecurrentUiAction
window.currentUiAction

s_list.addErrorMessage(message)


This Use this method displays to display an error toast message in the bottom lower right corner.

Parameter(s):

NameTypeMandatoryDefault
Value
value
messageStringYN

Return:

TypeDescription
VoidThis method does not return
any
a 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 Use this method to display the info messages when working with lists. They appear in the bottom lower right corner. The message disappears after a certain period of time. Specify this period in in milliseconds in the second durationMilliseconds parameter.

Parameter(s)Parameters:

NameTypeMandatoryDefault
Value
value
messageStringYN
durationMillisecondsNumberNN

Return:

TypeDescription
VoidThis method does not return
any
a value.

Example:

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

s_list.addSuccessMessage(message, durationMilliseconds)


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

Parameter(s)Parameters:

NameTypeMandatoryDefault
Value
value
messageStringYN
durationMillisecondsNumberNN

Return:

TypeDescription
VoidThis method does not return
any
a value.

Example:

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

s_list.addWarningMessage(message, durationMilliseconds)


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

Parameter(s):

NameTypeMandatoryDefault
Value
value
messageStringYN
durationMillisecondsNumberNN

Return:

TypeDescription
VoidThis method does not return
any
a value.

Example:

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

deleteRows(tableName, sysIds)


This method allows deleting Use this method to delete one or more selected rows records, their IDs are passed in the tablesecond parameter.

Parameter(s)Parameters:

NameTypeMandatoryDefault
Value
value
tableNameStringYN
sysIdsArray of StringsYN

Return:

TypeDescription
ObjectThis object method returns a promise Promise object that contains specific some 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)


This method is useful for getting information on which strings Use this method to get information about the strings that are checked on the list.

Parameter(s):

NameTypeMandatoryDefault
Value
value
tableNameStringYN

Return:

TypeDescription
Array
of StringsThis method returns an array that contains the
An array containing
IDs of the strings checked
; if
. If no strings were checked,
then
the method returns
the
an 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 Use this method to return the filter condition for the displayed records in the list condition.

Return:

TypeDescription
String
A
This method returns the 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 the tables listUse this method to return an array with the names of the tables displayed in the window.

Return:

TypeDescription
Array
The tables list
of StringsThis method returns an array with the names of the tables.

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 Use this method to refresh the data on the list specified in the tableName parameter.

Parameter(s):

NameTypeMandatoryDefault
Value
value
tableNameStringYN

Return:

TypeDescription
VoidThis method does not return
any
a 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
printablefalse