planetfederal / gxp

High level components for GeoExt based applications.
http://boundlessgeo.com/
Other
84 stars 97 forks source link

cannot specify listeners in outputConfig of layertree plugin #159

Closed bartvde closed 11 years ago

bartvde commented 12 years ago

since this will override the listeners that the code in the layertree plugin is creating:

            listeners: {
                contextmenu: this.handleTreeContextMenu,
                beforemovenode: this.handleBeforeMoveNode,
                scope: this
            },

                ptype: "gxp_layertree",
                outputConfig: {
                    id: "layertree",
                    enableDD:true,
                    listeners: {
                        'nodedrop': function(evt) {
                            ..
                        },
                        scope: this
                    }
                },
                outputTarget: "tree"
bartvde commented 12 years ago

Should we consider a deep copy of outputConfig in gxp.plugins.Tool ? http://stackoverflow.com/questions/5216565/is-there-a-better-way-to-use-ext-apply-to-combine-child-subobjects-into-another

ahocevar commented 12 years ago

As discussed with @bartvde, we should add listeners internally through the on() method and not add them through the default config object.

Regarding deep apply in Tool.js, we should first decide if we want to have application configuration take precedence over tool configuration also for nested objects. Right now, applications providing configurations for nested objects break tools that need a default configuration for them.

bartvde commented 11 years ago

@ahocevar any chance you could have a quick look at this PR, should be trivial

ahocevar commented 11 years ago

Very good. Please merge.