/** * The check box marks a task complete. It is a simulated form field * with three states ... * 0=unchecked, 1=some children checked, 2=all children checked * When a task is clicked, the state of the nodes and parent and children * are updated, and this behavior cascades. * * @extends YAHOO.widget.TextNode * @constructor * @param oData {object} A string or object containing the data that will * be used to render this node. * @param oParent {Node} This node's parent node * @param expanded {boolean} The initial expanded/collapsed state * @param checked {boolean} The initial checked/unchecked state */ YAHOO.widget.TaskNode=function(oData,oParent,expanded,checked){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);this.setUpCheck(checked);}};YAHOO.widget.TaskNode.prototype=new YAHOO.widget.TextNode();YAHOO.widget.TaskNode.prototype.checked=false;YAHOO.widget.TaskNode.prototype.checkState=0;YAHOO.widget.TaskNode.prototype.cascadeUp=false;YAHOO.widget.TaskNode.prototype.taskNodeParentChange=function(){if(this.tree&&!this.tree.hasEvent("checkClick")){this.tree.createEvent("checkClick",this.tree);}};YAHOO.widget.TaskNode.prototype.setUpCheck=function(checked){if(checked&&checked===true){this.check();} this.taskNodeParentChange();this.subscribe("parentChange",this.taskNodeParentChange);};YAHOO.widget.TaskNode.prototype.getCheckElId=function(){return"ygtvcheck"+this.index;};YAHOO.widget.TaskNode.prototype.getCheckEl=function(){return document.getElementById(this.getCheckElId());};YAHOO.widget.TaskNode.prototype.getCheckStyle=function(){return"ygtvcheck"+this.checkState;};YAHOO.widget.TaskNode.prototype.getCheckLink=function(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+ this.index+").checkClick()";};YAHOO.widget.TaskNode.prototype.checkClick=function(){if(this.checkState===0){this.check();}else{this.uncheck();} this.onCheckClick();this.tree.fireEvent("checkClick",this);};YAHOO.widget.TaskNode.prototype.onCheckClick=function(){};YAHOO.widget.TaskNode.prototype.updateParent=function(){var p=this.parent;if(!p||!p.updateParent){return;} var somethingChecked=false;var somethingNotChecked=false;for(var i=0;i0);};YAHOO.widget.TaskNode.prototype.check=function(){this.setCheckState(2);for(var i=0;i ';} sb[sb.length]=' ';sb[sb.length]='';sb[sb.length]='';sb[sb.length]=' ';sb[sb.length]='';sb[sb.length]='';sb[sb.length]='';sb[sb.length]='';sb[sb.length]='';return sb.join("");};YAHOO.widget.TaskNode.prototype.toString=function(){return"TaskNode ("+this.index+") "+this.label;};