EasyUI Forum
November 05, 2025, 03:39:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: Tree: Getting new parent on drop on: September 25, 2012, 05:39:26 AM
okay, I got it:

Code:
            onDrop: function(target,source,point){
                var idParentCategory;
                if(point == "append") {
                    idParentCategory = $(this).tree('getNode',target).id
                } else {
                    if($(this).tree('getParent',target) === null) {
                        // is root
                        idParentCategory = 0;
                    } else {
                        idParentCategory = $(this).tree('getParent',target).id
                    }
                }
                console.log(idParentCategory)
}

Thank u all Wink
2  General Category / EasyUI for jQuery / Re: Tree: Getting new parent on drop on: September 21, 2012, 02:18:18 AM
Nobody knows how to?  Cry
3  General Category / EasyUI for jQuery / Tree: Getting new parent on drop on: September 19, 2012, 12:51:44 AM
Hi,

I'm trying to get the id of the new parent node of the element that has been dropped. The further thing I've got is this:

Code:
onDrop: function(target, source, point) {
    $(this).tree('getNode',target).id;
}

Which gets the ID of the drop target, but not always is the parent, It may be a sibling when it is dropped next to it.

Thanks,
xavi
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!