1

I have tried doing it in jQuery :

var dropdownlist = $("#Instrument").data("kendoDropDownList");
dropdownlist.select(function(dataItem) {
    return dataItem.symbol === "test";
});

Sources:
- http://jsfiddle.net/OnaBai/mRmNJ/
- Change selected value of kendo ui dropdownlist

Is there a way to do this using AngularJS without directly accessing DOM?

Community
  • 1
  • 1
Kim Honoridez
  • 917
  • 2
  • 15
  • 28
  • Binding works differently in angular than it did in jquery. Look into the ng-model directive. It is used to bind things in angular. – DavidEdwards Mar 11 '15 at 03:02

1 Answers1

1

Change Dropdown list selected value in Angularjs
live code is :http://jsfiddle.net/RLQhh/992/

controller.js

app.controller('SelectController', function ($scope) {

    $scope.data = [
    { "symbol": "GOOG" }, 
    { "symbol": "AAPL" },
    { "symbol": "HPQ" },
    { "symbol": "CSCO" }
    ];

    $scope.label = '';
    $scope.change = function(){
    $scope.label =$scope.data[2].symbol;
    }

});

HTML code is

<div ng-controller="SelectController">
    <Button ng-click="change()" >Button</Button>
    <select class="form-control"  ng-model="label" ng-change="showTask()"   ng-options="d.symbol as d.symbol for d in data" >
                <option value="" disabled>Select Task</option>
                            </select>
</div>
P.JAYASRI
  • 358
  • 2
  • 18