Skip to content

Commit

Permalink
Merge pull request #344 from marcjansen/outof-range-docs
Browse files Browse the repository at this point in the history
Add more API docs for disabled LayerTreeNodes
  • Loading branch information
marcjansen committed Mar 18, 2015
2 parents ca7c1ba + 038e664 commit 99cc899
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/GeoExt/data/LayerTreeModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* dynamically if the name of the connected layer changes, if any. Read only.
* * **component** Ext.Component: The component to be rendered with this node,
* if any.
* * **disabled** Boolean: Used to reflect whether the associated layer is
* in range (visible in the current map scale).
*
* A typical configuration that makes use of some of these extended sttings
* could look like this:
Expand Down
18 changes: 18 additions & 0 deletions src/GeoExt/tree/LayerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
* layer: myLayer
* }
*
* When the layer associated with this GeoExt.tree.LayerNode is no longer in
* range (invisible due to resolution constraints), the layer will be visually
* marked as disabled.
*
* If you do not want this behaviour, include the following CSS code:
*
* .gx-tree-row-disabled span.x-tree-node-text {
* opacity: inherit;
* font-style: inherit;
* }
*
* If additionally you want to make the nodes checkbox unusable when the node is
* disabled, you could use the following CSS-snippet:
*
* .gx-tree-row-disabled input {
* visibility: hidden;
* }
*
* See GeoExt.data.LayerTreeModel for more details on GeoExt extensions to the
* node configuration.
*
Expand Down
3 changes: 3 additions & 0 deletions src/GeoExt/tree/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Ext.define('GeoExt.tree.View', {
return me.callParent(arguments);
},

/**
* @inheritdoc
*/
getRowClass: function(record, rowIndex, rowParams, store) {
return record.get('disabled') ? 'gx-tree-row-disabled' : '';
},
Expand Down

0 comments on commit 99cc899

Please sign in to comment.