EasyUI Forum
May 08, 2024, 11:12:01 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Bug in draggable EasyUi 1.3.4  (Read 15053 times)
rafaelob
Newbie
*
Posts: 2


View Profile Email
« on: September 10, 2013, 12:01:53 PM »

Dear,

I have troubles with draggable in EasyUi 1.3.4:

This section of code works well in 1.3.3

Code:
 $('#tt').tree({
                url: 'tree.json',
                onLoadSuccess: function(node, data) {
                    $('.tree-node').draggable({
                        revert: true,
                        onStopDrag: function() {
                          //  $(this).css("position", "");
                        }
                    });}});

When the data is loaded, i put a draggable in nodes of tree(I dont want use the property dnd of tree, because that i want is move the nodes to outside of tree, not inside)

It was working in 1.3.3, but in 1.3.4 dont! I verified that the problem is inside the  file jquery.easyui.min, when i replace it for 1.3.3 version its works again. I dont know what has changed in this file of version 1.3.3 to 1.3.4, but some modifications broke the draggable, if i execute the code of draggable in console of firefox, not works too.(the .tree-node is a div, if a put the draggable in an element span inside the .tree-node, the draggable works in this element). I tested that draggable in 1.3.4 works well in other situations

(If i copy the html of an node of tree)    

Code:
<div class="tree-node" node-id="p3" style=""><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-indent"></span><span class="tree-icon tree-file icon-hard-hat-military"></span><span class="tree-title">1º Pel/1ª Cia/19º BC</span></div>

and execute  $('.tree-node').draggable( ); This element become a draggable, but the same element <div class="tree-node" ..... </div> inside of tree with class .tree-node doesnt become a draggable)

I dont know why its happens, if you reproduce this code you will verify the same problem, the nodes of tree doesnt become a draggable as in 1.3.3. As i said the problem is not in tree.js or draggable.js, but in jquery.easyui.min.

(Chrome, FireFox, IE last versions)
Regards,


tree.json


Code:
[
{
"id":"f1",
"text":"Exército",
"iconCls":"icon-star",
"attributes":{"root":true,"pelotao":false},
"children":[
{  
                            "id":"r1",
                            "text":"6ª RM",
                            "iconCls": "icon-home",
                            "attributes":{  
                                "pelotao": false              
                                },
                            "children":[{
                            "id":"o10",
                            "text":"19º Batalhão de Caçadores",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"c4",
                            "text":"1ª Cia/19º BC",
                            "iconCls":"icon-hard-hat",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"p3",
                            "text":"1º Pel/1ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p2",
                            "text":"2º Pel/1ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p4",
                            "text":"3º Pel/1ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        }]
                            
                        },{
                            "id":"c5",
                            "text":"2ª Cia/19º BC",
                            "iconCls":"icon-hard-hat",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"p5",
                            "text":"1º Pel/2ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p6",
                            "text":"2º Pel/2ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p7",
                            "text":"3º Pel/2ª Cia/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        }]
                            
                        },{
                            "id":"c6",
                            "text":"CCAp/19º BC",
                            "iconCls":"icon-hard-hat",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"p8",
                            "text":"1º Pel/CCAp/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p9",
                            "text":"2º Pel/CCAp/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        },{
                            "id":"p10",
                            "text":"3º Pel/CCAp/19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        }]
                            
                        },{
                            "id":"c7",
                            "text":"Cmdo 19º BC",
                            "iconCls":"icon-hard-hat",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"p11",
                            "text":"Cmdo/Cmdo 19º BC",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        }]
                            
                        }]
                            
                        },{
                            "id":"o4",
                            "text":"4ª Cia Gd",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"c2",
                            "text":"1ª Cia/4ª Cia Gd",
                            "iconCls":"icon-hard-hat",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[{
                            "id":"p1",
                            "text":"1º pel/1ª Cia/4ªCia Gd",
                            "iconCls":"icon-hard-hat-military",
                            "attributes":{  
                                "pelotao":  true            
                                },
                            "children":[]
                            
                        }]
                            
                        }]
                            
                        },{
                            "id":"o2",
                            "text":"51º CT",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o6",
                            "text":"6º D Sup",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o3",
                            "text":"Cia Cmdo/6",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o5",
                            "text":"Cia PE/6",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o1",
                            "text":"Comando da 6ª Região Militar",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o7",
                            "text":"EsAEx/CMS",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o8",
                            "text":"HGeS",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        },{
                            "id":"o9",
                            "text":"Pq R Mnt/6",
                            "iconCls":"icon-shield",
                            "attributes":{  
                                "pelotao":  false            
                                },
                            "children":[]
                            
                        }]
                        }
]
}
]


« Last Edit: September 10, 2013, 12:06:37 PM by rafaelob » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 10, 2013, 02:54:25 PM »

When using draggable on 'tree-node' elements, you need to set 'disabled' property to false to enable dragging.
Code:
$('.tree-node').draggable({
disabled:false,
revert:true
});
Logged
rafaelob
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: September 12, 2013, 05:32:00 AM »

Thks! its works!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!