Ticket #47 (new defect)

Opened 4 years ago

Last modified 4 years ago

modelchange calls all nodes instead of the changed one only

Reported by: bartvde Owned by: sypasche
Priority: blocker Milestone: Future
Component: Tree.client Version: SVN
Keywords: Cc:
State:

Description

Currently the modelchange function loops over all nodes, but since the ext checkchange event passes in the changed node, this can be done much more efficiently.

Attachments

ticket47.diff (2.4 kB) - added by bartvde 4 years ago.
patch to only handle the model change for the changed node

Change History

Changed 4 years ago by bartvde

patch to only handle the model change for the changed node

Changed 4 years ago by sypasche

I'm wondering if this could break things in certain situations (in particular if you have a complex custom model, with wms layers split into multiple branches).

In the "this.getRootNode().cascade(function()" loop, we populate the wmsLayers by visiting all the nodes of the model. With this optimization, it only visits the checkedNode, so that the wmsLayers Object is not filled with checked nodes outside of the clicked node.

I'd like to write unit tests for the tree so that this kind of refactoring can be tested more easily.

Changed 4 years ago by bartvde

I hadn't thought about this use case, good thinking, this will most likely fail with my approach.

Changed 4 years ago by elemoine

  • milestone set to 0.3 Release

Changed 4 years ago by elemoine

  • milestone changed from 0.3 Release to Future

Since Bart's patch isn't valid, I'm changing this ticket's milestone to Future.

Note: See TracTickets for help on using tickets.