开发者

Drag&Drop in Advanced DataGrid

I have a Advanced DataGrid for displaying the num开发者_StackOverflow中文版ber of rows from the Database and one row strictly should not allowed drag option. Is is possible? Please share one sample example.


Of course this is possible. Add a dragEnter Handler to your datagrid:

<mx:AdvancedDataGrid id="adg" dragEnabled="true" dragEnter="adg_dragEnterHandler(event)" />

With the following code:

protected var _draggedItem:Object;

            protected function adg_dragEnterHandler(event:DragEvent):void
            {
                event.preventDefault();
                event.currentTarget.hideDropFeedback(event);

                var items:Array = ds.dataForFormat("items") as Array;
                if (items != null && items.length > 0 && (items[0] is CategoryVO)) {
                    _draggedItem = Object(items[0]);
                }

                // Prevent item from being dragged
                if (_draggedItem.property == true) {
                    DragManager.showFeedback(DragManager.NONE);
                    return;
                }

                DragManager.acceptDragDrop(UIComponent(event.currentTarget));

            }

_draggedItem.property == true is the check, if an item can't be dragged.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜