ipyaggrid icon indicating copy to clipboard operation
ipyaggrid copied to clipboard

How to use Server-Side Row Model for ag-Grid

Open maxkoretskyi opened this issue 1 year ago • 2 comments

This example of how to use ipyaggrid shows the initialization of the agGrid with a fully loaded data (frame), which corresponds to the client-side row model.

g = Grid(grid_data = data, grid_options=grid_options, export_mode="buttons", theme='ag-theme-balham')

Does ipyaggrid support agGrid in the Server-Side Row Model? If so, where can I read about it? If not, could you give me some guidelines on what I should do to enable it?

I've studied the sources a little. Seems like that this use case is not supported. Inside widget_builder.js seems to be the only place where you inject the data:

    // instantiate grid
    const grid = new Grid(gridDiv, gridOptions);
    window.grid = grid;

    // inject gridData
    gridOptions.api.setRowData(gridData);

Maybe under your guidance I could implement the support for the SSR mode for agGrid and create a PR? Since agGrid's SSR model basically requires just a datasource object with getRows method, we could create it in python env and pass it to Grid during the instantiation

g = Grid(datasource= ds, 

maxkoretskyi avatar Aug 31 '23 15:08 maxkoretskyi