I have a page that has a modal to display when clicked on an item.
No issue in displaying the modal with bootstrap.
Then I want to display dynamic data in the modal based on what item is clicked. I understand that jinja is a template that is rendered once so the click will not be regarded.
Hence I use js and frappe.call. No issue here. I get the callback to use in the modal.
But there are too many data/variables.
So I want to try alternative way which is separating the modal in other html file, create def get_context(context) in modal.py, and use jinja {{vars}} in the modal. Then using js to load the modal.html.
My problem is it seems the modal is not getting the context from the modal.py.
Hypothetically this should be a viable solution, shouldn’t it?
Is there any steps that I missed? Or is there any way to do it correctly?
displaying data in modal with js (get data via frappe.call) is no problem.
then I want to try an alternative by getting data via jinja, by separating the modal in other file modal.html which has modal.py to get_context. This scenario is not a success because the modal.html doesn’t seem to pick up the context.