将参数传递给ExtJs 6中的窗口? [英] Passing arguments to a window in ExtJs 6?
问题描述
我想将记录从网格传递到我创建的窗口,
I would like to a pass a record from a grid to a window that I create,
Ext.create('MyWindow',
{recordRef: record}).show();
其中 record
是传递给我的 rowdblclick
函数的参数,但是当我在调试过程中尝试访问 recordRef
(如下所示)时,它是未定义的.
where record
is an argument that is passed into my rowdblclick
function but when I try to access recordRef
(like below) during debugging, it is undefined.
var me = this;
var record = me.getView().recordRef;
上面的代码片段在 MyWindow.js
推荐答案
发生这种情况的原因可能是因为您正在使用事件来访问在构造函数分配之前调用的
作为属性添加到您的窗口. recordRef
recordRef
The reason this is happening is probably because you are using an event to access recordRef
that is called before the constructor assigns recordRef
to your window as a property.
My advice would be to use the show
event just to be sure, here is a fiddle: https://fiddle.sencha.com/#view/editor&fiddle/232m
这篇关于将参数传递给ExtJs 6中的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!