reflex icon indicating copy to clipboard operation
reflex copied to clipboard

How to apply Overlay and Navigation component to data in DataTable

Open leadline42 opened this issue 2 years ago β€’ 2 comments

Actually, I want to make some tables including texts with link and another texts with tooptips in rows.

I trid to make that using 'pc.table_container' below, it worked well

                            pc.table_container(
                                pc.table(
                                    pc.table_caption("Example Table"),
                                    pc.thead(
                                        pc.tr(*[pc.th(column) for column in ['link', 'nation', 'title', 'text']])
                                    ),
                                    pc.tbody(
                                        pc.tr(
                                            pc.td(pc.link("Link", href="http://www.naver.com")),
                                            *[pc.td(item) for item in ['nation', 'title']],
                                            pc.td(
                                                pc.tooltip(
                                                    pc.text("Text"),
                                                    label='tooltip test',
                                                ),
                                            ),
                                        )
                                    ),
                                    pc.tfoot(pc.tr(*[pc.th(item) for item in ['footer1', 'footer2', 'footer3', 'footer4']])),
                                )
                            )

But it is hard to change my data(DataFrame) to list, because data is huge. So, I would like to apply Tooltip component in Overlay and Link component in Navigation to every row data in DataTable.

Thanks.

leadline42 avatar Feb 21 '23 09:02 leadline42

Currently this is not possible with the datatable but we are thinking about changing the library gridjs for on which will allow more customizability. This would allow you to add more customization and components on top of it.

I'll post an update here once we decide on how to proceed.

Alek99 avatar Feb 23 '23 06:02 Alek99

@Alek99 Thanks you for your reply. I try to use Table component. ;-)

leadline42 avatar Feb 23 '23 23:02 leadline42