How to set the Combobox'value (SelectedBox) from javascript code?
Demo of the component
I need to set the value from javascript code, I use AngularJS!
from component's api I didn't see how to set it!
http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxSelectBox/?version=15_2
There is the value option in the dxSelectBox API. Well, just set this option. If you want to use a two-way binding for the selectbox value, use the bindingOptions object.
HTML
<div dx-select-box="{dataSource: data, bindingOptions: { value: 'selectedItem' } }"></div>
JS
myApp.controller("myCtrl", function($scope) {
$scope.data = [/* your data */];
$scope.selectedItem = $scope.data[0];
});
I've created the small sample here.