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

Remote Databinding doesn't seem to work within window

3 Answers 79 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Stacey
Top achievements
Rank 1
Stacey asked on 19 Nov 2013, 01:47 AM
I made this topic once, but the information I had was a bit hard to follow and I did not get much help, so I am trying again after spending the day making a JSBIN sample.

I have a situation where I am using KendoUI to make a view model, and also to make some items within it, and when you click on sub-items that are drawn, it opens up a `KendoWindow` to let you edit them more specifically.

However, there is a problem with the `dataSource` concept, I think. When I try to bind to a `dataSource` on my page it works fine; But when I try to bind a kendo control to a `remote` datasource within a rendered window, it refuses to fetch.

If I bind only to local data, hard coded data, it works; So I know the `dropdownlist` is working. But I really need to be able to bind to remote data.

I have prepared a jsbin to show this behavior (or lack thereof)

jsBin

Any help would be greatly appreciated. To see the behavior, click on the button to `Create Socket Rail`, then use the `NumericTextBox` to increase the size to any number higher than 0, then click on one of the drawn boxes.

3 Answers, 1 is accepted

Sort by
0
Stacey
Top achievements
Rank 1
answered on 19 Nov 2013, 03:39 AM
Also, This only happens with the REMOTE data source. If I pass in a hard-typed array, it works fine.
0
Alexander Popov
Telerik team
answered on 21 Nov 2013, 08:33 AM
Hello Stacey,

I reviewed the the provided example and noticed the following:
  • The type property is set to JSON, however currently the only available option is OData. Perhaps this was mistaken with the transport.read.dataType option.
  • The read.URL points to a .js file. Reading from plain JavaScript files is unsupported. I would recommend using a web service that returns valid JSON responses 
  • The data attribute initialization of the DropDownList contains only value and it point to a Color property of the viewModel, which is not declared anywhere. In order to get the DropDownList working you should also specify the source and text and value fields. You can an MVVM DropDownList example here.
I've updated your example here, to demonstrate that there are no issues with the remote binding in a Window when proper web service is used.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Stacey
Top achievements
Rank 1
answered on 21 Nov 2013, 05:56 PM
This is a lot messier than the answer I got from someone on stack overflow.

The solution turned out to be just initializing the drop down list within the activate method of the window, and to make sure to remove the window template from the DOM before doing so.

jsBin Solution

Tags
DropDownList
Asked by
Stacey
Top achievements
Rank 1
Answers by
Stacey
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or