EasyUI Forum
May 17, 2024, 04:18:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tree improvement: Disable some nodes  (Read 9549 times)
ryupanqui
Newbie
*
Posts: 44


View Profile Email
« on: May 23, 2014, 06:58:20 PM »

I'm using jQuery EasyUI 1.3.6 and I suggest that the tree has to include the editable field to indicate that some node is disabled changing its text color and not checkable or not clickable.

I applied part of my suggestion in this code part of function named _b8:
(Also see the result on the attached file)

Code:
bind("click", function(e) {
var tt = $(e.target);
var _bd = tt.closest("div.tree-node");
if (!_bd.length) {
return;
}
if (tt.hasClass("tree-hit")) {
_125(_b9, _bd[0]);
return false;
} else {
// - BEGIN EDIT

     var $tree = $(_b9);
var optsTree = $tree.tree('options');
                var node = $tree.tree('getNode', _bd[0]);

                if(node && node[optsTree.editableField] === false) return false;

// - END EDIT

if (tt.hasClass("tree-checkbox")) {
_e8(_b9, _bd[0], !tt.hasClass("tree-checkbox1"));
return false;
} else {
_16b(_b9, _bd[0]);
_ba.onClick.call(_b9, _c0(_b9, _bd[0]));
}
}
e.stopPropagation();
}

« Last Edit: May 23, 2014, 09:59:40 PM by roy.yupanqui » Logged
azizkhani
Newbie
*
Posts: 37


View Profile Email
« Reply #1 on: January 16, 2015, 05:19:59 AM »

I'm using jQuery EasyUI 1.3.6 and I suggest that the tree has to include the editable field to indicate that some node is disabled changing its text color and not checkable or not clickable.

I applied part of my suggestion in this code part of function named _b8:
(Also see the result on the attached file)

Code:
bind("click", function(e) {
var tt = $(e.target);
var _bd = tt.closest("div.tree-node");
if (!_bd.length) {
return;
}
if (tt.hasClass("tree-hit")) {
_125(_b9, _bd[0]);
return false;
} else {
// - BEGIN EDIT

     var $tree = $(_b9);
var optsTree = $tree.tree('options');
                var node = $tree.tree('getNode', _bd[0]);

                if(node && node[optsTree.editableField] === false) return false;

// - END EDIT

if (tt.hasClass("tree-checkbox")) {
_e8(_b9, _bd[0], !tt.hasClass("tree-checkbox1"));
return false;
} else {
_16b(_b9, _bd[0]);
_ba.onClick.call(_b9, _c0(_b9, _bd[0]));
}
}
e.stopPropagation();
}


hi ryupanqui
i have this problem too
i want to disabled some node for select or checked  Huh Huh Huh Tongue Tongue
how u solve your problem plz help me



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!