PDA

View Full Version : controller for a panel in Extjs MVC



sreenatht
3 May 2012, 3:57 AM
shall we fire the panel items events in its controller? Also the expand collpase event can move to its controller in Extjs MVC

Tim Toady
3 May 2012, 6:06 AM
Can you clarify your question? I am not sure what you are asking.

sreenatht
3 May 2012, 9:11 AM
I am using extjs mvc archetecture. I wrote select event of combobox inside controller. so for a combobox I have view,store,model and controller. I have to write this combination for all the controls including panel. for the 'click' of the panel, expand/collapse of panel and the button inside the panel . The evnt i have to write in the controller.
for example if have a panel say

view-Pnluser
controller-usercontroller


I have to write click event of the 'pnluser' inside 'usercontroller'

Tim Toady
3 May 2012, 9:24 AM
You do not need a controller or view for every component. You should break it up into logical pieces. The view might contain a panel, combo, fields, etc and your controller would handle events for all those components. If you haven't already gone through the app architecture guide, I highly recommend it.
http://docs.sencha.com/ext-js/4-1/#!/guide/mvc_pt1

So yes, it would make sense to control the events of a combo in the same controller that controls the panel.