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

Binding dropdownlist to a subarray

1 Answer 77 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ashish
Top achievements
Rank 1
Ashish asked on 09 Jul 2012, 05:31 AM
Hello, 
hoping that this will be simple, i am trying to show all the root collections exposed by a odata service. The code looks like this

  $(document).ready(
        function () {
            $("#widgetList").kendoDropDownList({
                dataSource:
                {
                    type: "json",
                    transport:
                    {
                        read: "/DynamicOData/oData/?$format=json"
                    }
                }
            })
        });

the values returned are by the service is
{
"d" : {
"EntitySets": [
"TopSellers", "WorstSellers"
]
}
}

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Jul 2012, 06:31 AM
Hello Ashish,

You should use the DataSource schema data function to get the needed data from the returned result or specify the path from which it can be retrieved e.g.

dataSource:
{
    type: "json",
    transport:
    {
        read: "/DynamicOData/oData/?$format=json"
    },
    schema: {     
        data: "d.EntitySets"
    }
}
Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
DropDownList
Asked by
Ashish
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or