在 Flex 数据网格中拖放问题
我正在两个数据网格之间执行拖放操作,其中一个项目可以根据某些处理与另一个项目替换/合并。 为此,我需要了解某些事件:
- 哪个事件将为我提供有关我要在其中放置项目的单元格的信息。
- 如果我知道我的拖动对于特定条件无效,我如何取消拖动操作。
谢谢各位...
I am performing a drag and drop between 2 datagrids where one item could replace/merge with another item based on some processing.
for this, I need to know about certain events:
- Which event will give me information about the cell in which I am going to drop a item.
- How could I cancel the dragged operation if I know that the my drag was invalid for a particular condition.
Thanks guys...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1) 使用 myDatagrid.calculateDropIndex(DropEvent) 计算出用户放置对象的数据网格的索引。您可能会在数据网格上的拖放事件上执行此操作。
2)这很简单,在您的dragDrop事件处理程序上,检查绑定到DataGrid的数据源是否有您正在寻找的任何条件。如果满足不允许的条件,则只需不要对数据源执行任何逻辑即可。
1) Use myDatagrid.calculateDropIndex(DropEvent) to figure out the index of the datagrid where the person is dropping the object. You'll probably do this on the dragDrop event on your datagrid.
2) This is easy, on your dragDrop event handler, do a check against the data source bound to your DataGrid for whatever condition you are looking for. If the condition to not allow is met, simply don't do any logic on your data source.