PDA

View Full Version : Passing arguments to window's Show event



drunkmoose
12 Jun 2014, 12:29 PM
Hello!

I'm trying to pass an argument (a gridview record gathered from the cellblclick event) to a window's show() event.

I think I will need to use delegate to do it:

http://stackoverflow.com/questions/690343/how-do-i-add-additional-parameters-to-an-extjs-handler

But I don't know how well it jives in MVC. I got my window defined in my view's physical file:



Ext.define('EditPortalUserWindow', {
alias: 'widget.EditPortalUserWindow',
extend: 'Ext.Window',
height: 400,
width: 400,
modal: true,
title; 'Bleh'
});


Then in my controler, in the celldblclick listener:



//record is an argument from the celldblclick event...
PortalUI.MainContent.Utilities.showEditUserWindow(record);

//showEditUserWindow does this:
Ext.widget('EditPortalUserWindow').show();


I am a little confused about the scoping between view/controller. Has anyone done this before ?

Thanks.

Using 4.2.1

drunkmoose
12 Jun 2014, 1:14 PM
Turns out you can simply do something as such:



var win = Ext.widget('EditPortalUserWindow');
win.whatEverData = 'Hello';
win.show();


Then you will be able to access "whatEverData" from the listeners' methods...