[Commits] r2581 - core/trunk/geoext/lib/GeoExt/plugins
commits at geoext.org
commits at geoext.org
Tue Jan 25 09:52:35 CET 2011
Author: pgiraud
Date: 2011-01-25 09:52:35 +0100 (Tue, 25 Jan 2011)
New Revision: 2581
Modified:
core/trunk/geoext/lib/GeoExt/plugins/TreeNodeActions.js
Log:
Fixing the inline doc, no functional change
Modified: core/trunk/geoext/lib/GeoExt/plugins/TreeNodeActions.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/plugins/TreeNodeActions.js 2011-01-25 08:28:05 UTC (rev 2580)
+++ core/trunk/geoext/lib/GeoExt/plugins/TreeNodeActions.js 2011-01-25 08:52:35 UTC (rev 2581)
@@ -39,15 +39,60 @@
*/
/** api: example
- * Sample code to create a layer node UI with an actions mixin:
+ * Sample code to create a layer node UI with an actions plugin:
*
* .. code-block:: javascript
*
- * var uiClass = Ext.extend(
- * GeoExt.tree.LayerNodeUI,
- * new GeoExt.plugins.TreeNodeActions()
- * );
*
+ * var uiClass = GeoExt.examples.LayerNodeUI = Ext.extend(
+ * GeoExt.tree.LayerNodeUI,
+ * new GeoExt.tree.TreeNodeUIEventMixin()
+ * );
+ *
+ * // this function takes action based on the "action"
+ * // parameter, it is used as a listener to layer
+ * // nodes' "action" events
+ * function onAction(node, action, evt) {
+ * var layer = node.layer;
+ * switch(action) {
+ * case "delete":
+ * layer.destroy();
+ * break;
+ * }
+ * };
+ * var tree = new Ext.tree.TreePanel({
+ * region: "west",
+ * width: 250,
+ * title: "Layer Tree",
+ * loader: {
+ * applyLoader: false,
+ * uiProviders: {
+ * "ui": GeoExt.examples.LayerNodeUI
+ * }
+ * },
+ * // apply the tree node actions plugin to layer nodes
+ * plugins: [{
+ * ptype: "gx_treenodeactions",
+ * listeners: {
+ * action: onAction
+ * }
+ * }],
+ * root: {
+ * nodeType: "gx_layercontainer",
+ * loader: {
+ * baseAttrs: {
+ * radioGroup: "radiogroup",
+ * uiProvider: "ui",
+ * actions: [{
+ * action: "delete",
+ * qtip: "delete"
+ * }]
+ * }
+ * }
+ * },
+ * rootVisible: false
+ * });
+ *
*/
GeoExt.plugins.TreeNodeActions = Ext.extend(Ext.util.Observable, {
More information about the Commits
mailing list