WarUI documentation

Query engine boundary

experimental

Sort, filter, grouping and paging as one serialisable descriptor, shown beside the grid.

Live example

Expected behavior

Header and filter interactions update the JSON. Applying edited JSON updates the grid. Server mode shows the same descriptor as the request payload.

Source

const api = createGrid({ rows, columns });
api.setQuery({ version: 1, sort: [{ columnId: 'price', direction: 'asc' }] });
api.patchQuery({ filter: { columnId: 'name', text: 'pen' } });
const url = '?q=' + encodeURIComponent(JSON.stringify(api.getQuery()));
const page = new QueryEngine(getValue).evaluate(rows, api.getQuery());

API reference

GRID-A01-F15 API
KindNameTypeDescription
MethodgetQuery—Returns the current QueryDescriptor as plain data.
MethodsetQuery—Validates a descriptor against the columns and applies it in one commit.
MethodpatchQuery—Shallow merge. Present keys replace, null clears.
Eventquery:changed—The descriptor changed.
ClassQueryEngine—Evaluates a descriptor client-side or on a server with identical row order.