-
Notifications
You must be signed in to change notification settings - Fork 192
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
Subscribing to model changes, modifying the model directly #11
Comments
The model does publish changes to listeners registered through I'm actually adding first class support for a data store layer, so you can What are you thinking of using it for?
|
Thanks for the quick response. I was trying to two-way bind it to a Knockout model. My app uses Knockout throughout, so I thought it would be nice to subscribe to tree changes to update my Knockout model; and also pass in my Knockout model changes to the tree. My model can be edited through multiple views, all visible simultaneously, and I'd like to keep everything nicely synched and not have to worry about restoring state. That being said, if I could figure out the current state of the tree (selected node, editing or not, opened/closed branches) I might just rebuild the entire tree and restore the state when changes happen in another view. More directly related to Controller.on though: listeners are eventually called without any arguments, so I'm not too too sure how to determine what has changed. /nc |
Very nice work! I want the component to be able to fetch and save the json-tree from/to node/express server. Any suggestions is welcomed! |
Hi there,
Great tree, love the keyboard action.
I'd like to implement two-way binding using my own data model. Is there a way to subscribe to changes to the tree's internal model? And will the view react if we mutate the model directly? I see the Controller::on function looks like it might be related to this, but am not too sure how to use it.
The text was updated successfully, but these errors were encountered: