Hi all, I have an app that updates the columns and data in an ag grid using callbacks that correspond to a user selected process with a dropdown. All processes use the default client side rowModelType; however, one process uses infinite.
So naturally, I added the rowModelType property as an output to this processes’ callback however, this does not work for me and I’m not sure why (example below).
Is there any other way I can update rowModelType or am I suck just using one type as defined when I first declare/initialize ag grid?
*Running dash 2.14.2 and dash-ag-grid 2.4.0
@callback(
Output(“infinite-row-sort-filter-select”, “getRowsResponse”),
Output(“infinite-row-sort-filter-select”, “rowModelType”),
Input(“infinite-row-sort-filter-select”, “getRowsRequest”),
)
def infinite_scroll(request):
dff = df.copy()if request: if request["filterModel"]: filters = request["filterModel"] for f in filters: try: if "operator" in filters[f]: if filters[f]["operator"] == "AND": dff = filter_df(dff, filters[f]["condition1"], f) dff = filter_df(dff, filters[f]["condition2"], f) else: dff1 = filter_df(dff, filters[f]["condition1"], f) dff2 = filter_df(dff, filters[f]["condition2"], f) dff = pd.concat([dff1, dff2]) else: dff = filter_df(dff, filters[f], f) except: pass if request["sortModel"]: sorting = [] asc = [] for sort in request["sortModel"]: sorting.append(sort["colId"]) if sort["sort"] == "asc": asc.append(True) else: asc.append(False) dff = dff.sort_values(by=sorting, ascending=asc) lines = len(dff.index) if lines == 0: lines = 1 partial = dff.iloc[request["startRow"]: request["endRow"]] return {"rowData": partial.to_dict("records"), "rowCount": lines}, "infinite"