Comments (9)
This is a design issue. I hope to solve it soon.
Currently you can solve it by passing a new nodes object (a different "pointer").
So for example:
nodes = [...nodes];
The only problem is that it resets the tree state in terms of which node is expanded / selected / etc.
from angular-tree-component.
Yes, this is a big issue. It makes the tree static
from angular-tree-component.
Hey, just pushed a new version (1.1.12) which allows to update the tree using an update() method on the treeModel.
See documentation:
https://angular2-tree.readme.io/v1.1.12/docs/changing-the-tree
Can you verify it works?
from angular-tree-component.
Anyone verified? I want to close the issue
@sheff146 ?
from angular-tree-component.
Yes it works, great job.
On Wed, Aug 10, 2016 at 12:39 AM, adam klein [email protected]
wrote:
Anyone verified? I want to close the issue
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI29pKLuzKwMF24b7tuUahVQwfnwNXfrks5qeJEsgaJpZM4JTlFR
.
from angular-tree-component.
Adam, can I still suggest an improvement? The current solution is the update model must be called outside of component by the consumer code via #variable and @ViewChild, which is working technically but a bit "hacky". I wonder if component itself could watch for the underlying collection change and update its model seamlessly so that the consumer just could just data bind to root nodes once and relax?
from angular-tree-component.
Hi,
The tree does a shallow compare (using ngOnChanges), and in case the
'nodes' attribute changes, it will update automatically.
So in case you're dealing with immutable objects u don't need to call
'update' explicitly.
I wouldn't say using the ViewChild ref is hacky, it depends on the
conventions of the project and the team.
I just don't want to do a deep comparison every time the change detection
runs cause that would be very inefficient - that's the Angular1 way...
On Aug 11, 2016 01:33, "dmitrynovik" [email protected] wrote:
Adam, can I still suggest an improvement? The current solution is the
update model must be called outside of control by the consumer code via
#variable and @ViewChild https://github.com/ViewChild, which is working
technically but a bit "hacky". I wonder if control component itself could
watch for the underlying collection change and update its model seamlessly
so that the consumer just could just data bind to root nodes once and relax?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUsQ4vkNgm6isSq_doC6usvNck-x-kZks5qelG7gaJpZM4JTlFR
.
from angular-tree-component.
What I mean is ideally the component is self-contained and, if data-bound,
is able to detect the collection changes itself requiring no outside code.
I'll leave the performance considerations to you - definitely a tree is
recursive and can be potentially very deep and large in some cases... but
probably it still should better be configurable via settings... for
example, the user might want to choose between { autoUpdate: true } - a
tree which does watch its every data item, suitable for smaller trees, or
choosing not to have it when dealing with very large collections.
On Thu, Aug 11, 2016 at 4:08 PM, 500Tech [email protected] wrote:
Hi,
The tree does a shallow compare (using ngOnChanges), and in case the
'nodes' attribute changes, it will update automatically.So in case you're dealing with immutable objects u don't need to call
'update' explicitly.I wouldn't say using the ViewChild ref is hacky, it depends on the
conventions of the project and the team.I just don't want to do a deep comparison every time the change detection
runs cause that would be very inefficient - that's the Angular1 way...On Aug 11, 2016 01:33, "dmitrynovik" [email protected] wrote:
Adam, can I still suggest an improvement? The current solution is the
update model must be called outside of control by the consumer code via
#variable and @ViewChild https://github.com/ViewChild, which is
working
technically but a bit "hacky". I wonder if control component itself could
watch for the underlying collection change and update its model
seamlessly
so that the consumer just could just data bind to root nodes once and
relax?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/500tech/angular2-tree-component/
issues/18#issuecomment-239025381>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACUsQ4vkNgm6isSq_
doC6usvNck-x-kZks5qelG7gaJpZM4JTlFR>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI29pH7rik7ScVC9UIA9WOYb2JPpL9Iuks5qerxAgaJpZM4JTlFR
.
from angular-tree-component.
I will definitely add meta-level configuration, like setting the tree
component's changeDetectionStrategy and viewEncapsulation.
I guess autoWatch: true could be one of them.....
On Thu, Aug 11, 2016 at 9:26 AM, dmitrynovik [email protected]
wrote:
What I mean is ideally the component is self-contained and, if data-bound,
is able to detect the collection changes itself requiring no outside code.I'll leave the performance considerations to you - definitely a tree is
recursive and can be potentially very deep and large in some cases... but
probably it still should better be configurable via settings... for
example, the user might want to choose between { autoUpdate: true } - a
tree which does watch its every data item, suitable for smaller trees, or
choosing not to have it when dealing with very large collections.On Thu, Aug 11, 2016 at 4:08 PM, 500Tech [email protected] wrote:
Hi,
The tree does a shallow compare (using ngOnChanges), and in case the
'nodes' attribute changes, it will update automatically.So in case you're dealing with immutable objects u don't need to call
'update' explicitly.I wouldn't say using the ViewChild ref is hacky, it depends on the
conventions of the project and the team.I just don't want to do a deep comparison every time the change detection
runs cause that would be very inefficient - that's the Angular1 way...On Aug 11, 2016 01:33, "dmitrynovik" [email protected] wrote:
Adam, can I still suggest an improvement? The current solution is the
update model must be called outside of control by the consumer code via
#variable and @ViewChild https://github.com/ViewChild, which is
working
technically but a bit "hacky". I wonder if control component itself
could
watch for the underlying collection change and update its model
seamlessly
so that the consumer just could just data bind to root nodes once and
relax?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/500tech/angular2-tree-component/
issues/18#issuecomment-239025381>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACUsQ4vkNgm6isSq_
doC6usvNck-x-kZks5qelG7gaJpZM4JTlFR>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/500tech/angular2-tree-component/
issues/18#issuecomment-239080681>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/
AI29pH7rik7ScVC9UIA9WOYb2JPpL9Iuks5qerxAgaJpZM4JTlFR>
.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACUsQ9O-RoxN_v1wQ2GWIeUHCIrF6Rn7ks5qesCfgaJpZM4JTlFR
.
Adam Klein
CTO & Co-Founder
Tel. +972-52-747-5633
blog.500tech.com http://blog.500tech.com
meetup.com/angularjs-il
from angular-tree-component.
Related Issues (20)
- Missing documentation for how to use checkbox tri-state in a custom template HOT 2
- expandAll() method is very slow with large objects,even if virtual scroll is true HOT 1
- Typo in the template section of the documentation HOT 1
- selecting parent node does not select children with hasChildren true HOT 1
- No event for checkbox de-selection
- RTL doesn't work with Action Mapping
- Warning when publishing project in angular 14
- Select All option in tree view
- actionMapping mouse dblClick has stopped working HOT 1
- Expanding specific node on ngAfterViewInit
- Abandoned? HOT 1
- Add Expand/Collapse tooltips to expand/collapse arrows for better accessibility
- How to use whole new tree inside context menu HOT 1
- text while dragging node
- Module "@circlon/angular-tree-component" has no exported member 'IDTypeDictionary' HOT 1
- Angular 16 support HOT 22
- how can I know when the node is fully expanded?
- Solution: Low performance on scrolling. Performance boost
- NVDA screen reader reading blank sometimes
- System tree view is not displayed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-tree-component.