I have a small database with ~9000 rows. Every time I start my program the table starts with the 1:st row. Is it possible to programatically show a specific part of the table, like show last records or show records adjacent to for examle row 1172? /p-a
Asked
Active
Viewed 952 times
2
-
That should be possible, yes, but it may depend of what type of database you are working with. Can you provide some more info? – Kjartan Oct 21 '19 at 05:49
-
@Kjartan. Thanks for your comment. I dont think its database related but for your info I use PostgreSql on a Linux computer. I seems to me that it has something to do with how PuSimpleGUI implements the table (not the database table but PySimpleGUI.Table(...). I cant find any table cmd in PysimpleGUI documentation that let me do what I want... – Per-Arne Asp Oct 21 '19 at 06:40
2 Answers
0
You can hide the rows you do not want to show ('iid' is a unique identifier of the row assigned when you add the row to the table:
tkTable = window['~TABLE~'].Widget
new_row = 'some text'
tkTable.insert('', 'end', iid=id, text='some text', values=new_row)
tkTable.detach(iid)

Zvi
- 2,354
- 2
- 26
- 37
0
You can use method see
of widget, arguments is the row number which count from 0. It maybe on the bottom line in your shown area.
...
window = sg.Window('Title', layout, finalized)
window['-TABLE-'].Widget.see(1172)
...

Jason Yang
- 11,284
- 2
- 9
- 23