Workspace Client Config


The workspace view can be configured using JSON. You can for example configure:

  • Whether individual columns are editable or not
  • Whether new rows can be inserted into the grid
  • The css styles (font, colour, background, and more) of data series rows
  • The titles of the columns
  • Whether rows are auto-refreshed when edited, after row commands and after inserts
  • …and more

To edit the the JSON config the user must have Development Mode feature enabled.

To edit a config open View Settings and then click Advanced Mode button. The button will open a config modal.

config



Configurations

Below are some examples for the different configurations possible within a workspace.

Actions

Actions are used to run stored procedures after some event occurs, like editing cell, row insert or manual action selection. Actions are used in:


  • action (string): The action name (defined in de_action_sps) to run. Can also be "*none" for no server side action.
  • actionArgs (object): Additional action parameters. Parameters here will be accessible in the stored procedure.
    • longRunningAction (boolean) false: Start the action without waiting for it to complete (the API will not wait).
    • displaySuccessfulNotification (boolean) false: Set to true to display notification to the user when action has executed.
    • successfulNotificationCaption (string): Set the text to be displayed to the user upon successful action execution. If nothing is specified, the caption field from the server response will be displayed.
    • hideFailureNotification (boolean) false: Use to hide error notification to the user in case the action fails.
    • failureNotificationCaption (string): Set the text to be displayed to the user in case the action completes with an error. If nothing is specified, the caption field from the server response will be displayed.

See more about setting up actions here.


Checkboxes

A cell value can be displayed and edited as checkbox. Enabling checkboxes will display checkboxes in the column with it checked if the value is 1, and unchecked if the value is 0. Checkboxes are used in:


  • checkboxes (object): Display cell value as checkbox.
    • enabled (boolean) false: Use to enable checkboxes.
    • trueValue (number) 1: The value the cell contains when the checkbox is checked.
    • falseValue (number) 0: The value the cell contains when the checkbox is unchecked.
    • disableIfNull (boolean) false: Disable checkboxes if cell value contains null.

If the cell contains something else than trueValue, falseValue or null the checkbox will get indeterminate state.

Editing ones and zeros:

{
  "edit": {
    "enabled": true,
    "checkboxes": {
      "enabled": true
    }
  }
}

More advanced:

{
  "edit": {
    "enabled": true,
    "checkboxes": {
      "enabled": true,
      "trueValue": 100,
      "falseValue": -1,
      "disableIfNull": true
    }
  }
}


Conditions

Condition can be set using the cond object. It is for example possible to make a column editable only if certain conditions are met. Condition can be for example: some other column is equal to some specific value or that it is not equal to some value. Conditions can be used in:


  • cond (object): Use to set condition when to show the command.
    • type (string): Type of conditional parameter.
      • = (aliases: ==, ===, equal)
      • <> (aliases: !=, !==, notequal)
      • >
      • >=
      • <
      • <=
      • in (checks if the column’s value is in a list)
    • column (string): Column name to compare to.
    • value (number | string | number[] | string[]): The value/values to compare to. Can either be a single literal value (numerical or string) or it can specify another column (in the same row) using the syntax "${other_column}". When the in type is used the value should be an array. The values in the in type can also use the "${other_column}" syntax.

Using the in type:

{
  "cond": {
    "type": "in",
    "column": "option_status",
    "value": [1, 2, 3, 4]
  }
}

True if cell value in master_id column is greater than -1.

{
    "cond": {
        "type": ">",
        "column": "master_id",
        "value": -1
    }
}

This condition returns true if the value from current_date_id is greater than option_sc_master_start_date_id. The $min postfix is added to columns when the column has aggregation set.

{
    "cond" : {
        "type": ">",
        "column": "option_sc_master_start_date_id$min",
        "value":"${current_date_id}"
    }
}