Closed Archern4r closed 1 year ago
Thanks very much for all the testing and help, I’ll get round to this soon
Hello,
When I recreated your code on my pc using version 5.6.0
I couldn't get an error to occur, I might have fixed an issue present in an older version, could you try with the latest version sorry
Hi there,
sorry for late reply. The problem persists for me on 5.6.2 using the same code as in my example above.
Remember the error will only occur when all columns are shown, not if not all are on display. The error can then even be fixed by resizing the window so that not all columns are displayed and clicking the button again.
Hello, I finally managed to recreate the issue after using your sheet data, it is fixed in 5.6.5
The issue resulted because the main table was attempting to redraw a checkbox from the previous go round (as they weren't deleted with set_sheet_data()
) and the row length was too short to do so
I've put in a try
and except
in redrawing checkboxes, if there's no associated data they will be unchecked until the user checks them at which point the row will be extended if necessary and the data will exist
Hi there,
another error came up lately and I think this is actually a bug instead of just user error(by me): If one draws a table and creates a checkbox in the last column, then redraws the table (doesn't really matter if new data or not), an error will be thrown (IndexError: list index out of range), but only when all columns are on display (at least for me).
It seems to me that the problem arises in _tksheet_main_table.py in line 4148-4152 (although I might be wrong on that), because of the error only occuring when I resize the table to show all columns. The error is actually caused by line 4206.
When I tried debugging a bit myself I found it tries to redraw the table using the original data only (without the checkbox column) and then inserting the checkbox column afterwards. This means if in the code example the checkbox column is set to 0 instead of at the end, the data is first set to the input data and then the checkbox column can be inserted correctly, its index not being out of bound.
I tried to circumvent the problem by first deleting all data in the sheet by iterating over the rows in the sheet and deleting them one-by-one EDIT: and after fixing an coding error by me, that helps as a workaround. Example code: