Managing Select Box Collection

The functionality described below is applicable to co, coro column types.

Initialization by script

The following method can be used to get a select box collection common for the whole column:

combo = grid.getCombo(index);

If you need the collection to be specific for a cell use:

combo = grid.getCustomCombo(rId,cIndex)

The collection supports the following API:

combo.put(value,label); // adds a new record to the collection
combo.remove(value);    // removes a record from the collection
combo.clear();          // removes all records from the collection
combo.size();           // returns the current size of the combo box
combo.get(value);       // returns the label by value
combo.getKeys();        // returns the array of all possible values;           // saves the current state
combo.restore();        // restores the previously saved state

Initialization from XML

The list of options for combo can be defined from XML in two ways:

  • With column configuration the values will be set for all cells in a column
        <column type="co"> Combo column
            <option value="1"> First </option>
            <option value="2"> Second </option>
            <option value="3"> Third </option>
  • For separate cells (pro version only)
    <row id="some1">
        <cell> some </cell>
        <cell> some </cell>
        <cell xmlcontent="true">
            <option value="1">The first</option>
            <option value="2">The second</option>
        <cell> some </cell>
Back to top