Hi,
I am implementing igGrid latest version with Angular 2 (2.0.0-rc.1). I noticed that the two way binding is not working in my grid. If I change some value of my object from Grid then my object automatically updated however if I change my object from outside the grid then it does not show inside grid
For Example in below code If I change the value of Name property from inside the grid then it shows the updated value in my textbox however If I modify the value of Name property from textbox it does not refract the updated value inside grid.
Id two-way binding yet supported my igGrid for Angular 2 and if yes then how I can do it.
<div *ngFor="#myObject of objectCollection">
<input type="text" value={{myObject.Name}} /></div>
<div>
<ig-grid [(options)]="gridOptions" [(widgetId)]='id'</ig-grid>
</div>
Thanks for your help
Anilesh
Hello Anilesh,
Thank you for posting in our forum.
In the current syntax – {{myObject.Name}}, the value will be bound only one way.
You can set the ngModel for the input to point to your object in order to achieve two-way databinding.
Example:
<input type="text" [(ngModel)]="myObject.Name" />
You can refer to our angular 2 sample with igGrid here:
http://igniteui.github.io/igniteui-angular2/samples/igGrid/igGrid.html
And you can check out the sample’s code in our github repository:
https://github.com/IgniteUI/igniteui-angular2/tree/master/samples/igGrid
Best Regards,
Maya Kirova
Infragistics, Inc.
http://ko.infragistics.com/support