TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
المبتكر العربي
1.6k
115
3.3k
autocomplete load data on focus
Oct 13 2017 10:09 AM
hi all
i have ac# MVC project with angular ls and entity framework
in my view i put an angucomplete with its controller
and it works properly
i want to load dropdown data when i focus in the textbox search of the autocomplete
my angular controller is
app.controller("HomeController", ['$scope', '$http', function ($scope, $http) {
$scope.countries = [];
$scope.SelectedCountries = null;
$scope.AfterSelectedCoutries = function (selected) {
if (selected) {
$scope.SelectedCountries = selected.originalObject;
}
}
$http.get("/Home/Get_Doctor").then(function (d) {
$scope.countries = d.data;
$timeout(function () {
var searchInput = document.getElementById('txtautocomplete');
searchInput.focus();
}, 0);
}, function (error) {
alert('Failed');
})
}])
and my HTML code is
<div class="form-group">
<label for="title" class="col-sm-2 control-label">Doctor</label>
<div class="col-sm-10">
<div ng-controller="HomeController">
<div angucomplete-alt id="txtautocomplete"
placeholder="Type Doctor name" pause="100"
selected-object="AfterSelectedCoutries"
local-data="countries" search-fields="Doctor_Name_Arabic"
title-field="Doctor_Name_Arabic" minlength="1"
input-class="form-control" match-class="highlight">
</div>
Reply
Answers (
1
)
When should I use an attribute versus an element?
angucomplete or angular autocomplete multi select