Update page_files/Categorized_Search.py
#3
by AbhijitClemson - opened
page_files/Categorized_Search.py
CHANGED
|
@@ -370,14 +370,10 @@ def extract_matrix_fiber(abbr: str):
|
|
| 370 |
|
| 371 |
|
| 372 |
def toggle_class(material_class: str):
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
active.remove(material_class)
|
| 376 |
else:
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
order = ["Composites", "Polymers", "Fibers"]
|
| 380 |
-
st.session_state.active_classes = [item for item in order if item in active]
|
| 381 |
st.session_state.current_page = 0
|
| 382 |
|
| 383 |
|
|
@@ -701,7 +697,7 @@ with right_col:
|
|
| 701 |
key=f"materials_editor_{st.session_state.current_page}",
|
| 702 |
use_container_width=True,
|
| 703 |
hide_index=True,
|
| 704 |
-
height=
|
| 705 |
row_height=46,
|
| 706 |
column_order=["Select", "Material Name", "Abbreviation", "Class", "Actions"],
|
| 707 |
column_config={
|
|
|
|
| 370 |
|
| 371 |
|
| 372 |
def toggle_class(material_class: str):
|
| 373 |
+
if st.session_state.active_classes == [material_class]:
|
| 374 |
+
st.session_state.active_classes = []
|
|
|
|
| 375 |
else:
|
| 376 |
+
st.session_state.active_classes = [material_class]
|
|
|
|
|
|
|
|
|
|
| 377 |
st.session_state.current_page = 0
|
| 378 |
|
| 379 |
|
|
|
|
| 697 |
key=f"materials_editor_{st.session_state.current_page}",
|
| 698 |
use_container_width=True,
|
| 699 |
hide_index=True,
|
| 700 |
+
height=min(50 * 46 + 40, 2000),
|
| 701 |
row_height=46,
|
| 702 |
column_order=["Select", "Material Name", "Abbreviation", "Class", "Actions"],
|
| 703 |
column_config={
|