1. #1
    Sencha Premium Member RiaanSA's Avatar
    Join Date
    Mar 2012
    Location
    Centurion South Aftica
    Posts
    70
    Vote Rating
    0
    RiaanSA is on a distinguished road

      0  

    Default How to set default drop in TreePanel to always be "root" node?

    How to set default drop in TreePanel to always be "root" node?


    What I have is 2xTreePanel with drag & drop controls.

    Now my idea is to prevent users from dropping the tree nodes anywhere else except on the root node.

    I have managed to get around that problem by using a listener.

    Example.
    Code:
    listeners: {
     beforedrop: function(node, data, overModel, dropPosition, dropFunction, eOpts ) {
         if ( !overModel.isRoot() ) {
             Ext.example.msg('<p style="color:red;"><b>Error on Drop</b></p>', 'Please drop data on top only');
             return false;
         }
     }
    This works well but is there not a more effective solution. For example set the root node to "root" if it's not the root?

    That means I can allow drop of data anywhere and it will always display correctly.

    Thanks for all the help.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,652
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can I get you to clarify your intention. I am not sure what you mean in your 'root' statement.

    Scott.

  3. #3
    Sencha Premium Member RiaanSA's Avatar
    Join Date
    Mar 2012
    Location
    Centurion South Aftica
    Posts
    70
    Vote Rating
    0
    RiaanSA is on a distinguished road

      0  

    Default


    Hey,

    Example.PNG

    Here I have a drag drop in 2 tree views.

    What I mean about the "root" nodes it will be "Available" and "Selected" node.
    So if you drag and drop from left to right and yo don't drop it on "Selected" node it will give you an error message plus move the node back to "Available"
    But I want to user to be able to drop the selection anywhere on the right hand side, even in the white space and it will automatically accept and display it as if you dropped it on "Selected" root node.

    Hope this explains my issue better.

    Riaan

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,652
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Are you referring to something like allowContainerDrop

    Scott.

  5. #5
    Sencha Premium Member RiaanSA's Avatar
    Join Date
    Mar 2012
    Location
    Centurion South Aftica
    Posts
    70
    Vote Rating
    0
    RiaanSA is on a distinguished road

      0  

    Default


    Partially yes.

    allowContainerDrop is suppose to allow me to drop in the white space. ( Does not always work )

    But eventually should I drag "MARINERS_MINE" from the top picture on the left and drop it into the white space on the right.

    Then it should automatically pick up that it was not dropped on "Selected" node and change "MANIRERS_MINE" root node to "Selected" and display it as the picture indicate below.

    Capture.PNG

    Riaan

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar