MVC architectural pattern is introduced in ExtJS from version 4. The 5-th version added the support of MVVC. These patterns gave a birth to so called Fat Stupid and Ugly Controllers. FSUC and God View Objects makes the code highly complicated.

All the business logic must be developed in models (records), stores and view-models. If your logic belongs to single record, put it there. In case it manipulates multiple instances, put it in the store. The other code must be presented in the model-views.

Let’t develop a simple application which will show users in a grid and let us make presents for users in single and batch modes.

Our user model will be able to make a present to a single user.

The store will have a method to make presents in batch mode.

I also would like to draw your attention on the toolbar of the grid. It does not know anything about parent element.

The communication between the toolbar and the parent grid is produced via the events in the controller.

As you can see I am not using inter-controllers communication and  strongly suggest you to minimize the usage of this technology.

In the column model of the grid the renderers and other helping function are moved to separate methods of the class to avoid monster configurations which are not so readable.

And the thin grid controller.