Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    57
    Vote Rating
    1
    MickeyMiner is on a distinguished road

      0  

    Default TreePanel drag and drop element into element without any children

    TreePanel drag and drop element into element without any children


    Hi,

    I have a simple TreePanel where all nodes/elements are based on the same class called "Person". Within this simple TreePanel I try to drag and drop one element into an element that has no children yet. How do I do it?

    If a node has some children, it is no problem to drop inside other persons. However one can not drop an element into an "empty" person. How do I drop "Son 1" to "Father 1"?

    Code:
    +- Root person
         |
         +- Father 1
         |
         +- Father 2
            |
            +- Son 1
            |
            +- Son 2
    PHP Code:
    public class Person extends BaseTreeModel {

        public 
    Person() {

        }
        
        public 
    Person(String idString name) {
            
    setIdentNr(id);
            
    setSortName(name);
        }
        
        public 
    String getId() {
            return (String) 
    get("id");
        }

        public 
    void setId(String id) {
            
    set("id"id);
        }

        public 
    String getName() {
            return (String) 
    get("name");
        }

        public 
    void setName(String name) {
            
    set("name"name);
        }
        

    PHP Code:
    public class FamilyTree extends ContentPanel {

        
    FamilyTree() {

            
    setHeading("Family");
            
    setLayout(new FitLayout());

            
    Person r = new Person("0""Root person");
            
    Person f1 = new Person("1""Father 1");
            
    Person f2 = new Person("2""Father 2");
            
    Person s1 = new Person("3""Son 1");
            
    Person s2 = new Person("4""Son 2");

            
    f2.add(s1);
            
    f2.add(s2);
            
    r.add(f1);
            
    r.add(f2);
            
            
    TreeStore<Personstore = new TreeStore<Person>();
            
    store.add(rtrue);

            
    TreePanel<Persontree = new TreePanel<Person>(store);
            
    tree.setDisplayProperty("name");
            
    tree.expandAll();
            
    tree.setContextMenu(contextMenu);

            
    DNDListener listener = new DNDListener() {
                @
    SuppressWarnings("unchecked")
                @
    Override
                
    public void dragStart(DNDEvent e) {
                    
    TreePanel tree = ((TreePanele.getComponent());
                    
    Person sel = (Persontree.getSelectionModel().getSelectedItem();
                    if (
    sel != null && tree.getStore().getParent(sel) == null) {
                        
    e.setCancelled(true);
                        
    e.getStatus().setStatus(false);
                        return;
                    }
                    
    super.dragStart(e);
                }
            };
            
    TreePanelDragSource source = new TreePanelDragSource(tree);
            
    source.addDNDListener(listener);

            
    TreePanelDropTarget target = new TreePanelDropTarget(tree);
            
    target.setAllowSelfAsSource(true);
            
    target.setFeedback(Feedback.BOTH);

            
    add(tree);

        }

    Thank you for your help.

    mm

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    joseblas is on a distinguished road

      0  

    Default did you solve it?

    did you solve it?


    Hi,

    I have the same problem, did you solve it?

Thread Participants: 1