PDA

View Full Version : calling view page on window from controller after button click



msmohandg
23 Nov 2012, 6:37 AM
Hi All,

I am new to ExtJs, I need to show a popup window after a button click, Please look at the things I have done,

Controller: User.js

Ext.define('Complaints.controller.BusinessUnits',{
extend: 'Ext.app.Controller',

init: function(){
this.control({
'toolbar button': {
'click': this.openUserWindow
}
});
},

openUserWindow: function() {
// What should I do in this part? How can I show the userlist view page in a window?
}


});

View: UserList.js

Ext.define('Complaints.view.UserList', {
extend: 'Ext.window.Window',
alias: 'widget.userlist',
initComponent: function() {
layout: 'anchor',
resizable: true,
width: 800,
height: 600,
items: [ {
xtype: 'checkboxgroup',
fieldLabel: 'Review Complaints By',
cls: 'x-check-group-alt',
items: [
{boxLabel: 'Business Unit', name: 'businessunit-button', checked: true},
{boxLabel: 'Manufacturing', name: 'manufacturing-button'}
]
}];

});


thanks.

existdissolve
24 Nov 2012, 8:30 AM
You should be able to do something like:



openUserWindow: function(){
var thewindow = Ext.widget('userlist');
// show the window
thewindow.show();
}


Here's an example: http://jsfiddle.net/existdissolve/qtQWT/

Attari
2 Jan 2015, 1:21 PM
The above code worked, now the concern is how to display it as a pop-up