I'm unable to send data to a new window in extjs. Following the answer to this question, I've set a window property to the value I need in the new window:
function OpenAddSampleWindow(datasetid)
{
var VIEW_WIDTH = $(window).width(); // returns width of browser viewport
var VIEW_HEIGHT = $(window).height(); // returns height of browser viewport
win = Ext.create('widget.window', {
title: 'Add Sample',
id: 'AddSampleWindow',
closable: true,
closeAction: 'destroy',
width: VIEW_WIDTH,
minWidth: 600,
height: VIEW_HEIGHT,
minHeight: 400,
modal: true,
layout: 'fit',
items : [{
xtype : "component",
autoScroll: true,
autoEl : {
tag : "iframe",
src : "sample_add.html"
}
}]
});
win.datasetid=datasetid;
win.show();
return win;
}
Then, the javascript for the new window has the following function that runs when the page loads:
Ext.onReady(function(){
alert(window.datasetid);
});
all that shows up in the alert box is "undefined" I've also tried win.datasetid, but then I get an error that win is undefined.
What am I doing wrong? How can I access this data?
debugger;
statement above the log statement and explore thewin
object. – Francis DucharmejavascriptFunction(win.myExtraParams.a, win.myExtraParams.b);
? – Francis Ducharme