TL;DR How to temporarily disable a View so I can safely load another View, then safely close the loaded View to return to the original View?
I have the following scenario:
- User opens
/searchwhich loadsSearchView. - User clicks a button to perform search.
- Collection inside
SearchViewis filled with data, UI is updated to reflect that. - User clicks a result item.
SearchViewis disabled (only need to disableevents?).ItemViewis loaded, displaying the item detail.- User clicks a button to close
ItemView. SearchViewis re-enabled.
What is the best way to achieve point 5 and 8? I’m thinking of calling SearchView.unbind() (for point 5) and SearchView.bind() (for point 8).
Bonus: It would be better if the solution is stack-like. I.e. View A loads View B which can load View C. When View C is closed, View B is reinstated, etc.
Try calling
SearchView.undelegateEvents()for point 5, and thenSearchView.delegateEvents()for point 8.