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

Bind dropdownlist to another dropdownlist via angularjs.

1 Answer 242 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jose Mejia
Top achievements
Rank 1
Jose Mejia asked on 04 Aug 2014, 11:15 AM
Hi.

I have two dropdownlists where values of second depend on values of first.
First is something like that:

<select id="Id1"
 kendo-drop-down-list
 k-change="change"
 k-data-bound="prjDataBound"
 k-data-text-field="'Value'"
 k-data-value-field="'id'"
 k-data-source="somesource"
  >
 /select>

and second is the similiar.
For now to change the value in second dropdownbox  I use change method:
1.$scope.change = function (e)
2.{
3.  $scope.mpr = this.dataItem();
4.  var cfLevel = $("#cfLevelId").data("kendoDropDownList");
5.  cfLevel.value($scope.mpr.SomeValue);
6.  $scope.$apply();
7.};


So, I would like to avoid lines 4-5 and  bind to mpr.SomeValue declaratively.
And yes, it is not about cascding.

Is it possible?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 06 Aug 2014, 04:42 AM
Hello Jose,

You can use the ng-model binding to achieve that - please check the following example for one possible approach.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Jose Mejia
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or