Results 1 to 6 of 6

Thread: How to disable the dragging after the tree build?

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51

    Question How to disable the dragging after the tree build?

    Hi,

    I'm using this code:
    Code:
    		new Ext.tree.TreePanel({
    			id: 'treePagesList',
    			viewConfig: {
    				plugins: {
    					ptype: 'treeviewdragdrop',
    					containerScroll: true
    				}
    			},
    			region: 'center',
    			border: false,
    			autoScroll:true,
    			animate:true,
    			ddConfig:true,
    			containerScroll: true,
    			rootVisible: false
    .....................
    .....................
    And after that I have a function that I want to disable the tree dragging.
    How can I do that?

    Thanks

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    If you're looking to remove the drag/drop functionality altogether you can use the plugin's destroy method:
    http://docs.sencha.com/extjs/4.2.0/#...method-destroy

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51

    Default

    Sorry but how do I write that? I don't understand the idea of the plugin.

  4. #4
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    When you configure the drag and drop plugin on your tree's view you can give it an ID like:

    Code:
    plugins: {
        ptype: 'treeviewdragdrop',
        pluginId: 'treedragdrop',
        containerScroll: true
    }
    Then you can do something like:

    Code:
    tree.getView().getPlugin('treedragdrop').destroy();
    That will destroy the drag and drop plugin and make it so that you can no longer drag / drop on that tree any longer.

  5. #5
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    51

    Default

    Thats work but what is want to disable the drag so I can enable it after that?
    I didn't find this option.

    Thanks

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    25

    Default

    I need an answer to that too!

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
  •