source:
trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/plugins/TreeNodeComponent.txt
@
76
Revision 76, 1.6 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | |
2 | .. currentmodule:: GeoExt.plugins |
3 | |
4 | :class:`GeoExt.plugins.TreeNodeComponent` |
5 | ================================================================================ |
6 | |
7 | |
8 | .. cssclass:: meta |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | ptype |
15 | ``gx_TreeNodeComponent`` |
16 | |
17 | |
18 | |
19 | A plugin to create tree node UIs that can have an Ext.Component below the |
20 | node's title. Can be plugged into any ``Ext.tree.TreePanel`` and will be |
21 | applied to nodes that are extended with the |
22 | :class:`GeoExt.Tree.TreeNodeUIEventMixin`. |
23 | |
24 | If a node is configured with a ``component`` attribute, it will be rendered |
25 | with the component in addition to icon and title. |
26 | |
27 | |
28 | |
29 | Example Use |
30 | ----------- |
31 | |
32 | Sample code to create a tree with a node that has a component: |
33 | |
34 | .. code-block:: javascript |
35 | |
36 | var uiClass = Ext.extend( |
37 | Ext.tree.TreeNodeUI, |
38 | GeoExt.tree.TreeNodeUIEventMixin |
39 | ); |
40 | var tree = new Ext.tree.TreePanel({ |
41 | plugins: [ |
42 | new GeoExt.plugins.TreeNodeRadioButton({ |
43 | listeners: { |
44 | "radiochange": function(node) { |
45 | alert(node.text + "'s radio button was clicked."); |
46 | } |
47 | } |
48 | }) |
49 | ], |
50 | root: { |
51 | nodeType: "node", |
52 | uiProvider: uiClass, |
53 | text: "My Node", |
54 | component: { |
55 | xtype: "box", |
56 | autoEl: { |
57 | tag: "img", |
58 | src: "/images/my-image.jpg" |
59 | } |
60 | } |
61 | } |
62 | } |
63 | |
64 | Sample code to create a layer node UI with a radio button: |
65 | |
66 | .. code-block:: javascript |
67 | |
68 | var uiClass = Ext.extend( |
69 | GeoExt.tree.LayerNodeUI, |
70 | new GeoExt.tree.TreeNodeUIEventMixin |
71 | ); |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 |
Note: See TracBrowser
for help on using the repository browser.