Flex 3 自定义 ItemRenderer 和编辑器问题

发布于 2024-08-21 11:55:34 字数 235 浏览 5 评论 0原文

我创建了一个自定义 ItemRenderer 来扩展 UIComponent 并实现 IListItemRenderer。该渲染器包含一个文本对象来显示值。

对于编辑,我使用标准 ItemEditor (TextInput)。

现在,当我想编辑一个值时,我单击一个单元格,然后创建编辑器。但显示的不是渲染器中显示的值,而是“[object Object]”。

有人知道为什么并且可以在这里帮助我吗?会很棒的!

I've created a custom ItemRenderer extending UIComponent and implementing IListItemRenderer. This renderer contains a Text-Object to display the value.

For editing I'm using the standard ItemEditor (TextInput).

Now, when I want to edit a value, I click on a cell and the editor is created. But instead of displaying the value which was displayed in the renderer, "[object Object]" is displayed.

Does someone know why and can help me out here? Would be awesome!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜中书 2024-08-28 11:55:34

听起来好像 itemRenderer 的 labelField 设置为数据/对象本身而不是对象的属性。确保您已指定 labelField 并且您的 TextArea#text 属性设置为 data.property 而不是 data >。这是因为

var data:Object = new Object();
data.label = "Hello";
trace(data); // "[object Object]"
trace(data.toString()); // "[object Object]" 
trace(data.label); // "Hello";

希望有帮助,

It sounds like the labelField of your itemRenderer is set to the data/object itself rather than the property of the object. Make sure you have specified a labelField and that your TextArea#text property is set to data.property rather than data. This is because

var data:Object = new Object();
data.label = "Hello";
trace(data); // "[object Object]"
trace(data.toString()); // "[object Object]" 
trace(data.label); // "Hello";

Hope that helps,
Lance

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文