PDA

View Full Version : Best practise for concrete example



pzs2
8 Jul 2014, 3:05 AM
Hi,

I'm wondering best practise and recommendations about a concrete example:
The user can select timezone in the menu and when select one, we have to refresh about 4-6 grid's view and refresh/run small custom logic on some other components.

We think:
- app level events, but if we use this, then we have to write listeners for every grid
- custom property for these grids and using component query to select all this grids and run view.refresh()
- custom method for other components and call this directly (and query these components by ComponentQuery)

But we don't know, what would be the best and elegant solution.

We use currently ExtJS 4.2, but we interesting in ExtJS 5.0, too.

mitchellsimoens
16 Jul 2014, 10:46 AM
I personally have been firing events in a controller and having other controllers listen for those events. This works in Ext 4.2 and Ext 5 an din Ext 5 it works in ViewControllers also.

So in Ext 5 if each grid has a ViewController then the ViewController can listen for an event and reload the store on that grid. This is also a scalable way of handling it.