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

Kendo UI sync() not firing when datasource._destroyed is populated (dirty)

2 Answers 156 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Stan
Top achievements
Rank 1
Stan asked on 06 Oct 2014, 02:53 PM
Here is slimmed down version of code:
gridDataSource = new kendo.data.DataSource({
        batch: true,
        transport: {
            read: {
                url: 'Equipment'
            },
            destroy: {
                url: 'Equipment',
                contentType: "application/json",
                dataType: 'json',
                type: "DELETE"
            },
            parameterMap: function (options, operation) {
                if (operation == "read") {
                    return "this=works-fine";
                } else {
                    alert('not reading');
                    return kendo.stringify(options.models);
                }
            }
        },
        schema: {
            id: "EquipmentId",
            fields: {
                EquipmentId: { type: "number" }
            }
        }
    });
 
kendoGrid = gridObj.kendoGrid({
        dataSource: gridDataSource,
        selectable: 'row',
        navigatable: true,
        change: rowSelect,
        sortable: true,
        pageable: false,
        editable: { confirmation: false },
        columns: [
            { field: "EquipmentId" },
        ]
    }).data('kendoGrid');

And the read works just fine, I remove a row (or many) with this (selectedRow is populated correctly, just skipped for brevity):
$('#footer-remove').off().on('click', function () {
        kendoGrid.removeRow('table tr[data-uid="' + selectedRow.uid + '"]');
        console.log(gridDataSource._destroyed);
    });

And its shows up in gridDataSource._destroyed, all my tests all show that the gridDataSource is dirty.When I call sync, nothing happens if I am just deleting. What am I missing? Thank you.

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 08 Oct 2014, 11:46 AM
Hello Stan,

Could you please demonstrate your case with a small demo? Here is an example that shows that when several rows are removed the sync methods sends a request to the server.

http://dojo.telerik.com/@pesho/IMafI

Feel free to modify my example to demonstrate your case if I missed something.

Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Stan
Top achievements
Rank 1
answered on 16 Oct 2014, 06:35 PM
turns out my schema did not include 'model'
Tags
Data Source
Asked by
Stan
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Stan
Top achievements
Rank 1
Share this question
or