从剪贴板粘贴到 Flex 4 DataGrid 单元格中
我希望允许我的应用程序的用户单击 Flex 4 DataGrid 中的单元格,然后按 Ctrl-V 将剪贴板的内容粘贴到当前单元格及其下方的单元格中。基本上,我想要做的是从 Excel 中的单个列中选择一些值并将其粘贴到 DataGrid 中的单个列中,这是一个 Web 应用程序,而不是 Air 应用程序。有没有关于如何执行此操作的示例?
我可以使用键盘处理程序事件获取剪贴板的内容,但我不确定如何禁用 DataGrid 的默认粘贴功能。默认功能是将剪贴板的所有内容粘贴到选定的单元格中。我希望它从我选择的单元格开始粘贴到多个单元格中。
任何帮助将不胜感激!
谢谢, 史蒂夫
I want to allow the users of my application to click on a cell in a Flex 4 DataGrid and hit Ctrl-V to paste the contents of the clipboard into the current cell and the cells below it. Basically, what I want to do is select some values from a single column in Excel and paste into a single column in the DataGrid, and this is a web application, not an Air app. Is there an example anywhere of how to do this?
I can grab the contents of the clipboard using keyboard handler events, but I'm not sure how to disable the default paste functionality of the DataGrid. The default functionality is to paste all of the clipboard contents into the selected cell. And I want it to paste into multiple cells starting with the one I have selected.
Any help would be appreciated!!
Thanks,
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要做的就是检测哪个单元格处于活动状态,然后您必须捕获 ctrl v。
然后,您需要询问剪贴板并手动计算出意图,然后设置相关的单元格值。
另一种选择是询问剪贴板,然后集成到数据提供者。
请参阅此示例:http://hillelcoren.com /2009/09/17/导入-导出-复制-粘贴-flex-datagrid/
What you would do is detect which cell is active, you would then have to catch the ctrl v.
You then need to interrogate the clip board and work out the intent manually, and then set the relevant cell values.
The other option is to interrogate the clip board and then integrate to the data provider.
Please see this sample: http://hillelcoren.com/2009/09/17/import-export-copy-paste-flex-datagrid/