-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewController companions #130
Comments
This looks implemented in DeftJS5? |
The logic I was building for Deft 0.9.x is there in the Deft 5 code, but I don't think it's going to work due to the way Ext 5 locates event listeners. Listeners are located by finding the "nearest" referenceHolder for the component (which would typically be the ViewController). That means additional handlers defined on the companion VCs would never be fired. I don't think there's a way around this without some serious mucking around with the underlying Ext 5 event system. |
I noticed your implementation trying to understand how Deft integrates with the new Ext VCs. Was the idea that each controller would handle a behavior—like an |
The way I had it working in my 0.9.x feature branch was that you could basically associate additional view controllers with the "primary" view controller for a view. So additional logic and view event listeners could be attached, allowing common/cross-cutting logic to be shared. Since they remain encapsulated as separate view controllers, there was no danger of method names or anything else conflicting. It also meant that any view controller could act as either a primary VC or be attached as a companion VC. It was actually a pretty cool design if I do say so myself. ;-) Unfortunately, as I said, with the change to how listeners are handled in Ext 5, I think the whole idea has to be jettisoned. When we were actually setting up listeners on the view to trigger VC handler methods, this was fine. Now that Ext 5 uses event handlers that are located at the time the event fires by looking only for the first reference holder, I don't see any way to get event handler methods defined in the companion VCs to be invoked. :-/ |
Allow view controllers to share behavior with other view controllers.
The text was updated successfully, but these errors were encountered: