I'm starting application development in extjs. I am using the MVC approach as provided in the extjs documentation .
I have dynamic data that should present the user with a set of accordion controls. I have data in the store, but I donβt know how to dynamically create accordion elements (unlike the grid panels, there seems to be no storage data method).
Here is my current accordion representation code - with static elements:
Ext.define('BP.view.induction.LeftPage', { extend: 'Ext.Panel', alias : 'widget.leftpage', title: "Left Page", layout: { type: 'accordion', align: 'stretch' }, layoutConfig: { // layout-specific configs go here titleCollapse: true, animate: true, activeOnTop: true }, items: [{ xtype: 'panel', // fake hidden panel, so all appear collapsed hidden: true, collapsed: false },{ xtype: 'panel', title: 'Panel 1', html: 'Panel content!' },{ xtype: 'panel', title: 'Panel 2', html: 'Panel content!' },{ xtype: 'panel', title: 'Panel 3', html: 'Panel content!' }] });
Any recommendations on how to achieve the above will be appreciated, thanks.
[Edit] In response to the sra request, here is my controller:
Ext.define('BP.controller.Induction', { extend: 'Ext.app.Controller', views: [ 'induction.Binder' ], stores: [ 'Sections', 'Categories', 'Tasks' ], init: function() { console.log('Initialized Induction!'); } });
Here I should note that this controller loads the parent view, which in turn loads the LeftPage view - I'm not sure if this creates any problems with the scope definition. In addition, as you can see, several repositories are loaded.