h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Sort is not working for table custom groups #2268

Closed marek-mihok closed 4 months ago

marek-mihok commented 4 months ago

Wave SDK Version, OS

Wave 1.0.2 MacOS 14.2.1 Chrome Version 120.0.6099.216 (Official Build) (arm64)

Actual behavior

https://github.com/h2oai/wave/assets/23740173/a2a12c25-7151-428a-bd65-a972f4ef8300

Sort is not working properly when custom groups are specified as seen on the recording. Not only the wrong items are shown in the second group, but new rows are being added when sorting repeatedly.

Expected behavior

Rows to be sorted ascending (on first sort click and descending on second) within the group.

image

Steps To Reproduce

from h2o_wave import main, app, Q, ui

@app('/demo')
async def serve(q: Q):
    q.page['form'] = ui.form_card(box='1 1 -1 6', items=[
        ui.table(
            name='issues',
            columns=[ui.table_column(name='text', label='Issues reported by', sortable=True)],
            groups=[
                ui.table_group("Bob", [
                    ui.table_row(name='row1', cells=['Issue1']),
                    ui.table_row(name='row2', cells=['Issue2'])
                ]),
                ui.table_group("John", [
                    ui.table_row(name='row3', cells=['Issue3']),
                    ui.table_row(name='row4', cells=['Issue4']),
                    ui.table_row(name='row5', cells=['Issue5']),
                ], collapsed=False),
                ui.table_group("Jane", [])],
            height='500px'
        )
    ])
    await q.page.save()
elipappas commented 4 months ago

I am looking to contribute for the first time, is this still available?

marek-mihok commented 4 months ago

@elipappas sure, it is! Feel free to assign yourself to this issue.

marek-mihok commented 4 months ago

@elipappas due to high priority of this bug being fixed until the upcoming release it was fixed by our team. Feel free to assign yourself into any of other issues. We advise, especially for the first time contributors, to choose one labeled as Good first issue - you can find it here.