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

Why is the combobox spinning forever?

2 Answers 124 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Anker Berg-Sonne
Top achievements
Rank 1
Anker Berg-Sonne asked on 06 Apr 2012, 02:21 PM
I am sure I am making some trivial error, but I can't figure it out.

I have a kendoComboBox that I have a placeholder for as follows:

 <input id="ComboBox1" />

And  my $(document).ready function contains:

      SpaceDataSource = new kendo.data.DataSource(
        {
          transport: {
            read: {
              url: "LoadSpacesJson.aspx",
              dataType: "json"
            }
          }
        }
      );
      $("#ComboBox1").kendoComboBox(
        {
          dataTextField: "Name",
          dataValueField: "Value",
          dataSource: SpaceDataSource
        }
      );

where SpaceDataSource is a global variable.

My datasource gets called correctly and returns the following as document type application/json:

[{Value:29,Name:"Alex Stankovic 135A"},{Value:18,Name:"Blake lab 122"},{Value:25,Name:"Class room 106"},{Value:19,Name:"Class room 108"},{Value:22,Name:"Class room 111A"},{Value:12,Name:"Class room 111B"},{Value:7,Name:"Computer lab 116"},{Value:13,Name:"Computer lab 118"},{Value:30,Name:"Conference room 127"},{Value:14,Name:"CS office 102"},{Value:26,Name:"Double lab 120"},{Value:8,Name:"EE office 101"},{Value:21,Name:"George Preble 133"},{Value:6,Name:"Gomez lab 103"},{Value:24,Name:"Graduate offices 107"},{Value:20,Name:"Graduate offices 137"},{Value:9,Name:"Prof. Hopwood 101A"},{Value:10,Name:"Ron Lasser 125"},{Value:27,Name:"Shuchin Aeron 242"},{Value:16,Name:"Student lounge 123"},{Value:17,Name:"TA offices/Meeting room 121"},{Value:28,Name:"Usman Khan 135"}]

My problem is that the kendoComboBox appears, but there's a spinner on it that just keeps spinning indefinitely and it never creates the proper dropdown list.

Any help will be appreciated.

Thanks/Anker

 

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Apr 2012, 07:21 PM
Hello,

Is this your real output? If yes this is not valid JSON and most probably this is causing the problem. You need to quote the keys in the JSON response:

 [{"Value":29, "Name":"Alex Stankovic 135A"},

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mike
Top achievements
Rank 1
answered on 31 May 2013, 08:29 PM
I had a similar issue, I had forgotten to add JsonRequestBehavior.AllowGet to my returning Json object from the controller.
Tags
Data Source
Asked by
Anker Berg-Sonne
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Mike
Top achievements
Rank 1
Share this question
or