Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by pl! on Jul 22, 2008 02:32
open dhtmlx forum
Prevent active parent if all children are checked

Hey, me again.

When you select all child-nodes, their parent-node becomes fully checked too.

Although this is standard tree behaviour, I need to disable this functionality. The parent-node state should stay unsure, as if only some nodes were checked.

It's retarded, I know, but this is what the customer wants so I am doomed to do this.
Answer posted by Support on Jul 22, 2008 03:48
Can be achieved by next code modification.

dhtmlxtree.js , line 1646
dhtmlXTreeObject.prototype._correctCheckStates=function(dhtmlObject){
...
if ((flag1)&&(flag2)) this._setCheck(dhtmlObject,"unsure");
   else if (flag1)  this._setCheck(dhtmlObject,false);
      else  this._setCheck(dhtmlObject,true);



can be changed to
if ((flag1)&&(flag2)) this._setCheck(dhtmlObject,"unsure");
   else if (flag1)  this._setCheck(dhtmlObject,false);
      else  this._setCheck(dhtmlObject,"unsure");

Answer posted by pl! on Jul 22, 2008 04:18
Once again, you made my day. Thank you