Results 1 to 3 of 3

Thread: Copying Ext.tree.plugin.TreeViewDragDrop settings for a Container

  1. #1
    Sencha User
    Join Date
    Jan 2015
    Location
    Vancouver, BC
    Posts
    5
    Answers
    1

    Default Copying Ext.tree.plugin.TreeViewDragDrop settings for a Container

    Hi guys,

    Question:
    Where are the drop event handlers that make Ext.tree.plugin.TreeViewDragDrop configured?

    Details:
    I love how beautifully Ext.tree.plugin.TreeViewDragDrop works on Ext.tree.Panel's. I don't have to configure anything after I "plug" it into my tree panels.

    However, I have a situation where I'm using an Ext.container.Container to hold items instead of a tree! I would like to build a similar plugin to that of TreeViewDragDrop but for a container instead of a tree.

    I would like to know where the drop event handlers are configured that make TreeViewDragDrop so awesomely smooth and wonderful to use. I'd like to copy those settings.

  2. #2
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    You could always just view the source of Ext.tree.plugin.TreeViewDragDrop.

    Code:
        onViewRender : function(view) {        var me = this,
                scrollEl;
    
    
            if (me.enableDrag) {
                if (me.containerScroll) {
                    scrollEl = view.getEl();
                }
                me.dragZone = new Ext.tree.ViewDragZone({
                    view: view,
                    ddGroup: me.dragGroup || me.ddGroup,
                    dragText: me.dragText,
                    displayField: me.displayField,
                    repairHighlightColor: me.nodeHighlightColor,
                    repairHighlight: me.nodeHighlightOnRepair,
                    scrollEl: scrollEl
                });
            }
    
    
            if (me.enableDrop) {
                me.dropZone = new Ext.tree.ViewDropZone({
                    view: view,
                    ddGroup: me.dropGroup || me.ddGroup,
                    allowContainerDrops: me.allowContainerDrops,
                    appendOnly: me.appendOnly,
                    allowParentInserts: me.allowParentInserts,
                    expandDelay: me.expandDelay,
                    dropHighlightColor: me.nodeHighlightColor,
                    dropHighlight: me.nodeHighlightOnDrop,
                    sortOnDrop: me.sortOnDrop,
                    containerScroll: me.containerScroll
                });
            }
        }
    Regards,
    Brian

  3. #3
    Sencha User
    Join Date
    Jan 2015
    Location
    Vancouver, BC
    Posts
    5
    Answers
    1

    Default

    Thanks lumberjack! But I already found my own way of doing it and it is beautiful. I'm going to ask my boss if I can share it with you guys. Probably won't be able to though.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •