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

Dealing with complex JSON & CRUD

3 Answers 280 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 12 Apr 2012, 10:57 PM
I have a web service that returns something similar to this
{ "RowSet": {
        "Key": "7256bd2d-879f-494b-a7c0-f0d6ed2eba84",
        "Rows": [
            { "RowNum": 1, "Name": "Fred", "Value": 123 },
            { "RowNum": 2, "Name": "Mary", "Value": 323 },
            { "RowNum": 3, "Name": "John", "Value": 732 },
            { "RowNum": 4, "Name": "Sue", "Value": 895 }
        ]
    }
}

In a data source, I bind to RowSet.Rows, but I need the Key field to be part of the rows in order to enable CRUD operations.

ideally, I would like to specify something like this:

schema: {
    data: "RowSet.Rows",
    model: {
        id: "RowNum",
        fields: {
            Key: { editable: false, type: "string", path="..\Key" or path="this.parent().Key" }
            RowNum: { editable: false, type: "number" },
            Name: { editable: true, type: "string" },
            Value: { editable: true, type: "number" },
        }
    }

Is this possible in some way?

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 13 Apr 2012, 03:33 PM
Hi Steven,

Currently the dataSource does not support nested structures and for that reason I am afraid the scenario that you described is not possible.

This functionality is of a high priority and its implementation is already planned for future versions of the framework.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steven
Top achievements
Rank 1
answered on 13 Apr 2012, 03:41 PM
That is great news!    I look forward to the next release.    Thanks.
0
Alexander Valchev
Telerik team
answered on 17 Apr 2012, 08:56 AM
Hello Steven,

After reviewing your case with the developer team, it seems that your requirement is not connected with the hierarchical dataSource and is not going to be implemented in the next release.

It may be a good addition to the dataSource component though, that is why we will appreciate if you submit it at our user voice page. Thus way the other users would be able to evaluate the idea and cast their votes for it. If it turns out to be popular, we will consider it for one of the future versions.

Please accept my apologies for the inconvenience that my previous reply may caused.

Kind regards,
Alexander Valchev
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
Steven
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Steven
Top achievements
Rank 1
Share this question
or