Mobile application list

Advanced

Attention. This article is relevant for mobile application version 7.11.1 or higher.

List SDK is a tool that enables to configure list layout, sorting, search logic, etc. It is implemented on the Terrasoft.sdk.GridPage.

Set up the section list
Advanced

Example. Configure the Cases section list to display the title with the case subject, subtitle with the registration date and case number and the case description as the multi-line field.

Example implementation 

Use the following source code to configure the list.

Configure the list of theCases section
// Configure the primary column with the case subject.
Terrasoft.sdk.GridPage.setPrimaryColumn("Case", "Subject");
// Setting the subtitle with the registration date and the case number.
Terrasoft.sdk.GridPage.setSubtitleColumns("Case", ["RegisteredOn","Number"]);
// Adding a multi-line field with the description.
Terrasoft.sdk.GridPage.setGroupColumns("Case", [
{
    name: "Symptoms",
    isMultiline: true
}]);

As a result, the list will be displayed as shown:

scr_result.png
GridPage class
Advanced

Class uses to configure list layout, sorting, search logic, etc.

Methods 

setPrimaryColumn(modelName, column)

Sets the primary display column. Configures the displaying of a title of the list record.

Parameters
modelName model name
column column name
Example of call
Terrasoft.sdk.GridPage.setPrimaryColumn("Case", "Subject");
setSubtitleColumns(modelName, columns)

Sets the columns displayed under the title. Sets the subtitle display as a list of columns with a separator.

Parameters
modelName model name
columns an array of columns or column configuration objects
Terrasoft.sdk.GridPage.setSubtitleColumns("Case", ["RegisteredOn","Number"]);
Terrasoft.sdk.GridPage.setSubtitleColumns("Case", ["RegisteredOn", {
    name: "Number",
    convertFunction: function(values){
        return values.Number;
    
}]);
setGroupColumns(modelName, columns)

Sets a group with columns that are displayed vertically. Configures displaying the group of columns.

Parameters
modelName model name
columns can array of columns or column configuration objects
Terrasoft.sdk.GridPage.setGroupColumns("Case", ["Symptoms"]);
Terrasoft.sdk.GridPage.setGroupColumns("Case", [{
    name: "Symptoms",
    isMultiline: true,
    label: "CaseGridSymptomsColumnLabel",
    convertFunction: function(values) {
        return values.Symptoms;
    }
}]);
setImageColumn()

Sets the image column.

setOrderByColumns()

Sets the list sorting.

setSearchColumn()

Sets the search column.

setSearchColumns()

Sets the search columns.

setSearchPlaceholder()

Sets the hint text in the search field.

setTitle()

Sets the title of the list page.