Search and Filter
This commit is contained in:
parent
ba1d4da410
commit
c58c0324c0
35
main.py
35
main.py
@ -344,7 +344,7 @@ class App:
|
||||
|
||||
|
||||
|
||||
# tampilan dashboard ngantuk woi
|
||||
# tampilan dashboard untuk admin dah ngantuk we
|
||||
|
||||
def dashboard_frame(self):
|
||||
for w in self.root.winfo_children():
|
||||
@ -374,3 +374,36 @@ def dashboard_frame(self):
|
||||
self.build_menu_manage_tab(self.tab_menu_manage)
|
||||
self.build_promo_tab(self.tab_promo)
|
||||
self.build_tests_tab(self.tab_tests)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Dashboard untuk semua kecuali adminnn
|
||||
|
||||
|
||||
def build_menu_view_tab(self, parent):
|
||||
for w in parent.winfo_children():
|
||||
w.destroy()
|
||||
left = ttk.Frame(parent, width=600)
|
||||
right = ttk.Frame(parent, width=380)
|
||||
left.pack(side='left', fill='both', expand=True, padx=6, pady=6)
|
||||
right.pack(side='right', fill='y', padx=6, pady=6)
|
||||
|
||||
filter_frame = ttk.Frame(left)
|
||||
filter_frame.pack(fill='x', pady=6)
|
||||
ttk.Label(filter_frame, text="Cari / Nama atau Kategori:").pack(side='left', padx=3)
|
||||
self.view_search_var = tk.StringVar()
|
||||
ttk.Entry(filter_frame, textvariable=self.view_search_var, width=30).pack(side='left', padx=3)
|
||||
ttk.Button(filter_frame, text="Cari", command=self.reload_view_table).pack(side='left', padx=3)
|
||||
ttk.Button(filter_frame, text="Reset", command=self.reset_view_filters).pack(side='left', padx=3)
|
||||
ttk.Button(filter_frame, text="Hanya Tersedia", command=lambda: self.reload_view_table(available_only=True)).pack(side='left', padx=6)
|
||||
|
||||
cols = ("ID","Nama","Kategori","Harga","Stok","Tersedia","ItemDisc%")
|
||||
self.view_tree = ttk.Treeview(left, columns=cols, show='headings', height=18)
|
||||
for c in cols:
|
||||
self.view_tree.heading(c, text=c)
|
||||
self.view_tree.column(c, width=90 if c!="Nama" else 200)
|
||||
self.view_tree.pack(fill='both', expand=True)
|
||||
self.view_tree.bind("<<TreeviewSelect>>", self.on_view_select)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user