-<html>
-<head>
- <title>The source code</title>
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body onload="prettyPrint();">
- <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.tree.DefaultSelectionModel"></div>/**\r
+<html>\r
+<head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \r
+ <title>The source code</title>\r
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body onload="prettyPrint();">\r
+ <pre class="prettyprint lang-js"><div id="cls-Ext.tree.DefaultSelectionModel"></div>/**\r
* @class Ext.tree.DefaultSelectionModel\r
* @extends Ext.util.Observable\r
* The default single selection for a TreePanel.\r
* @param {DefaultSelectionModel} this\r
* @param {TreeNode} node the new selection\r
*/\r
- "selectionchange",\r
+ 'selectionchange',\r
\r
<div id="event-Ext.tree.DefaultSelectionModel-beforeselect"></div>/**\r
* @event beforeselect\r
* @param {TreeNode} node the new selection\r
* @param {TreeNode} node the old selection\r
*/\r
- "beforeselect"\r
+ 'beforeselect'\r
);\r
\r
Ext.apply(this, config);\r
init : function(tree){\r
this.tree = tree;\r
tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
- tree.on("click", this.onNodeClick, this);\r
+ tree.on('click', this.onNodeClick, this);\r
},\r
\r
onNodeClick : function(node, e){\r
if(node == last){\r
node.ui.onSelectedChange(true);\r
}else if(this.fireEvent('beforeselect', this, node, last) !== false){\r
- if(last){\r
+ if(last && last.ui){\r
last.ui.onSelectedChange(false);\r
}\r
this.selNode = node;\r
node.ui.onSelectedChange(true);\r
- this.fireEvent("selectionchange", this, node, last);\r
+ this.fireEvent('selectionchange', this, node, last);\r
}\r
return node;\r
},\r
<div id="method-Ext.tree.DefaultSelectionModel-unselect"></div>/**\r
* Deselect a node.\r
* @param {TreeNode} node The node to unselect\r
+ * @param {Boolean} silent True to stop the selectionchange event from firing.\r
*/\r
- unselect : function(node){\r
+ unselect : function(node, silent){\r
if(this.selNode == node){\r
- this.clearSelections();\r
+ this.clearSelections(silent);\r
} \r
},\r
\r
<div id="method-Ext.tree.DefaultSelectionModel-clearSelections"></div>/**\r
* Clear all selections\r
+ * @param {Boolean} silent True to stop the selectionchange event from firing.\r
*/\r
- clearSelections : function(){\r
+ clearSelections : function(silent){\r
var n = this.selNode;\r
if(n){\r
n.ui.onSelectedChange(false);\r
this.selNode = null;\r
- this.fireEvent("selectionchange", this, null);\r
+ if(silent !== true){\r
+ this.fireEvent('selectionchange', this, null);\r
+ }\r
}\r
return n;\r
},\r
* @param {MultiSelectionModel} this\r
* @param {Array} nodes Array of the selected nodes\r
*/\r
- "selectionchange"\r
+ 'selectionchange'\r
);\r
Ext.apply(this, config);\r
Ext.tree.MultiSelectionModel.superclass.constructor.call(this);\r
init : function(tree){\r
this.tree = tree;\r
tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
- tree.on("click", this.onNodeClick, this);\r
+ tree.on('click', this.onNodeClick, this);\r
},\r
\r
onNodeClick : function(node, e){\r
this.selMap[node.id] = node;\r
this.lastSelNode = node;\r
node.ui.onSelectedChange(true);\r
- this.fireEvent("selectionchange", this, this.selNodes);\r
+ this.fireEvent('selectionchange', this, this.selNodes);\r
return node;\r
},\r
\r
this.selNodes.splice(index, 1);\r
}\r
delete this.selMap[node.id];\r
- this.fireEvent("selectionchange", this, this.selNodes);\r
+ this.fireEvent('selectionchange', this, this.selNodes);\r
}\r
},\r
\r
this.selNodes = [];\r
this.selMap = {};\r
if(suppressEvent !== true){\r
- this.fireEvent("selectionchange", this, this.selNodes);\r
+ this.fireEvent('selectionchange', this, this.selNodes);\r
}\r
}\r
},\r
selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext,\r
\r
selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious\r
-});</pre>
-</body>
+});</pre> \r
+</body>\r
</html>
\ No newline at end of file