gridQuery

The library grid's LoadItemsTask2 query — what BaseGridView asks for, kept apart from the Task node that runs it.

BaseGridView runs every load and every page on a NEW node (see replaceTask), so the node cannot be the memory of the query: the next page must ask for exactly what the first page asked for, and that has to survive the node being replaced. The query is a plain AA held on the component instead.

It lives in source/ rather than in BaseGridView.bs because a component codebehind's functions are scoped to that component and a Rooibos suite cannot call them without a callFunc seam on the XML. Same move as source/home/latestRows.bs.

Methods

(static) build(state, parentItem, view, presenter) → {object}

The query for a fresh load: the defaults, then whatever the presenter sets for its view. Presenters receive a plain AA and assign fields on it exactly as they would on a LoadItemsTask2 node. Built from scratch every time, so nothing a presenter set for one view carries into the next.

Parameters:
NameTypeDescription
stateobject

{ nameStartsWith, searchTerm, sortField, sortAscending, filter, filterOptions }

parentItemobject

the library (or folder) the grid shows

viewdynamic

the current view mode, passed to the presenter

presenterdynamic

the grid's presenter, or invalid

Returns:

LoadItemsTask2 input fields, without startIndex (see forPage)

Type: 
object

(static) forPage(query, startIndex) → {object}

The fields for one run of query, starting at startIndex. A copy: query itself is left untouched, so it stays the record of what every page of this load asks for.

Parameters:
NameTypeDescription
queryobject

a query from build()

startIndexinteger

the first item to fetch

Returns:

LoadItemsTask2 input fields

Type: 
object