Skip to content

The global context object

In filter attribute, a global context object is available.

call

Access ServerSideFunctions (SSF) with a call to context.call method. Use parameters and response to modify initial filter state, or from whithin a filter button press. A call to a SSF can fetch filter configuration, read controller variables, read state from .json files, or make server side fetch calls. See SSF docs for details.

const result = await context.call('.myprivatefn', [args]);

Date functions

setFromDate

Set the Arrigo from timestamp internal variable. Used when controlling view fetch range.

const fromDateResult = await context.setFromDate(dateTime, offset);

setToDate

Set the Arrigo to timestamp internal variable. Used when controlling view fetch range.

const fromDateResult = await context.setToDate(dateTime, offset);

getNow

Get the current Arrigo now date object.

const nowDate = await context.getNow()

parameters

dateTime

A Javascript Date object.

offset

A String. The string contains of an optional -, a number of digits 23, followed by a space, and finally the range indicator (any of min h d w m y)

Indicator Description
min Minutes
h Hours
d Days
w Weeks
m Months
y Years

Context object examples

// get now date object
const nowDate = await context.getNow();

//set arrigo from to yesterday
const fromDate = await context.setFromDate(nowDate, '-1 d');

//set arrigo to to one week from from
const toDate = await context.setToDate(fromDate, '1 w');