![]() ("UPDATE cars_buying_checksonly SET checkdate=?, checkvalue=?, checknum=? WHERE uid=?", (self.buying_check_date_var.get(),self.buying_check_value_var.get(),self.buying_check_num_var. Self.checkid)) #is using self.rowid instead of self.checkid can help? Self.buying_check_date_var.get(), self.buying_check_value_var.get(),self.buying_check_num_var.get(), Self.buying_em(self.buying_selected_check_edit, values=( Uid = self.buying_em(self.buying_selected_check_edit) Print(self.buying_em(self.buying_selected_check_edit)) You can use a if statement to determine which item you want, or you can get the selected item with selecteditem lection () 0 and delete it. Self.buying_selected_check_edit = self.buying_lection() You are not deleting the whole tree you are just deleting all children from the root item, because you use delete for each item in your iteration. I've been trying all day to make it so when I add a row to the database that the treeview instantly updates. ) I've got a treeview widget that is supplied data from an sql database. #trying to select the row and edit it in treeview to update it in the database 1 May-11-2021, 10:33 PM (This post was last modified: May-11-2021, 10:33 PM by snakes. ![]() Self.checksrecords, self.checksrecords, self.checksrecords, self.checksrecords)) (self.checksrecords, self.checksrecords, self.checksrecords, self.checksrecords, "INSERT INTO cars_buying_checksonly (checkdate, checkvalue, checknum, carmake, Sellername, buyingdate, entirepaymentmethod, checkpic)values(?,?,?,?,?,?,?,?)", nn = nnect('car dealership.db ' )įor self.checksrecords in self.checksrecords: #add treeview values into database trying to use the primry key as self.rowid from tkinter import ttk from tkinter import root Tk () columns ('Items', 'Values') Treeview ttk.Treeview (root, height18, show'headings', columnscolumns. Self.buying_check_num_var.get(), self.checkid,(),(),self.Buyingdate_var.get (),(),self.buying_nocheckpic))įor child in self.buying_checkspaymenttree.get_children(): When I double click the element I can edit that but in addition to that if I press the enter button It should update the element instead of pressing ok button. Self.buying_check_date_var.get(), self.buying_check_value_var.get(), ![]() Self.buying_checkspaymenttree.insert("", 'end ', values=( Self.buying_checkspaymenttree = ("اdate", "اvalue", "checknum"اcheckid")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |