nzmehere
20 Jan 2012, 12:05 PM
Hi There,
I am finally digging to to ExtJS to a deeper level, and have come across an challange I just can't work out how to do...
I follow the example here: http://docs.sencha.com/ext-js/4-0/#!/guide/application_architecture
And I like the way you can pass the User interactions in the View back to the controller to handle.
The question I have is: how do I create a custom view event and get the controller to listen/react to this event?
EG:
Looking at this: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Action
In the example there, the "handler" function on the column performs the action, where (in keeping with MVC), is there an example where the event and data is passed back to the Controller for the action to be performed?
What I am after is:
- Have a Grid view. In that grid is an 'Action' column
- When the user clicks on that action column, the view announces a custom event (something like 'myColumnClicked')
- the Controller for that grid view listens for the 'myColumnClicked' event, gets the data from the event and then performs the required actions.
I'm sure this is possible and it's just my learning that is lacking...
Cheers
I am finally digging to to ExtJS to a deeper level, and have come across an challange I just can't work out how to do...
I follow the example here: http://docs.sencha.com/ext-js/4-0/#!/guide/application_architecture
And I like the way you can pass the User interactions in the View back to the controller to handle.
The question I have is: how do I create a custom view event and get the controller to listen/react to this event?
EG:
Looking at this: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Action
In the example there, the "handler" function on the column performs the action, where (in keeping with MVC), is there an example where the event and data is passed back to the Controller for the action to be performed?
What I am after is:
- Have a Grid view. In that grid is an 'Action' column
- When the user clicks on that action column, the view announces a custom event (something like 'myColumnClicked')
- the Controller for that grid view listens for the 'myColumnClicked' event, gets the data from the event and then performs the required actions.
I'm sure this is possible and it's just my learning that is lacking...
Cheers