dash-tabulator icon indicating copy to clipboard operation
dash-tabulator copied to clipboard

Is there a property that returns the current sorting of rows?

Open sorenwacker opened this issue 2 years ago • 2 comments

It seems the data property returned from the callback is independent of the current sorting. I am interested in that ordering and would like to store the data in the current order. This is my current callback.

    @app.callback(
        Output({"index": "pkl-save-output", "type": "output"}, "children"),
        Input("pkl-save", "n_clicks"),
        Input("pkl-table", "data"),
        Input("pkl-table", "dataChanged"),
        State("wdir", "children"),
    )
    def plk_save(n_clicks, data, data_changed, wdir):
        df = pd.DataFrame(data)
        if len(df) == 0:
            df = pd.DataFrame(columns=TARGETS_COLUMNS)
        T.write_targets(df, wdir)
        return dbc.Alert("Target list saved.", color="success")

sorenwacker avatar Jun 11 '22 15:06 sorenwacker

I tried replacing

    Input("pkl-table", "data"),

with

    Input("pkl-table", "dataSorted"),

but that does not change anything.

sorenwacker avatar Jun 11 '22 16:06 sorenwacker

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 11 '22 17:08 stale[bot]