Error with virtual scrollable + editing + sorting

4 posts, 0 answers
  1. Huan
    Huan avatar
    4 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2017 Link to this post

    Hi,

    I'm trying to use kendo grid virtual scrollable + editing + sorting with version 2017.3.1018.

    The create/update is working well, but there is an unexpected behavior in delete function.

    You can see it in this example: 

    https://dojo.telerik.com/@huan5.wang@citi.com/urAxO/3

     

    Here is a grid with 10000 items displayed. And the data is sorting by Id in descending order.

    When I delete the first item (Id: 9999) and then refresh the grid (scroll down and up, sorting), this deleted item will reappear.

    Could you review it?

     

    Thanks

  2. Huan
    Huan avatar
    4 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2017 in reply to Huan Link to this post

    Updated:

    Here is the dojo link

    dojo link

     

  3. Huan
    Huan avatar
    4 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2017 Link to this post

    Temporarily resolved by adding a remove event handler to grid options.

    dojo link

    remove: function(evt) {
        var grid = evt.sender;
        var data = grid.dataSource.data();
        for (let idx = 0; idx < data.length; idx++) {
            var dataItem = data.at(idx);
            if (dataItem.uid == evt.model.uid) {
                data.splice(idx, 1);
                return dataItem;
            }
        }
    }
  4. Huan
    Huan avatar
    4 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2017 Link to this post

    Temporarily resolved by add a custom remove event handler.

    Dojo: dolo link

    remove: function(evt) {
        var grid = evt.sender;
        var data = grid.dataSource.data();
        for (let idx = 0; idx < data.length; idx++) {
            var dataItem = data.at(idx);
            if (dataItem.uid == evt.model.uid) {
                data.splice(idx, 1);
                return dataItem;
            }
        }
    }
Back to Top