h2oai / wave

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

Search is not working in Table groups #1991

Closed ShehanIshanka closed 1 year ago

ShehanIshanka commented 1 year ago

Wave SDK Version, OS

Wave SDK: 0.24.2 , OS: MacOs

Actual behavior

After searching entries get multiplied. This issue happens when multiple table group has the same label.

from h2o_wave import main, app, Q, ui

@app('/')
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='text1', label='Issues reported by', searchable=True),
                ui.table_column(name='text2', label='Issue')
                     ],
            groups=[
                ui.table_group("Bob", [
                    ui.table_row(name='row1', cells=['Issue1','Issue is 1']),
                ], collapsed=False),
                ui.table_group("Bob", [
                    ui.table_row(name='row1', cells=['Issue2','Issue is 2']),
                ], collapsed=False),
                ui.table_group("John", [
                    ui.table_row(name='row3', cells=['Issue3','Issue1']),
                ], collapsed=False),
                ui.table_group("Bob", [
                    ui.table_row(name='row1', cells=['Issue2', 'Issue is 2']),
                ], collapsed=False),
            ],
            height='500px'
        )
    ])
    await q.page.save()

https://github.com/h2oai/wave/assets/29954570/4f79e44b-0166-48c2-aa8f-1a117fe286bb

Expected behavior

After searching relevant rows should be visible and when the search text is erased table should be reset.

mturoci commented 1 year ago

Duplicate of #1982.