Two issues I'm having using the AutoComplete control with Angular...
I'm trying to bind the object/dataItem of the selected item in an autocomplete control to an object on my controller.
It works, although the object vm.Account is always an array with a single item? How can I make this simply be the selected item?
It works great with the DropDownList.
2nd problem is the value is being bound to the dataTextField, not the dataValueField.
I can look in chrome console and go
and I have the correct field name but when I go
I have the value from the dataTextField. And that is of course what is stored in vm.Deal.AccountId
Any ideas on either of those. The array I can work with, although not desirable I can use the on-change/select event and handle that myself...but the value() is a touch strange. Well, i guess I can also deal with that in the on-change!!!
Still...it'd be nice if someone could see the errors of my ways!
Thx
Steve
I'm trying to bind the object/dataItem of the selected item in an autocomplete control to an object on my controller.
<
input
type
=
"text"
id
=
"acAccount"
ng-model
=
"vm.Deal.AccountId"
k-ng-model
=
"vm.Account"
<br> kendo-auto-complete="acAccount" k-options="vm.accountAutoComplete" />
It works, although the object vm.Account is always an array with a single item? How can I make this simply be the selected item?
It works great with the DropDownList.
2nd problem is the value is being bound to the dataTextField, not the dataValueField.
I can look in chrome console and go
$scope.acAccount.options.dataValueField
and I have the correct field name but when I go
$scope.acAccount.value()
I have the value from the dataTextField. And that is of course what is stored in vm.Deal.AccountId
Any ideas on either of those. The array I can work with, although not desirable I can use the on-change/select event and handle that myself...but the value() is a touch strange. Well, i guess I can also deal with that in the on-change!!!
Still...it'd be nice if someone could see the errors of my ways!
Thx
Steve