@helix-x/datagrid-ui - v0.2.0
    Preparing search index...

    Interface HxRowsRequest

    What the grid asks the server for: one page, with the active sort and filters — and, while the grid is grouped, which level of the grouping.

    Structurally compatible with ag-grid's IServerSideGetRowsRequest, so an endpoint written for that model accepts this verbatim. Pivoting is not implemented, so pivotCols and pivotMode are always empty and false.

    Grouping follows the same server-side row model contract, one level deep:

    • Not grouped: rowGroupCols and groupKeys are both empty. Return rows.
    • Group level: rowGroupCols has one entry and groupKeys is empty. Return one row per group, carrying the group value under the group column's field, each valueCols aggregate under that column's field, and the group's row count as childCount (or wherever DataGridProps.getGroupChildCount reads it). lastRow is the number of groups.
    • Inside a group: groupKeys holds the expanded group's value as a string. Return that group's rows, paged by startRow/endRow, exactly as for an ungrouped request with an extra equality filter.
    app.post('/api/rows', (req, res) => {
    const { startRow, endRow, sortModel, filterModel, rowGroupCols, groupKeys } = req.body;
    let rows = applySort(applyFilters(allRows, filterModel), sortModel);

    const [group] = rowGroupCols;
    if (group && groupKeys.length === 0) {
    const groups = groupBy(rows, group.field); // [{ [field]: key, childCount, ...sums }]
    return res.json({ rows: groups.slice(startRow, endRow), lastRow: groups.length });
    }
    if (group) rows = rows.filter((row) => String(row[group.field]) === groupKeys[0]);

    res.json({ rows: rows.slice(startRow, endRow), lastRow: rows.length });
    });
    interface HxRowsRequest {
        endRow: number;
        filterModel: FilterModelMap;
        groupKeys: string[];
        pivotCols: never[];
        pivotMode: false;
        rowGroupCols: HxColumnVO[];
        sortModel: SortModelItem[];
        startRow: number;
        valueCols: HxColumnVO[];
    }
    Index
    endRow: number

    Index one past the last row wanted, exclusive.

    filterModel: FilterModelMap

    Active filters, keyed by column id. Empty when unfiltered.

    groupKeys: string[]

    Empty for the group level; the expanded group's value, as a string, when asking for the rows inside it.

    pivotCols: never[]

    Always empty. Present only for ag-grid wire compatibility.

    pivotMode: false

    Always false. Present only for ag-grid wire compatibility.

    rowGroupCols: HxColumnVO[]

    The column the grid is grouped by: one entry while grouped, empty otherwise. Only one level is supported.

    sortModel: SortModelItem[]

    Active sorts, primary first. Empty when unsorted.

    startRow: number

    Zero-based index of the first row wanted, inclusive.

    valueCols: HxColumnVO[]

    The columns to aggregate on group rows, each with its HxColumnVO.aggFunc. Empty when not grouped.