[76] | 1 | |
---|
| 2 | .. currentmodule:: GeoExt.tree |
---|
| 3 | |
---|
| 4 | :class:`GeoExt.tree.LayerLoader` |
---|
| 5 | ================================================================================ |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | .. cssclass:: meta |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | Extends |
---|
| 12 | * `Ext.util.Observable <http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable>`_ |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | .. class:: LayerLoader |
---|
| 21 | |
---|
| 22 | A loader that will load all layers of a :class:`GeoExt.data.LayerStore` |
---|
| 23 | By default, only layers that have displayInLayerSwitcher set to true |
---|
| 24 | will be included. The childrens' iconCls defaults to |
---|
| 25 | "gx-tree-layer-icon". |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | Config Options |
---|
| 32 | -------------- |
---|
| 33 | |
---|
| 34 | Configuration properties in addition to |
---|
| 35 | those listed for `Ext.util.Observable <http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable>`_. |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | .. describe:: baseAttrs |
---|
| 39 | |
---|
| 40 | An object containing attributes to be added to all nodes created by |
---|
| 41 | this loader. |
---|
| 42 | |
---|
| 43 | .. describe:: filter |
---|
| 44 | |
---|
| 45 | ``Function`` |
---|
| 46 | A function, called in the scope of this loader, with a layer record |
---|
| 47 | as argument. Is expected to return true for layers to be loaded, false |
---|
| 48 | otherwise. By default, the filter checks for displayInLayerSwitcher: |
---|
| 49 | |
---|
| 50 | .. code-block:: javascript |
---|
| 51 | |
---|
| 52 | filter: function(record) { |
---|
| 53 | return record.getLayer().displayInLayerSwitcher == true |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | .. describe:: store |
---|
| 57 | |
---|
| 58 | :class:`GeoExt.data.LayerStore` |
---|
| 59 | The layer store containing layers to be added by this loader. |
---|
| 60 | |
---|
| 61 | .. describe:: uiProviders |
---|
| 62 | |
---|
| 63 | ``Object`` |
---|
| 64 | An optional object containing properties which specify custom |
---|
| 65 | GeoExt.tree.LayerNodeUI implementations. If the optional uiProvider |
---|
| 66 | attribute for child nodes is a string rather than a reference to a |
---|
| 67 | TreeNodeUI implementation, then that string value is used as a |
---|
| 68 | property name in the uiProviders object. If not provided, the |
---|
| 69 | uiProviders object will be taken from the ownerTree's loader. |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | Public Methods |
---|
| 77 | -------------- |
---|
| 78 | |
---|
| 79 | Public methods in addition to those |
---|
| 80 | listed for `Ext.util.Observable <http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable>`_. |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | .. method:: LayerLoader.createNode |
---|
| 84 | |
---|
| 85 | :param attr: ``Object`` attributes for the new node |
---|
| 86 | |
---|
| 87 | Override this function for custom TreeNode node implementation, or to |
---|
| 88 | modify the attributes at creation time. |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | Events |
---|
| 94 | ------ |
---|
| 95 | |
---|
| 96 | Events in addition to those |
---|
| 97 | listed for `Ext.util.Observable <http://dev.sencha.com/deploy/dev/docs/?class=Ext.util.Observable>`_. |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | .. describe:: beforeload |
---|
| 101 | |
---|
| 102 | Triggered before loading children. Return false to avoid |
---|
| 103 | loading children. |
---|
| 104 | |
---|
| 105 | Listener arguments: |
---|
| 106 | |
---|
| 107 | * loader - :class:`GeoExt.tree.LayerLoader` this loader |
---|
| 108 | * node - ``Ex.tree.TreeNode`` the node that this loader is |
---|
| 109 | configured with |
---|
| 110 | |
---|
| 111 | .. describe:: load |
---|
| 112 | |
---|
| 113 | Triggered after children wer loaded. |
---|
| 114 | |
---|
| 115 | Listener arguments: |
---|
| 116 | |
---|
| 117 | * loader - :class:`GeoExt.tree.LayerLoader` this loader |
---|
| 118 | * node - ``Ex.tree.TreeNode`` the node that this loader is |
---|
| 119 | configured with |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | |
---|