5

I'm using a Ttk treeview to display a big amount of datas (i.e. 20 columns of 60.000 rows) from a csv file.

I added the possibility to filter a bit all these datas. For the columns, no problem as I'm using displaycolumn method but for the rows I couldn't find other solution than clear my treeview then add again the datas I want, but it's really time consuming.

Do you know a way to hide a row in ttk treeview without clearing it ? Maybe I'm not using the right widget to display these amount of datas, do you have any advice?

Tim
  • 41,901
  • 18
  • 127
  • 145
Seb
  • 59
  • 3

1 Answers1

0

From what I understand, you must "detach" the items you want to hide from the tree, and later "reattach" them when you decide that you need to show them. More precisely, the docstring for Treeview.detach says:

Unlinks all of the specified items from the tree.

The items and all of their descendants are still present, and may be reinserted at another point in the tree, but will not be displayed. The root item may not be detached.

Another user explains how to use reattach in this answer to another question on SO.

Anthony Labarre
  • 2,745
  • 1
  • 28
  • 39