PDA

View Full Version : Sharing Store acorss views



webfriend13
7 Mar 2012, 2:36 AM
HI All,

I have a view which shows a grid and a button. On click on button I open a pop-up window (another view). Here I perform some manipulation (through UI) and create a store. On close of this window (pop-up window), I want to pass this store to the main view. How can I acheive this.

Thanks in advance

chramer
7 Mar 2012, 3:47 AM
you can pass it as an object property :


var mywindow = Ext.create('Ext.window.Window', {
title : 'Main Window',
width : 600,
height : 400,
buttons : [{
text : 'Open popup',
handler : function() {
Ext.create('Ext.window.Window', {
title : 'Popup Window',
width : 300,
height : 200,
modal : true,
buttons : [{
text : 'Close Window',
handler : function() {
var store = "something";
mywindow.passStore = store;
this.up('window').close();
}
}]
}).show();
}
},{
text : 'Store from popup',
handler : function() {
alert(mywindow.passStore);
}
}]
}).show();