I am really new to the MVC pattern in Ext. I have a tabpanel with several instances of the same component (let its product be called), everyone should call the server when it is opened with the id parameter.
Right now, to create these tabs - I use this in the Product controller. What creates a new instance of the view, but I feel that it is really wrong.
createMainView: function (opts) { return Ext.widget("productDisplay", opts); }
I call this from my "main" controller, for example:
var tab = this.application.getController("Products") .createMainView({ productId : id, closable: true }) tabs.add(tab); tabs.setActiveTab(tab);
What is the correct way to correctly use multiple instances of a view, each of which has an instance of the same repository and behavior (via the controller).
Can I use a single named store for them (with the js file in app / store / product.js)?
Should I manually call load
in the storage from the controller (to pass productId
) or is there a better way?
source share