数据网格中使用的自定义 itemEditor 组件中的奇怪复制/粘贴行为
我正在向你们寻求答案,因为这真的让我大吃一惊......让我解释一下:
我正在使用稍微修改过的 Spark NumericStepper 作为数据网格中的项目编辑器。我必须修改原始版本,因为由于某种原因它的值最多只能达到 10。
所以我像这样扩展了 NumericStepper:
<?xml version="1.0" encoding="utf-8"?>
<mx:NumericStepper xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
maximum="100000000">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</mx:NumericStepper>
并在我的 Datagrid 列声明中像这样使用它:
<mx:DataGridColumn dataField="cost" itemEditor="package.to.custom.NumericStepper" editorDataField="value"/>
到目前为止,一切正常。 Valeus 已完美更新。
现在,当我填充数据网格并使用 ctrl+v 在编辑器中粘贴值时,值会加倍(粘贴“123”会产生“123123”)。但是,当通过右键单击菜单项“粘贴”(这是一个 AIR 应用程序)进行粘贴时,一切正常(粘贴“123”会显示“123”)。
我对这种行为感到困惑。我在组件声明中做错了什么吗?或者在数据网格中使用它的方式?为什么两种粘贴方法会给出不同的结果?
如果能对此事有所了解,我将不胜感激。
I'm turning to you folks for answers because this really blows my mind... Let me explain:
I'm using a slightly modified spark NumericStepper as an item editor in a datagrid. I had to modify the original because for some reason it's values only went up to 10.
So i extended NumericStepper like so:
<?xml version="1.0" encoding="utf-8"?>
<mx:NumericStepper xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
maximum="100000000">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</mx:NumericStepper>
And used it like this in my Datagrid column declaration:
<mx:DataGridColumn dataField="cost" itemEditor="package.to.custom.NumericStepper" editorDataField="value"/>
Up to here, everything normal. Valeus are perfectly updated and all.
Now when I was filling the datagrid and using ctrl+v to paste values in the editor, the values get doubled (pasting '123' yields '123123'). When pasting through the right-click menu item "Paste" (It's an AIR app), though, everything works perfectly (pasting '123' shows '123').
I'm puzzled by this behavior. Have I done something wrong in the declaration of the component? or in the way it is used in the datagrid? And why do both paste methods give different results?
I'd appreciate any light shed on this matter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人仍然遇到这个问题(该问题存在于所有 mx NumericSteppers 上),Adobe 必须说的是:
https://bugs.adobe.com/jira/browse/SDK-18278
If anyone is still having this problem, which exists on all mx NumericSteppers, here is what Adobe had to say:
https://bugs.adobe.com/jira/browse/SDK-18278