将参数传递给ExtJs 6中的窗口? [英] Passing arguments to a window in ExtJs 6?

查看:48
本文介绍了将参数传递给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.

我的建议是确保使用 show 事件,这是一个小提琴:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆