Skip to content

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

Merged
marcjansen merged 3 commits intogeoext:masterfrom
marcjansen:tree-refactor
Oct 21, 2015
Merged

Remove GeoExt.tree.Panel and ensure drag & drop functionality by enhancing LayersTree-store#96
marcjansen merged 3 commits intogeoext:masterfrom
marcjansen:tree-refactor

Conversation

@marcjansen
Copy link
Copy Markdown
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
Comment thread src/data/store/LayersTree.js Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@vittrup88
Copy link
Copy Markdown

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
Copy Markdown
Member Author

@AndersVittrup, cool thanks for the feedback

@KaiVolland
Copy link
Copy Markdown
Contributor

All seems fine to me. Please merge. 👯

@marcjansen
Copy link
Copy Markdown
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