This is a migrated thread and some comments may be shown as answers.

Datasource transport.update (function) never gets called after edit

1 Answer 193 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Sergiy
Top achievements
Rank 1
Sergiy asked on 26 Jan 2018, 07:30 PM

I have an issue using ListView, DataSource and Angular where transport is fully custom, e.g. transport update/create/read and delete are functions.

I used original plunkr  from https://demos.telerik.com/kendo-ui/listview/angular and added edit template, edit/cancel and update buttons.

transport.read method works as expected and returns original "product" array from the example however upon edit of the ProductName, transport.update is never executed and no error is thrown. I've added schema/model with id and other columns however it has no impact.

Please help

https://dojo.telerik.com/@sergpro/etuvac/6

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Jan 2018, 09:14 AM
Hello, Sergiy,

Thank you for the example.

After updating it I noticed that the issue occurs when the input is bound to "ng-model" and I can assume that the internal logic that is listening for changes is not detecting the change when it is coming from the model.

In this scenario I can suggest using the ng-change directive to set the dataItem as dirty which will trigger the update:

<input ng-change="dataItem.dirty=true" ng-model="dataItem.ProductName"></input>

This is the modified example:

https://dojo.telerik.com/Eyeqob/2

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListView
Asked by
Sergiy
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or