PDA

View Full Version : showing a popup windows on combobox item selected using mvc architecture



sreenatht
29 Feb 2012, 2:53 AM
please help...
The below is my popup - view code




Ext.define('Myapp.view.crmpopup', {
extend: 'Ext.Window',
Title: 'Add Question',
alias: 'c',
width: 600,
height: 300,
closable: false,
resizable: false,
autoScroll: true,
fbar: [{
text: 'Ok, I got it',
handler: function () {
Ext.getCmp('crmpopup').close();
}
}]
});

crmpopup.show();


the below is combobbox- controller code



Ext.define('Myapp.controller.crmTypes', {
extend: 'Ext.app.Controller',

refs: [{
ref: 'crmTypes',
selector: 'crmTypes'
}, {

ref: 'crmpopup',
selector: 'crmpopup'
}],


models: ['crmTypes'],
// stores: ['crmTypesStore'],
views: ['crmTypes'],


init: function () {
// Listen for the select event on the NewStation combobox
this.control({
'crmTypes': {
select: this.onNewcrmTypeSelect
}
});

},



onNewcrmTypeSelect: function (field, selection) {

var selected = selection[0];
var cId = selected.data.id;
// this.crmTypes.show();
//this.application.fireEvent('crmTypeStart', selection[0]);

//var QpopUp1 = Ext.Widget("widget.crmpopup");

//crmpopup.show();

}

});

mitchellsimoens
29 Feb 2012, 7:30 AM
You Myapp.view.crmpopup class is not proper. The class name should be Myapp.view.Crmpopup and the alias needs to be 'widget.c' but I would use something more than 'c' to be more descriptive.