Update page_files/Categorized_Search.py

#2
Files changed (1) hide show
  1. page_files/Categorized_Search.py +15 -16
page_files/Categorized_Search.py CHANGED
@@ -486,7 +486,7 @@ if st.session_state.selected_props:
486
 
487
  filtered_meta = filtered_meta.reset_index(drop=True)
488
 
489
- PAGE_SIZE = 5
490
  total = len(filtered_meta)
491
  total_pages = max(1, (total + PAGE_SIZE - 1) // PAGE_SIZE)
492
  st.session_state.current_page = min(st.session_state.current_page, total_pages - 1)
@@ -583,21 +583,21 @@ with left_col:
583
  st.session_state.current_page = 0
584
  st.rerun()
585
 
586
- st.markdown("<div class='aim-sec'>πŸ“‹ Property Types</div>", unsafe_allow_html=True)
587
- selected_props = []
588
- with st.container(height=480):
589
- for index, section in enumerate(all_sections):
590
- key = f"prop_check_{index}"
591
- if key not in st.session_state:
592
- st.session_state[key] = section in st.session_state.selected_props
593
 
594
- if st.checkbox(section, key=key):
595
- selected_props.append(section)
596
 
597
- if selected_props != st.session_state.selected_props:
598
- st.session_state.selected_props = selected_props
599
- st.session_state.current_page = 0
600
- st.rerun()
601
 
602
  if st.button(
603
  "πŸ”Ž Inspect",
@@ -694,8 +694,7 @@ with right_col:
694
  columns=["Select", "Material Name", "Abbreviation", "Class", "Actions"]
695
  )
696
 
697
- for _ in range(2):
698
- table_df.loc[len(table_df)] = [False, "", "", "", ""]
699
 
700
  editor_df = st.data_editor(
701
  table_df,
 
486
 
487
  filtered_meta = filtered_meta.reset_index(drop=True)
488
 
489
+ PAGE_SIZE = 50
490
  total = len(filtered_meta)
491
  total_pages = max(1, (total + PAGE_SIZE - 1) // PAGE_SIZE)
492
  st.session_state.current_page = min(st.session_state.current_page, total_pages - 1)
 
583
  st.session_state.current_page = 0
584
  st.rerun()
585
 
586
+ #st.markdown("<div class='aim-sec'>πŸ“‹ Property Types</div>", unsafe_allow_html=True)
587
+ #selected_props = []
588
+ #with st.container(height=480):
589
+ # for index, section in enumerate(all_sections):
590
+ # key = f"prop_check_{index}"
591
+ # if key not in st.session_state:
592
+ # st.session_state[key] = section in st.session_state.selected_props
593
 
594
+ # if st.checkbox(section, key=key):
595
+ # selected_props.append(section)
596
 
597
+ #if selected_props != st.session_state.selected_props:
598
+ # st.session_state.selected_props = selected_props
599
+ # st.session_state.current_page = 0
600
+ # st.rerun()
601
 
602
  if st.button(
603
  "πŸ”Ž Inspect",
 
694
  columns=["Select", "Material Name", "Abbreviation", "Class", "Actions"]
695
  )
696
 
697
+
 
698
 
699
  editor_df = st.data_editor(
700
  table_df,