source:
trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/plugins/TreeNodeRadioButton.txt
@
76
Revision 76, 1.8 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Rev | Line | |
---|---|---|
[76] | 1 | |
2 | .. currentmodule:: GeoExt.plugins | |
3 | ||
4 | :class:`GeoExt.plugins.TreeNodeRadioButton` | |
5 | ================================================================================ | |
6 | ||
7 | ||
8 | .. cssclass:: meta | |
9 | ||
10 | ||
11 | ||
12 | ||
13 | ||
14 | ptype | |
15 | ``gx_treenoderadiobutton`` | |
16 | ||
17 | ||
18 | ||
19 | A plugin to create tree node UIs with radio buttons. Can be plugged into | |
20 | any ``Ext.tree.TreePanel`` and will be applied to nodes that are extended | |
21 | with the :class:`GeoExt.Tree.TreeNodeUIEventMixin`, in particular | |
22 | :class:`GeoExt.tree.LayerNodeUI` nodes. | |
23 | ||
24 | A tree with a ``GeoExt.plugins.TreeNodeRadioButton`` fires the additional | |
25 | ``radiochange`` event when a node's radio button is clicked. | |
26 | ||
27 | Only if a node is configured ``radioGroup`` attribute, it will be rendered | |
28 | with a radio button next to its icon. The ``radioGroup`` works like a | |
29 | HTML checkbox with its ``name`` attribute, and ``radioGroup`` is a string | |
30 | that identifies the options group. | |
31 | ||
32 | ||
33 | ||
34 | ||
35 | Example Use | |
36 | ----------- | |
37 | ||
38 | Sample code to create a tree with a node that has a radio button: | |
39 | ||
40 | .. code-block:: javascript | |
41 | ||
42 | var UIClass = Ext.extend( | |
43 | Ext.tree.TreeNodeUI, | |
44 | GeoExt.tree.TreeNodeUIEventMixin | |
45 | ); | |
46 | var tree = new Ext.tree.TreePanel({ | |
47 | plugins: [ | |
48 | new GeoExt.plugins.TreeNodeRadioButton({ | |
49 | listeners: { | |
50 | "radiochange": function(node) { | |
51 | alert(node.text + "'s radio button was clicked."); | |
52 | } | |
53 | } | |
54 | }) | |
55 | ], | |
56 | root: { | |
57 | nodeType: "node", | |
58 | uiProvider: UIClass, | |
59 | text: "My Node", | |
60 | radioGroup: "myGroupId" | |
61 | } | |
62 | } | |
63 | ||
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | ||
71 | ||
72 | ||
73 | Events | |
74 | ------ | |
75 | ||
76 | Events. | |
77 | ||
78 | ||
79 | .. describe:: radiochange | |
80 | ||
81 | Fires when a radio button is clicked. | |
82 | ||
83 | Listener arguments: | |
84 | ||
85 | * node - ``Ext.TreeNode`` The node of the clicked radio button. | |
86 | ||
87 | ||
88 |
Note: See TracBrowser
for help on using the repository browser.