Skip to content

Instantly share code, notes, and snippets.

@bartvde
Created February 7, 2013 13:57
Show Gist options
  • Save bartvde/4731067 to your computer and use it in GitHub Desktop.
Save bartvde/4731067 to your computer and use it in GitHub Desktop.
gxp layertree checkbox click
diff --git a/src/script/plugins/LayerTree.js b/src/script/plugins/LayerTree.js
index 7c04c07..b53c701 100644
--- a/src/script/plugins/LayerTree.js
+++ b/src/script/plugins/LayerTree.js
@@ -223,6 +223,12 @@ gxp.plugins.LayerTree = Ext.extend(gxp.plugins.Tool, {
}
attr.listeners = {
rendernode: function(node) {
+ var cb = node.getUI().checkbox;
+ if (cb && Ext.get(cb).getAttribute('type') === 'checkbox') {
+ Ext.get(cb).on('click', function() {
+ alert('click');
+ });
+ }
if (record === this.target.selectedLayer) {
node.select();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment