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

2 posts, 0 answers
  1. Sergiy
    Sergiy avatar
    1 posts
    Member since:
    Oct 2012

    Posted 26 Jan Link to this post

    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

  2. Stefan
    Admin
    Stefan avatar
    1886 posts

    Posted 30 Jan Link to this post

    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.
Back to Top