Flex 项目渲染器 - 如果为 null,则不包含元素?
我有这样的项目渲染器代码:
<s:HGroup>
<s:Label text="{data.DateTime}"/>
<s:VGroup>
<s:Label text="{data.Description}"/>
<s:Label text="{data.Amount}"/>
</s:VGroup>
</s:HGroup>
描述是一个可选字段。我希望如果“描述”字段为空,“金额”字段就会向上移动,但现在只有一个空白区域。 mxml 有什么办法可以实现这一点吗?我希望它们位于单独的字段中,因为我计划使“描述”可编辑,但“金额”是固定的。
I have item renderer code like this:
<s:HGroup>
<s:Label text="{data.DateTime}"/>
<s:VGroup>
<s:Label text="{data.Description}"/>
<s:Label text="{data.Amount}"/>
</s:VGroup>
</s:HGroup>
Description is an optional field.. I would like if the Description field is null for the Amount field to move up, but right now there is just an empty space. Is there any way to achieve this in mxml? I want them in separate fields because I plan to make the Description editable, but the Amount fixed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我编写了一个简单的应用程序来模拟项目渲染器的行为。
诀窍是使用 visible 和 includeInLayout 属性:
I wrote simple application that simulates a behaviour of Item renderer.
The trick is to use visible and includeInLayout properties: