Plus Minus Module

The Plus / Minus Module enables the creation of Nudge Rules which react to the '+' or '-' keys being pressed in numeric cells.

tip

AdapTable allows you to use the + and - keys on the keyboard to increment or decrement the value of numerical cells in those columns which you have identified as having a nudge value.

Plus Minus Rules

The PlusMinusNudge defines whether a cell should increment / decrement and by how much.

It has these key characteristics:

Scope

Scope defines where the Plus Minus Rule is applied. Options are:

  • one (or more) Columns

  • all columns of 'Numeric' DataType

  • an entire Row (Scope of 'All')

Nudge Value

The Nudge Value specifies how much the cell in question will increment (when '+' is clicked) or decrement (when '-' is clicked).

Query

An optional Plus Minus Rule - using a Query - can be provided if the Nudge should run only under certain circumstances.

note

A Query can reference multiple columns and contain AND and OR and more advanced logic.

UI Elements

Plus/Minus includes the following UI Elements:

  • Popup - Shows a list of existing Plus / Minus rules with a Delete button. Plus an Add button to start the Plus / Minus Wizard which facilitates the creation and editing of Plus / Minus rules.

  • Column Menu - Numeric columns have a Create Plus Minus Rule Menu Item which starts the Plus / Minus wizard

UI Entitlements

UI Entitlements behaviour is as expected for Full and Hidden Access Levels.

The ReadOnly Entitlement behaviour is that Plus Minus Nudges will be applied but Users cannot manage or suspend them

Plus Minus Predefined Config

Contains a collection of Plus Minus Rules.

PropertyDescription
PlusMinusNudgesArray of Plus Minus Nudges

Plus Minus Nudge

A Plus Minus Nudge is defined as follows:

PropertyDescription
NudgeValueAmount by which to update cell when Rule is applied
Rule(Optional) Boolean Query to determine whether to apply the Nudge
ScopeWhere Rule is applied

Example

In this example we create 2 Plus Minus Rules:

  • on 'bidOfferSpread' column which will be nudged by 5

  • on all numeric columns which will be nudged by 100 if the 'price' column is over 5000

export default {
PlusMinus: {
PlusMinusNudges: [
{
Scope: {
ColumnIds: ['bidOfferSpread'],
},
NudgeValue: 5,
},
{
Scope: {
DataTypes: ['Number'],
},
Rule: {
BooleanExpression: '[price] > 5000',
},
NudgeValue: 100,
},
],
},
} as PredefinedConfig;
```ts
export default {
PlusMinus: {
PlusMinusNudges: [
{
Scope: {
ColumnIds: ['bidOfferSpread'],
},
NudgeValue: 5,
},
{
Scope: {
DataTypes: ['Number'],
},
Rule: {
BooleanExpression: '[price] > 5000',
},
NudgeValue: 100,
},
],
},
} as PredefinedConfig;

In this example we create 2 Plus Minus Nudges:

  • on 'bidOfferSpread' column which will be nudged by 5

  • on all numeric columns which will be nudged by 100 if the 'price' column is over 5000

Plus Minus API

MethodDescription
addPlusMinusNudge(plusMinusNudge)Adds new Plus Minus Rule to State
applyPlusMinus(cells)Applies a Plus Minus to given cells
editPlusMinusNudge(plusMinusNudge)Replaces Plus Minus Rule in State with given one
getAllActivePlusMinus()Retrieves all active (not-suspended) Plus Minus Rules in Adaptable State with those with expressions first
getAllPlusMinus()Retrieves all Plus Minus Rules in Adaptable State with those with expressions first
getAllSuspendedPlusMinus()Retrieves all suspended Plus Minus Rules in Adaptable State with those with expressions first
getPlusMinusById(id)Retrieves Plus Minus Rule by Id
getPlusMinusState()Retrieves Plus Minus section from Adaptable State
runPlusMinusNudge(plusMinusNudge, cells, direction)Applies a Plus Minus Rule to given cells
showPlusMinusPopup()Opens Plus Minus popup screen
suspendPlusMinusNudge(plusMinusNudge)Suspends Plus Minus Rule
unSuspendPlusMinusNudge(plusMinusNudge)Activates a suspended Plus Minus Rule

FAQ

Can I use Plus/Minus across multiple cells simultaneously?

Yes, so long as all the highlighted cells are in the same column. AdapTable will automatically apply the correct nudge value for each cell in the selection.

More Information