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

Kendo DropDownList not working with Angular <select kendo-drop-down-list style="margin-left: -20px;" promise

3 Answers 425 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 15 Oct 2014, 10:35 PM
I've got a KendoDropDownList like the following:

<select kendo-drop-down-list
        style="margin-left: -20px;"
        k-options="customOptions" ng-model="selectedBuild" k-rebind="buildDataSource"></select>

I am trying to use it with a controller and service. 

$scope.buildDataSource = new kendo.data.DataSource();
BuildSvc.GetListOfBuilds($routeParams.venueId)
    .then(function (data) {
        $scope.buildDataSource.data(data);
    }
);

However, not only does it not load the data from my JSON source (it is just an array of JSON objects), but it looks like it's triggering some sort of infinite loop on the Angular side:

Unhandled exception at line 12715, column 13 in http://localhost:33394/VenueModelPortal/Scripts/angular.js
 0x800a139e - JavaScript runtime error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
 http://errors.angularjs.org/1.2.20/$rootScope/infdig?p0=10&p1=%5B%5D

How can I correct this so that my combobox is populated by the datasource after the q returns the data?

3 Answers, 1 is accepted

Sort by
0
Sam
Top achievements
Rank 1
answered on 15 Oct 2014, 10:43 PM
I should also mention that it does eventually populate the combobox with the expected values from the service, it just throws a lot of Angular errors first saying that it has gone through many $digest iterations.
0
Sam
Top achievements
Rank 1
answered on 15 Oct 2014, 10:46 PM
Also, the customOptions that I have bound to the drop-down-list looks like the following:

$scope.customOptions = {
    dataSource: $scope.buildDataSource,
    dataTextField: "version",
    dataValueField: "id"};


(I would have added these things to the original post but it won't let me go back and edit.)
0
Kiril Nikolov
Telerik team
answered on 16 Oct 2014, 02:37 PM
Hi Sam,

I have already answered the question in the other support thread that you opened, but I will copy my answer here as well. Hope it helps:

The problem comes from the k-rebind option that you set. First of all it is not needed in your case, and furthermore it should contain options for the widget that will be read when one of the other options is changed and not a dataSource component. Please see the following working example that shows your scenario:
 


Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Integration with other JS libraries
Asked by
Sam
Top achievements
Rank 1
Answers by
Sam
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or