israel-dryer / ttkbootstrap

A supercharged theme extension for tkinter that enables on-demand modern flat style themes inspired by Bootstrap.
MIT License
1.99k stars 395 forks source link

purge_table_data and reset_table_data do not clear/update columns and table page correctly #459

Open Tungsteno74 opened 1 year ago

Tungsteno74 commented 1 year ago

Desktop (please complete the following information):

last Window 11

Describe the bug

My table inizialization:

table = Tableview(
    master=tablearea,
    # coldata=df.columns,
    # rowdata=df.values.tolist(),
    paginated=True,
    searchable=True,
    bootstyle=INFO,
    autofit=True,
    stripecolor=_PUT_STRIPESCOLOR,
    pagesize=20,
    height=20,
)
table.fill_empty_columns(_PUT_FILLVALUE)
VTABLE.purge_table_data()
VTABLE.reset_table()
VTABLE.build_table_data(_PUT_TABLEHEADERS, DF.values.tolist())

This code get the following error

  File "D:\Virtualenvs\py38\LFREDeditorCTkinter-py38\lib\site-packages\ttkbootstrap\tableview.py", line 685, in build_table_data
    self.autofit_columns()
  File "D:\Virtualenvs\py38\LFREDeditorCTkinter-py38\lib\site-packages\ttkbootstrap\tableview.py", line 1884, in autofit_columns
    old_width = col_widths[i]
IndexError: list index out of range

Try with more that 4000 rows and about 11 columns.

And the number of pages in the bottom right label of the table still visualize the old number of pages.

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response