Angular-Kendoui - two way binding of the treeview datasource - angularjs

I've created the following example:
http://dojo.telerik.com/ACIKe
It is based on kendo's TreeView angular example.
What can be seen here is that the model is not updated when checking/unchecking the checkboxes.
Any idea how to do the two-way binding work here?

You have to use the kendo.data.ObservableArray instead of the kendo.data.HierarchicalDataSource
Check this out:
http://dojo.telerik.com/InOQo

Related

Is it possible to perform a two way binding on a custom directive with ngModel?

My use case is completely different. When I strip off all the other factors, it boils down to this.
Say I have the following input element
<input type="text" [customDirective] [(ngModel)]="myValue" >
The job of this customDirective is to look into value entered by the user and changed its value based on the input on the fly.
How to achieve two-way binding for this.
I played around with ControlValueAccessor, DefaultValueAccessor. But no matter what I do, I was not able to achieve the two-way binding. The maximum I achieved at one time is view update on model update but not the other way round. But that code is somewhere lost.
Here is the vanilla plunker link.
PS: I already referred the following. But none of them were helpful in achieving 2-way binding w.r.t to directive
http://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html
angular2 wysiwyg tinymce implementation and 2-way-binding
Thanks in advance
Finally figured out how to do this.
Model to UI changes can be done using ControlValueAcessor
UI to Model can be done like below
import {Output} from '#angular/core';
Use the event emitter
#Output() ngModelChange = new EventEmitter();
Whenever data gets changed emit the event
this.ngModelChange.emit(YOUR_NEW_VALUE);
Here is the detailed example
Using Tinymce editor as a directive

Extjs TwoWayBindable pressed button

I want to create a button which is property "pressed" is binded to a data in a view model.
But it didn't work, I don't understand why.
See my fiddle: https://fiddle.sencha.com/#fiddle/16i2.
My problem is that the extended property value doesn't change.
I know that I can do this by event, but I want to understand why it doesn't work and how to this with ExtJs property before going to a "workaround".
Adding a reference solves the issue.
For example: https://fiddle.sencha.com/#fiddle/16ir

Ext JS 5 Data Binding Combobox

I have an Ext JS 5.0.1 application that I am working on. I have a simple window with a grid and a form. I have the grid bound to my store and when a row is selected, all the textfields in the form bind, but I also have a combobox with its own store. When I select the grid row, I could not get the combobox to bind. I finally figured that out, but now if you change the combobox on the form the grid column just shows object.object. I have created a fiddle if anybody can help me out a little with this problem. Obviously I am trying to use the MVVM but also I would like for it to work in Architect if possible.
Fiddle
Bind value, not selection:
value: '{allPeople.selection.gender}'
Working example: https://fiddle.sencha.com/#fiddle/obm

(newbie) ng-switch in a custom directive breaks two-way binding?

I'm running into an issue with two way binding in angular on a custom directive. I have a directive that will have a editor mode (and have different types of inputs) and display mode.
unfortunately, it seems that if there is a ng-switch the two-way binding breaks from the control. But the variables remain linked if I access it from an external component. Here is a very cutdown example plunker to show the problem.
http://plnkr.co/edit/M8gPfRlrVIXHdXREN1ai
If you modify the top input the changes propogate to the bottom input. But if you modify the bottom input the binding breaks.
How can I resolve this issue so that the changes to ng-model in the directive propagate to the controllers scope?
You are facing this problem because Ng-Switch creates its own scope
So there are two solutions to this problem
1) Use two dots in model
http://plnkr.co/edit/E7cE37VfrqatiMX885ZZ?p=preview
2) Use $parent in the model
http://plnkr.co/edit/eaFYF5kgOnkhsGpdgzFA?p=preview

Simple Example using Backbone.js and Rivets.js

I am looking for a very simple example where e.g. there is a two way binding between span text and an input element using Backbone.js and Rivets.js. Perhaps there is one in the Rivets.js docs, but I can't find it. Any help please?
Assuming that you mean a two-way binding (model-to-view and view-to-model) on an input element and a one-way binding (model-to-view) on a span element, then the following view will do what you describe.
<div id="user-view">
<span>{ user:name }</span>
<input rv-value="user:name">
</div>
Here is a fiddle that demonstrates things in action. It includes a Backbone adapter on the : interface and shows how to bind a model to the view (this is just a more trivial example of what is already shown on the homepage).
I recommend that you use:
https://github.com/theironcook/Backbone.ModelBinder
It can satisfy the two-way binding between the demand of all the view and model。
This is what I do nested view binding example:
http://files.cnblogs.com/justinw/Nested_Model_bi_Binding.zip

Resources