![treeview alternative treeview alternative](https://d585tldpucybw.cloudfront.net/sfimages/default-source/default-album/treeview870x220.png)
Even if I add some logic to collapse other nodes when a node is selected (allowing only 1 open node at a time), That is just too much HTML for the page to render, especially when the user picks more that 1 letter to populate. The control is perfect and serves its purpose, but it is
![treeview alternative treeview alternative](https://windows-cdn.softpedia.com/screenshots/FlexTreeView_1.png)
There are child nodes A-Z of the parent node 'Names, and the names are grouped by the 1st letter of the last name. Now, not all the names are loaded at once. New_customer_lb.I have an ASP.NET treeview that contains roughly 20,000 names.
![treeview alternative treeview alternative](https://frontier-erp.ru/images/ComboArchitect/TreeViewExamp.jpg)
# this loop will take 'a' (Customer.Id) and test if even or odd for a,b,c in DB.session.query(Customer.Id,Customer.first_name,Customer.last_name).order_by(Customer.Id): New_customer_lb.insert( '', 'end', values=(a,b,c)) Variable.DBSession = sessionmaker(bind=variable.engine)ĭef _exit_( variable, exc_type, exc_val, exc_tb):ĭb = Button(self, text= 'make DB', command= lambda:self.create_db())Ĭustomer = Button(self, text= 'create customers', command= lambda:self.create_customers())Įngine = create_engine( 'sqlite:///example.db')ĭef create_customers( self): print ( 'Start add customer sql')Ĭustomer1 = Customer(first_name= 'first1',last_name= 'last1')Ĭustomer2 = Customer(first_name= 'first2',last_name= 'last2')Ĭustomer3 = Customer(first_name= 'first3',last_name= 'last3')Ĭustomer4 = Customer(first_name= 'first4',last_name= 'last4')ĭB.session.add_all()įor a,b,c in DB.session.query(Customer.Id,Customer.first_name,Customer.last_name).order_by(Customer.Id): Variable.engine = create_engine( "sqlite:///example.db") from Tkinter import *įrom sqlalchemy import Column, ForeignKey, Integer, String, Textįrom import declarative_baseĬlass DB_connection( object): def _enter_( variable): this is runnable as long as you have sqlalchemy installed as module. Then you can click test new colors button to show it changing colors for odd rows. then loads the few customers from db into listbox. New_customer_lb.tag_configure( "oddrow",background= 'black',foreground= 'white') New_customer_lb.tag_configure( "evenrow",background= 'white',foreground= 'black') New_customer_lb.delete(*new_customer_lb.get_children()) Test = Button(self, text= 'test new colors', command= lambda:self.test_colors()) Load = Button(self, text= 'show customers', command= lambda:self.load_working_customers()) New_customer_lb.configure(yscroll = scrollbar. New_customer_lb.column( '#3', width= 100, stretch=NO) New_customer_lb.heading( '#3', text= 'Last Name') New_customer_lb.column( '#2', width= 100, stretch=NO) New_customer_lb.heading( '#2', text= 'First Name') New_customer_lb.column( '#1', width= 50, stretch=NO) New_customer_lb.heading( '#1', text= 'ID') New_customer_lb = ttk.Treeview(self, columns=( 'ID', 'First Name', 'Last Name')) Scrollbar = Scrollbar(self, orient= "vertical") from Tkinter import *ĭef listbox( self): global new_customer_lb
TREEVIEW ALTERNATIVE CODE
This is runnable without any extra modules… could mess with the code to make it work with your own.