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

Remote DataSource Issue

1 Answer 64 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 02 Feb 2013, 06:02 AM
Hey Guys,

I'm having a problem getting a dropdown list to work properly. Below is the code I'm using:

$(("#category").kendoDropDownList({
        dataTextField:"category",
        dataValueField:"id",
        autoBind:false,
        optionLabel:"All",
        dataSource:{
            transport:{
                dataType:'json',
                read:'/products/category/json_category/
            },
            schema:{
                data:"results"
            }
        },
});

This is my json response:

{ "results":[ { "category":"03", "id":"512" }]}

The json request fires when clicking on the dropdown list, but it just sits there with the loading spinner... Any ideas?

If I specify a manual list of items as the datasource, it works fine ><

1 Answer, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 02 Feb 2013, 06:25 AM
FIXED BY USING: 

        dataSource:{
            transport:{
                read:{
                    url:'/products/category/json_category/',
                    contentType:'application/json; charset=utf-8',
                    type:'GET',
                    dataType:'json'
                }
            }
        },
Tags
DropDownList
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Share this question
or