mvc angularjs AutoComplete error when loading more than 16000 records from local databaseSorting jqGrid in ASP.NET MVC client view with jQuery and LINQ-to-EntitiesError message 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'iframe can't be as wide as its jQuery dialog containerPrettyPhoto - how to track when user closes the modal boxIs there a way to make AngularJS load partials in the beginning and not at when needed?AngularJS : Prevent error $digest already in progress when calling $scope.$apply()Angularjs autocomplete from $httpMVC 4 The model item passed into the dictionary is of type errormvc using angular js when value change in dropdownlist table data changeshow do you connect angular js to node js
Does Wolfram Mathworld make a mistake describing a discrete probability distribution with a probability density function?
Why did Windows 95 crash the whole system but newer Windows only crashed programs?
Strange pattern-matching: is it correct?
Removing all material slots in one go
What are the closest international airports in different countries?
Is it error of law to judge on less relevant case law when there is much more relevant one?
How many oliphaunts died in all of the Lord of the Rings battles?
Why would a pilot use ailerons for countering asymmetric thrust in mid-flight?
When I cite content from a book, should I say "section 2.3.2.1 of book... " or "section 2.3.2.1 of `the` book ..."?
Summoning A Technology Based Demon
Is this photo showing a woman standing in the nude before teenagers real?
How could Nomadic scholars effectively memorize libraries worth of information
How can religions be structured in ways that allow inter-faith councils to work?
Did the Americans trade destroyers in the "destroyer deal" that they would later need themselves?
How do I learn to recognise what is worth publishing
Struggling with cyclical dependancies in unit tests
What is the most efficient way to write 'for' loops in Matlab?
Telling manager project isn't worth the effort?
What is "aligned sequences" and "consensus sequence" in the context of sequence logo? How to compute these?
Why is it "on the inside" and not "in the inside"?
Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?
List of visa access for each country
Differentiation of a ket vector with respect to a spatial dimension
What language is Raven using for her attack in the new 52?
mvc angularjs AutoComplete error when loading more than 16000 records from local database
Sorting jqGrid in ASP.NET MVC client view with jQuery and LINQ-to-EntitiesError message 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'iframe can't be as wide as its jQuery dialog containerPrettyPhoto - how to track when user closes the modal boxIs there a way to make AngularJS load partials in the beginning and not at when needed?AngularJS : Prevent error $digest already in progress when calling $scope.$apply()Angularjs autocomplete from $httpMVC 4 The model item passed into the dictionary is of type errormvc using angular js when value change in dropdownlist table data changeshow do you connect angular js to node js
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm new to angularJS so apologies before hand if something is not very clear.
I'm trying to create a master donor search for a prototype internal app. I can get the data which is ~7.5mill records and loaded to a var. Problem is the UI throws an error if I remove Take() or leave Take(> 16000) records. Is there something that I'm missing or Is this not the recommended approach for the search purpose ?
Ideally, I want users to be able to search every donor. I'm using angucomplete-alt.js for the autocomplete part. angucomplete-alt.js
View :
@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>Controller:
public JsonResult GetDonors()
using (SeDbEntities dc = new SeDbEntities())
var v = (from ln in dc.A01_AccountMaster
where ln.LastName != null & ln.LastName != string.Empty
select new
ln.LastName
,
ln.FirstName
,
ln.AccountNumber
,
FullName = ln.FirstName +" "+ ln.LastName
,
AcctNm = ln.LastName + ", " + ln.FirstName +" "+ln.AccountNumber
).OrderBy(n => n.LastName.Trim()).Take(16000).ToList();
return new JsonResult Data = v, JsonRequestBehavior = JsonRequestBehavior.AllowGet ;
}
Scripts:
var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);jquery angularjs entity-framework linq asp.net-mvc-4
add a comment |
I'm new to angularJS so apologies before hand if something is not very clear.
I'm trying to create a master donor search for a prototype internal app. I can get the data which is ~7.5mill records and loaded to a var. Problem is the UI throws an error if I remove Take() or leave Take(> 16000) records. Is there something that I'm missing or Is this not the recommended approach for the search purpose ?
Ideally, I want users to be able to search every donor. I'm using angucomplete-alt.js for the autocomplete part. angucomplete-alt.js
View :
@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>Controller:
public JsonResult GetDonors()
using (SeDbEntities dc = new SeDbEntities())
var v = (from ln in dc.A01_AccountMaster
where ln.LastName != null & ln.LastName != string.Empty
select new
ln.LastName
,
ln.FirstName
,
ln.AccountNumber
,
FullName = ln.FirstName +" "+ ln.LastName
,
AcctNm = ln.LastName + ", " + ln.FirstName +" "+ln.AccountNumber
).OrderBy(n => n.LastName.Trim()).Take(16000).ToList();
return new JsonResult Data = v, JsonRequestBehavior = JsonRequestBehavior.AllowGet ;
}
Scripts:
var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);jquery angularjs entity-framework linq asp.net-mvc-4
add a comment |
I'm new to angularJS so apologies before hand if something is not very clear.
I'm trying to create a master donor search for a prototype internal app. I can get the data which is ~7.5mill records and loaded to a var. Problem is the UI throws an error if I remove Take() or leave Take(> 16000) records. Is there something that I'm missing or Is this not the recommended approach for the search purpose ?
Ideally, I want users to be able to search every donor. I'm using angucomplete-alt.js for the autocomplete part. angucomplete-alt.js
View :
@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>Controller:
public JsonResult GetDonors()
using (SeDbEntities dc = new SeDbEntities())
var v = (from ln in dc.A01_AccountMaster
where ln.LastName != null & ln.LastName != string.Empty
select new
ln.LastName
,
ln.FirstName
,
ln.AccountNumber
,
FullName = ln.FirstName +" "+ ln.LastName
,
AcctNm = ln.LastName + ", " + ln.FirstName +" "+ln.AccountNumber
).OrderBy(n => n.LastName.Trim()).Take(16000).ToList();
return new JsonResult Data = v, JsonRequestBehavior = JsonRequestBehavior.AllowGet ;
}
Scripts:
var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);jquery angularjs entity-framework linq asp.net-mvc-4
I'm new to angularJS so apologies before hand if something is not very clear.
I'm trying to create a master donor search for a prototype internal app. I can get the data which is ~7.5mill records and loaded to a var. Problem is the UI throws an error if I remove Take() or leave Take(> 16000) records. Is there something that I'm missing or Is this not the recommended approach for the search purpose ?
Ideally, I want users to be able to search every donor. I'm using angucomplete-alt.js for the autocomplete part. angucomplete-alt.js
View :
@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>Controller:
public JsonResult GetDonors()
using (SeDbEntities dc = new SeDbEntities())
var v = (from ln in dc.A01_AccountMaster
where ln.LastName != null & ln.LastName != string.Empty
select new
ln.LastName
,
ln.FirstName
,
ln.AccountNumber
,
FullName = ln.FirstName +" "+ ln.LastName
,
AcctNm = ln.LastName + ", " + ln.FirstName +" "+ln.AccountNumber
).OrderBy(n => n.LastName.Trim()).Take(16000).ToList();
return new JsonResult Data = v, JsonRequestBehavior = JsonRequestBehavior.AllowGet ;
}
Scripts:
var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>@
ViewBag.Title = "Index";
<div class="container">
<h2>Search Donor</h2>
<div ng-app="donorSearch">
<div ng-controller="ngAutoCompleteController">
<div angucomplete-alt id="txtAutocomplete" placeholder="Type Donor name" pause="100"
selected-object="afterSelectedDonor" local-data="Donors" search-fields="LastName,FirstName,AccountNumber"
title-field="AcctNm" minlength="1" input-class="form-control" match-class="highlight" >
</div>
<div ng-show="SelectedDonor">
Selected Donor : SelectedDonor.FullName
</div>
</div>
</div>
</div>
@* JS *@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script>
<script src="~/Scripts/angucomplete-alt.js"></script>
<script src="~/Scripts/donorSearch.js"></script>
@* CSS *@
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/angucomplete-alt.css" rel="stylesheet" />
<style type="text/css">
.angucomplete-dropdown
overflow-y: auto;
max-height: 200px;
</style>var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);var app = angular.module('donorSearch', ['angucomplete-alt']);
app.controller('ngAutoCompleteController', ['$scope', '$http', function($scope, $http)
$scope.Donors = [];
$scope.SelectedDonor = null;
//After select donor event
$scope.afterSelectedDonor = function(selected)
if (selected)
$scope.SelectedDonor = selected.originalObject;
//Populate data from database
$http(
method: 'GET',
url: '/home/GetDonors'
).then(function(data)
$scope.Donors = data.data;
, function()
alert('Error');
)
]);jquery angularjs entity-framework linq asp.net-mvc-4
jquery angularjs entity-framework linq asp.net-mvc-4
edited Mar 26 at 19:43
danielruizffp
asked Mar 26 at 19:37
danielruizffpdanielruizffp
85 bronze badges
85 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Beware of any "samples" provided by control makers. They are pretty much guaranteed to present only the most basic scenarios, and typically aren't relevant out in the real world. From what I can see of that control the example demonstrates client-side auto-complete, which for all practical purposes is useless. (Just use a drop-down in that case) You're running into a problem because you're trying to provide a complete list of all data to the client. Client side works when you have a relatively small # of items (100's - 1000's) but not when you have a lot more.
For an auto-complete control, you want to find examples of implementing a server-side auto-complete. This involves wiring the control to an HTTP GET / Fetch so that as you type into the control, a server call goes and runs a query to fetch suggestions matching what the person types, and returns a limited # of suggestions. (I.e. 500) It's up to you to implement the search logic, such as finding matches starting with what is typed, vs. using other querying methods. The other important detail is to also use a debounce on your input event to ensure that your search isn't fired off repeatedly with every key-press from the user, but waits a moment so that if a user is typing 4 characters ("fred") and pausing, 1 search goes off for "fred" rather than 4 searches: "f", "fr", "fre", and "fred".
Somewhere to start:
https://itnext.io/using-angular-6-material-auto-complete-with-async-data-6d89501c4b79
There are probably a large number of auto-complete controls for Angular, look for server side examples/implementations, and be sure to add a debounce.
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365041%2fmvc-angularjs-autocomplete-error-when-loading-more-than-16000-records-from-local%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Beware of any "samples" provided by control makers. They are pretty much guaranteed to present only the most basic scenarios, and typically aren't relevant out in the real world. From what I can see of that control the example demonstrates client-side auto-complete, which for all practical purposes is useless. (Just use a drop-down in that case) You're running into a problem because you're trying to provide a complete list of all data to the client. Client side works when you have a relatively small # of items (100's - 1000's) but not when you have a lot more.
For an auto-complete control, you want to find examples of implementing a server-side auto-complete. This involves wiring the control to an HTTP GET / Fetch so that as you type into the control, a server call goes and runs a query to fetch suggestions matching what the person types, and returns a limited # of suggestions. (I.e. 500) It's up to you to implement the search logic, such as finding matches starting with what is typed, vs. using other querying methods. The other important detail is to also use a debounce on your input event to ensure that your search isn't fired off repeatedly with every key-press from the user, but waits a moment so that if a user is typing 4 characters ("fred") and pausing, 1 search goes off for "fred" rather than 4 searches: "f", "fr", "fre", and "fred".
Somewhere to start:
https://itnext.io/using-angular-6-material-auto-complete-with-async-data-6d89501c4b79
There are probably a large number of auto-complete controls for Angular, look for server side examples/implementations, and be sure to add a debounce.
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
add a comment |
Beware of any "samples" provided by control makers. They are pretty much guaranteed to present only the most basic scenarios, and typically aren't relevant out in the real world. From what I can see of that control the example demonstrates client-side auto-complete, which for all practical purposes is useless. (Just use a drop-down in that case) You're running into a problem because you're trying to provide a complete list of all data to the client. Client side works when you have a relatively small # of items (100's - 1000's) but not when you have a lot more.
For an auto-complete control, you want to find examples of implementing a server-side auto-complete. This involves wiring the control to an HTTP GET / Fetch so that as you type into the control, a server call goes and runs a query to fetch suggestions matching what the person types, and returns a limited # of suggestions. (I.e. 500) It's up to you to implement the search logic, such as finding matches starting with what is typed, vs. using other querying methods. The other important detail is to also use a debounce on your input event to ensure that your search isn't fired off repeatedly with every key-press from the user, but waits a moment so that if a user is typing 4 characters ("fred") and pausing, 1 search goes off for "fred" rather than 4 searches: "f", "fr", "fre", and "fred".
Somewhere to start:
https://itnext.io/using-angular-6-material-auto-complete-with-async-data-6d89501c4b79
There are probably a large number of auto-complete controls for Angular, look for server side examples/implementations, and be sure to add a debounce.
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
add a comment |
Beware of any "samples" provided by control makers. They are pretty much guaranteed to present only the most basic scenarios, and typically aren't relevant out in the real world. From what I can see of that control the example demonstrates client-side auto-complete, which for all practical purposes is useless. (Just use a drop-down in that case) You're running into a problem because you're trying to provide a complete list of all data to the client. Client side works when you have a relatively small # of items (100's - 1000's) but not when you have a lot more.
For an auto-complete control, you want to find examples of implementing a server-side auto-complete. This involves wiring the control to an HTTP GET / Fetch so that as you type into the control, a server call goes and runs a query to fetch suggestions matching what the person types, and returns a limited # of suggestions. (I.e. 500) It's up to you to implement the search logic, such as finding matches starting with what is typed, vs. using other querying methods. The other important detail is to also use a debounce on your input event to ensure that your search isn't fired off repeatedly with every key-press from the user, but waits a moment so that if a user is typing 4 characters ("fred") and pausing, 1 search goes off for "fred" rather than 4 searches: "f", "fr", "fre", and "fred".
Somewhere to start:
https://itnext.io/using-angular-6-material-auto-complete-with-async-data-6d89501c4b79
There are probably a large number of auto-complete controls for Angular, look for server side examples/implementations, and be sure to add a debounce.
Beware of any "samples" provided by control makers. They are pretty much guaranteed to present only the most basic scenarios, and typically aren't relevant out in the real world. From what I can see of that control the example demonstrates client-side auto-complete, which for all practical purposes is useless. (Just use a drop-down in that case) You're running into a problem because you're trying to provide a complete list of all data to the client. Client side works when you have a relatively small # of items (100's - 1000's) but not when you have a lot more.
For an auto-complete control, you want to find examples of implementing a server-side auto-complete. This involves wiring the control to an HTTP GET / Fetch so that as you type into the control, a server call goes and runs a query to fetch suggestions matching what the person types, and returns a limited # of suggestions. (I.e. 500) It's up to you to implement the search logic, such as finding matches starting with what is typed, vs. using other querying methods. The other important detail is to also use a debounce on your input event to ensure that your search isn't fired off repeatedly with every key-press from the user, but waits a moment so that if a user is typing 4 characters ("fred") and pausing, 1 search goes off for "fred" rather than 4 searches: "f", "fr", "fre", and "fred".
Somewhere to start:
https://itnext.io/using-angular-6-material-auto-complete-with-async-data-6d89501c4b79
There are probably a large number of auto-complete controls for Angular, look for server side examples/implementations, and be sure to add a debounce.
answered Mar 26 at 23:23
Steve PySteve Py
8,0451 gold badge12 silver badges22 bronze badges
8,0451 gold badge12 silver badges22 bronze badges
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
add a comment |
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
i kinda forgot about doing something like that as I was focused on a "Angular Solution" but let me follow the link provided, thanks for the suggestion
– danielruizffp
Mar 27 at 12:36
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365041%2fmvc-angularjs-autocomplete-error-when-loading-more-than-16000-records-from-local%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown