Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GeoExt.tree.Panel and ensure drag & drop functionality by enhancing LayersTree-store #96

Merged
merged 3 commits into from
Oct 21, 2015

Conversation

marcjansen
Copy link
Member

This PR suggests a larger refactoring of the tree classes. In particular the following is suggested:

  • Remove GeoExt.tree.Panel and instead enhance the GeoExt.data.store.LayersTree to handle any possible drag/drop events
  • Move static functions from GeoExt.tree.Panel to a dedicated utility class
  • Remove the pointless showLayerGroupNode config from GeoExt.data.store.LayersTree

Additionally a bug is fixed: (we could not actually handle the store remove event before 36b8a81)

If you have been using the GeoExt.tree.panel previously, you now need to refactor your code from

Ext.create('GeoExt.tree.Panel', {
  // …
});

to

Ext.create('Ext.tree.Panel', {
  viewConfig: {
    plugins: { ptype: 'treeviewdragdrop' }
  }
});

Fixes #91

Please review. /cc @KaiVolland, @chrismayer & @AndersVittrup

The work in this PR has been done by @weskamm and me.

@marcjansen marcjansen changed the title [wip] tree refactoring Remove GeoExt.tree.Panel and ensure drag & drop functionality by enhancing LayersTree-store Oct 20, 2015
@@ -224,34 +339,38 @@ Ext.define('GeoExt.data.store.LayersTree', {
*
* @private
*/
onLayerCollectionChanged: function(){
onLayerCollectionChangedAdd: function(evt){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer "onLayerCollectionAdd" and ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will rename, sure!

@marcjansen
Copy link
Member Author

@KaiVolland as you suggested, methods are now renamed as you suggested

@vittrup88
Copy link

It fixes the issue. I also checked with the "length" of the layers. How many can you have. I earlier described it would overwrite and not show all layers after a give numbers of layers in the legend.
That is also working as it should now. I tried adding 120 kml files and no preformance problem and i can see all layers in the panel! Great work!

@marcjansen
Copy link
Member Author

@AndersVittrup, cool thanks for the feedback

@KaiVolland
Copy link
Contributor

All seems fine to me. Please merge. 👯

@marcjansen
Copy link
Member Author

Thanks for the reviews and tests @KaiVolland & @AndersVittrup!

Again a hat-tip to the input of @weskamm

marcjansen added a commit that referenced this pull request Oct 21, 2015
Remove GeoExt.tree.Panel and ensure drag & drop functionality by enhancing LayersTree-store
@marcjansen marcjansen merged commit f732bf2 into geoext:master Oct 21, 2015
@marcjansen marcjansen deleted the tree-refactor branch October 21, 2015 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

layersTree stops working/slow
3 participants