I understand that 2000 options in a select box is going to bring along some performance issues, but it works fine on Chrome and Firefox and Safari.
Basically, I am calling a web service which populates a select box. This is fairly quick and performance is fine on initial load. The issue is when I change routes, and then come back to the page with the select box on it. It takes ~40 seconds to load the view on IE. Is there anyway way to improve performance?
This is how it is set up:
<select name="" id="" ng-model="model.searchParams.shipto" ng-options="ship.cd as ship.cd + (ship.cd===''?'' : ' - ') + ship.ds for ship in shiptoSelect" class="dropdownbar"></select>
This is the call that is made to retrieve the results. This is only executed once, and then the results are stored in my globalParams. So when I return to this view, this is not executed and the results are loaded from my globalParams service. That is when I run into performance issues.
$scope.getShipTo = function() {
$scope.model.searchParams.shipto = '';
$scope.model.showProgress = true;
MagicAPI.getShipToResults($scope.model.searchParams.brand, $scope.model.searchParams.soldto).then(function(response) {
if (response.status === 200) {
var resSHIPAR = eval(response.data);
var resSHIPStr = resSHIPAR;
if (resSHIPStr.length * 1 === 0) {
globalParams.getAlertList().push({
type: 'info',
msg: 'No ship-to\'s exist for this account.'
});
$scope.model.showProgress = false;
return;
} else {
var selectObj = {
cd: '',
ds: '-- select --'
};
resSHIPStr.splice(0, 0, selectObj);
globalParams.setShipToList(resSHIPStr);
$scope.shiptoSelect = resSHIPStr;
$scope.model.showProgress = false;
for (var i = 0; i < resSHIPStr.length; i++) {
if(resSHIPStr[i].cd === $scope.model.searchParams.soldto) {
$scope.isSoldToMatch = true;
return;
} else {
$scope.isSoldToMatch = false;
}
}
if ($scope.isSoldToMatch === false) {
globalParams.getAlertList().push({
type: 'info',
msg: 'No ship-to\'s exist for this account.'
});
}
}
}
}, function(response) {
$log.debug(response);
});
};
I learn JavaScript now, and encounter with next problem: I have page with some frames, and I want to load some page into one of specified frames; But code below does not do what I want. Could you ...
I learn JavaScript now, and encounter with next problem: I have page with some frames, and I want to load some page into one of specified frames; But code below does not do what I want. Could you ...
I have several cases on my software where I have an array of observables and I need to execute them in order. Having the next subscription to happen only after the previous is complete. So Im using ...
I have several cases on my software where I have an array of observables and I need to execute them in order. Having the next subscription to happen only after the previous is complete. So Im using ...
I've made a game with JavaScript where a player can only guess a random number from 1 to 10 three times, each time the program reads a wrong answer it displays what should've been the right answer, ...
I've made a game with JavaScript where a player can only guess a random number from 1 to 10 three times, each time the program reads a wrong answer it displays what should've been the right answer, ...
In my site I have a switch between a down arrow & and an up arrow. See here How do I change this to a CSS transition, so there's a brief break between the switch? Here's my code: function ...
In my site I have a switch between a down arrow & and an up arrow. See here How do I change this to a CSS transition, so there's a brief break between the switch? Here's my code: function ...