WarUI documentation

Live query AST inspector

experimental

Watch the versioned query AST update as you sort, filter and page a product grid.

Live example

Expected behavior

Clicking a column header adds a sort node, the filter input adds a filter node and the pager updates the page node. Reset restores the empty AST.

Source

const api = createGrid({ rows, columns, pipeline: { pageSize: 25 } });
api.on('queryChange', ({ ast }) => panel.textContent = JSON.stringify(ast));
api.setSort([{ columnId: 'price', direction: 'asc' }]);
const ast = api.getQueryAst(); // deep-frozen copy, ast.v === 1
api.setQueryAst({ ...ast, filter: { columnId: 'name', text: 'pen' } });

API reference

GRID-A05-F01 API
KindNameTypeDescription
MethodgetQueryAst—Returns a deep-frozen copy of the current query AST.
MethodsetQueryAst—Validates and applies an AST in one commit.
EventqueryChange—Fires once per query change with the full AST.
TypeWarQueryAst—Root node with the numeric version field v.