I have such a modal implementation and it works very well. I want to apply some controls for example for scrolling but I cant figure it out how to.
# Callback that will open the modal when the button is clicked
def modal_callback2(event):
# modal content here
# Add content to the modal area
template.modal[0].controls(jslink=True)
template.modal[0].clear()
template.modal[0].append(chat_interface)
template.open_modal()
# Link the button to the callback and append it to the sidebar
modal_btn.on_click(modal_callback2)
how can I set Scroll to both-auto?
in the Modal constructor you can add scroll="both-auto" but I am trying to get this to work with a template and am having a hard time as well
...
def __panel__(self):
modal = pn.Modal(
self.file_input_a,
self.load_file_button_a,
self.file_status_a,
self.file_tabulator_a,
self.file_input_b,
self.load_file_button_b,
self.file_status_b,
self.file_tabulator_b,
self.cmap,
self.plot_button,
name='FST RecComp Select / Configuration',
width=1100,
scroll="both",
)
toggle_button = modal.create_button("toggle", name="Select / Configuration")
main_content = pn.Column(
self.dataset_container,
modal,
sizing_mode="stretch_width",
)
return pn.template.MaterialTemplate(
title="App",
header=toggle_button,
main=main_content,
)
Mr. @Marc do you know if there is a way to add the modal_content directly to the template constructor and have the button to toggle it be in the header?