Skip to content

columns.AddChoiceHash

Overview

This is the "AddChoiceHash method" of the "columns object". The "Server Script" can dynamically set the "Option List" of "Class Column" by calling AddChoiceHash multiple times. When AddChoiceHash is called the first time, all choices set before the execution of the "Server Script" are cleared.

Supported Versions

  1. Pleasanter 1.2.4.0 or later
  2. Pleasanter .NET Framework version 0.50.267.0 or later

Limitations

  1. Only "Class Column" can be used.
  2. If "Use Search Function" is enabled in the settings of the corresponding "Class Column", operations on AddChoiceHash are not reflected in the "Option list". In this case, the "Option list" configured in the editor is displayed instead.

Prerequisites

  1. At least one option must be set in the option list for the target column.
  2. This is valid when the server script "Condition" is "Before opening the page" or "Before opening the row".

Syntax

columns.[Column Name].AddChoiceHash(key, value);

Parameters

If the parameter value is omitted, it will be interpreted as AddChoiceHash(key, key).

No Parameter Type Required Overview
1 key object Yes Key
2 value object - Value

Return Value

There is no return value.

Usage Examples

In the example below, a "Option list" from TEST1 to TEST5 is set for ClassA.

When value is specified

JavaScript
for (let i = 1; i <= 5; i++) {
    columns.ClassA.AddChoiceHash(i, 'TEST' + i);
}

In this case, you will get the same display result as when specifying the Option List of the Class Column as follows:

The option list setting that gives the same result as specifying value

When value is omitted

JavaScript
for (let i = 1; i <= 5; i++) {
    columns.ClassA.AddChoiceHash('TEST' + i);
}

In this case, you will get the same display result as when specifying the Option List of the Class Column as follows:

The option list setting that gives the same result as omitting value

Supported Versions

Supported Version Details
1.2.4.0 and later Feature added
1.4.23.0 and later Parameter value can be omitted