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

operations Add->Sync doesn't work on XML DataSource (only Kendo UI v2012.3.106)

1 Answer 72 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 25 Apr 2012, 07:57 AM
Hi!

Operation Add, and Sync nothing to do. No XHR queryes from client to server after sync operation.

Example:

dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: pub.root("pages/?read"),
                    type: "POST"
                },
                create: {
                    url: pub.root("pages/?create"),
                    type: "POST"
                },
                destroy: {
                    url: pub.root("pages/?delete"),
                    type: "POST"
                },
                update: {
                    url: pub.root("pages/?update"),
                    type: "POST"
                }
            },
            schema: {
                type: "xml",
                data: "Response/pages/item",
                model: {
                    id: "id",
                    fields: {
                        id: "id/text()",
                        name: "name/text()"
                    }
                },
                total: "Response/pages/@total"
            },
            serverPaging: true,
            serverSorting: true,
            serverFiltering: true,
            pageSize: 100
        });

var item = {};
item["id"] = null;
item["name"] = 'Hello';

dataSource.add(item);
dataSource.sync();

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 27 Apr 2012, 12:32 PM
Hi Anton,

The reason for DataSource not sending a request to save the new entry is that a non default value is assign to the id field. Removing the id field assignment should resolve the described issue.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Anton
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or