The wizard is functionally complete and it's time to show how we can embed it in an application. Look back and you'll see that the main wizard component had the following load
method:
load: function(id) { this.getViewModel().setLinks({ questionnaire: { type: 'Wizard.model.Questionnaire', id: id } }); }
This uses the links
feature of the view model to trigger the loading of a questionnaire using its preconfigured proxy. With this in mind, the calling code could look like this:
Ext.define('Questions.view.main.MainController', { extend: 'Ext.app.ViewController', requires: [ 'Wizard.view.wizard.Wizard' ], alias: 'controller.main', listen: { controller: { 'wizard': { 'wizardcomplete': function(q) { console.log(q); } } } }, onClickButton: function () { this.wizard = Ext.create('Ext.Window', { ...