code: function(ctx, flag) {
  		var node = ctx.node,
  			tree = ctx.tree,
  			opts = ctx.options;
  		// flag defaults to true
  		flag = (flag !== false);
  
  		node.debug("nodeSetSelected(" + flag + ")", ctx);
  		if( node.unselectable){
  			return;
  		}
  		// TODO: !!node.expanded is nicer, but doesn't pass jshint
  		// https://github.com/jshint/jshint/issues/455
  //        if( !!node.expanded === !!flag){
  		if((node.selected && flag) || (!node.selected && !flag)){
  			return !!node.selected;
  		}else if ( this._triggerNodeEvent("beforeSelect", node, ctx.originalEvent) === false ){
  			return !!node.selected;
  		}
  		if(flag && opts.selectMode === 1){
  			// single selection mode
  			if(tree.lastSelectedNode){
  				tree.lastSelectedNode.setSelected(false);
  			}
  		}else if(opts.selectMode === 3){
  			// multi.hier selection mode
  			node.selected = flag;
  //			this._fixSelectionState(node);
  			node.fixSelection3AfterClick();
  		}
  		node.selected = flag;
  		this.nodeRenderStatus(ctx);
  		tree.lastSelectedNode = flag ? node : null;
  		tree._triggerNodeEvent("select", ctx);
  	}
docs: (De)Select node, return new status (sync).
  
  @param {EventData} ctx
  @param {boolean} [flag=true]