Code
I have this function:
#Refresh MySQL data to Treeview
def refresh(self):
self.table.delete(*self.table.get_children())
cursor = mydb.cursor()
cursor.execute("select * from requested order by done")
for row in cursor:
self.table.insert('','end', values = (row[8], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[9], row[10], row[12]))
If I insert a record or update one - using workbench. When I press refresh in Tkinter, it does not show any new or amended data. Just stays as it is.
But - If I quit Tkinter app - re-open it - click refresh
it will show new amended data.
If the tkinter app is running - If I try to run the following query: truncate table
using workbench - MySQL will not complete the query the action until I close the tkinter app
What it should do
When I activate the function refresh
- it should remove all the current data in treeview and update it with existing values within MySQL.
Quesiton
How can I achieve this?