Flex 项目渲染器中的 2 个数字步进器组件

发布于 2024-07-26 11:59:00 字数 159 浏览 6 评论 0原文

我必须将 2 个数字步进器组件放入数据网格的一列中。 我想我需要为此编写自己的项目渲染器代码。 如何编写代码将 2 个数字步进器组件放入一列数据网格中。

2 个数字步进器将用作时间(小时和分钟)组件。 我无法轻松使用可用的时间组件,因此必须为我自己的时间组件编写上述内容。

I have to put 2 numeric stepper components in one column of a datagrid. I suppose I need to write my own item renederer code for that. How to write a code for putting 2 numeric stepper components in one coulmn of datagrid.

The 2 numeric steppers would work as time (Hour and Min) components. I cannot use readily availabel time components, and hence have to write something of the above for my own time component.

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

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

发布评论

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

评论(3

烂柯人 2024-08-02 11:59:00

没错,您需要创建一个项目渲染器。 对于 Flex,这相对容易。

这里是一篇有关如何操作的文章它。

That correct, you need to create an item renderer. With Flex, this is relatively easy.

Here is an article on how to do it.

橘虞初梦 2024-08-02 11:59:00

尝试这样的事情

<mx:DataGridColumn headerText="Unit Price" dataField="price">
    <mx:itemRenderer>
        <mx:Component>
            <mx:NumericStepper ... />
            <mx:NumericStepper ... />
        </mx:Component>
    </mx:itemRenderer>
</mx:DataGridColumn>

或者您可以将 itemRenderer 设置为自定义组件

,即

<mx:DataGridColumn itemRenderer="com.myComponent" headerText="Unit Price" dataField="price">

(请注意,您可能需要 {com.myComponent} ...不确定语法,只是忘记了记忆)

对于您的具体示例,我可能会使用像 ##:## 这样的掩码创建自己的组件,然后将其用作项目渲染器。

Try something like this

<mx:DataGridColumn headerText="Unit Price" dataField="price">
    <mx:itemRenderer>
        <mx:Component>
            <mx:NumericStepper ... />
            <mx:NumericStepper ... />
        </mx:Component>
    </mx:itemRenderer>
</mx:DataGridColumn>

Or you could set the itemRenderer to a custom component

I.E.

<mx:DataGridColumn itemRenderer="com.myComponent" headerText="Unit Price" dataField="price">

(note you might need {com.myComponent} ... not sure on the syntax, just going off memory)

For your specific example I would probably create my own component with a mask like ##:## then use that as the item renderer.

无所的.畏惧 2024-08-02 11:59:00

Peter Ent 关于 itemRenderers 的系列是任何 Flex 开发人员的必备之作。

Peter Ent's series on itemRenderers is a MUST for any Flex developer.

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