X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/TreeSelectionModel.html diff --git a/docs/source/TreeSelectionModel.html b/docs/source/TreeSelectionModel.html index ecb0c876..58cc22be 100644 --- a/docs/source/TreeSelectionModel.html +++ b/docs/source/TreeSelectionModel.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.tree.DefaultSelectionModel * @extends Ext.util.Observable * The default single selection for a TreePanel. @@ -26,7 +21,7 @@ Ext.tree.DefaultSelectionModel = function(config){ * @param {DefaultSelectionModel} this * @param {TreeNode} node the new selection */ - "selectionchange", + 'selectionchange',
/** * @event beforeselect @@ -35,7 +30,7 @@ Ext.tree.DefaultSelectionModel = function(config){ * @param {TreeNode} node the new selection * @param {TreeNode} node the old selection */ - "beforeselect" + 'beforeselect' ); Ext.apply(this, config); @@ -46,7 +41,7 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); - tree.on("click", this.onNodeClick, this); + tree.on('click', this.onNodeClick, this); }, onNodeClick : function(node, e){ @@ -67,12 +62,12 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { if(node == last){ node.ui.onSelectedChange(true); }else if(this.fireEvent('beforeselect', this, node, last) !== false){ - if(last){ + if(last && last.ui){ last.ui.onSelectedChange(false); } this.selNode = node; node.ui.onSelectedChange(true); - this.fireEvent("selectionchange", this, node, last); + this.fireEvent('selectionchange', this, node, last); } return node; }, @@ -80,22 +75,26 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
/** * Deselect a node. * @param {TreeNode} node The node to unselect + * @param {Boolean} silent True to stop the selectionchange event from firing. */ - unselect : function(node){ + unselect : function(node, silent){ if(this.selNode == node){ - this.clearSelections(); + this.clearSelections(silent); } },
/** * Clear all selections + * @param {Boolean} silent True to stop the selectionchange event from firing. */ - clearSelections : function(){ + clearSelections : function(silent){ var n = this.selNode; if(n){ n.ui.onSelectedChange(false); this.selNode = null; - this.fireEvent("selectionchange", this, null); + if(silent !== true){ + this.fireEvent('selectionchange', this, null); + } } return n; }, @@ -223,7 +222,7 @@ Ext.tree.MultiSelectionModel = function(config){ * @param {MultiSelectionModel} this * @param {Array} nodes Array of the selected nodes */ - "selectionchange" + 'selectionchange' ); Ext.apply(this, config); Ext.tree.MultiSelectionModel.superclass.constructor.call(this); @@ -233,7 +232,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); - tree.on("click", this.onNodeClick, this); + tree.on('click', this.onNodeClick, this); }, onNodeClick : function(node, e){ @@ -263,7 +262,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { this.selMap[node.id] = node; this.lastSelNode = node; node.ui.onSelectedChange(true); - this.fireEvent("selectionchange", this, this.selNodes); + this.fireEvent('selectionchange', this, this.selNodes); return node; }, @@ -280,7 +279,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { this.selNodes.splice(index, 1); } delete this.selMap[node.id]; - this.fireEvent("selectionchange", this, this.selNodes); + this.fireEvent('selectionchange', this, this.selNodes); } }, @@ -296,7 +295,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { this.selNodes = []; this.selMap = {}; if(suppressEvent !== true){ - this.fireEvent("selectionchange", this, this.selNodes); + this.fireEvent('selectionchange', this, this.selNodes); } } }, @@ -323,6 +322,6 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext, selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious -});
- +});
+ \ No newline at end of file