问题
I am using the isteven-multi-select to display select options from DB. Unfortunatelly it could be really large array (from "a few" to "+100K" records). That is the reason why I use a smart select with a filter. Is there any way how can I set limit of rendering options to improve performance? Currently the large array drop down a js and a firefox.
My select:
<div isteven-multi-select
input-model="data.select.options"
output-model="data.select.data"
button-label="label"
item-label="id label"
tick-property="ticked"
max-labels="4" >
</div>
Controller:
...
DataInfoResource.query(
function(data) {
$scope.data.select.options = data;
console.log(data);
}
);
....
I also tried select2 but I do not find any way how to do it.
Thanks for any advice.
回答1:
This is what I did when the list size is more. Not sure if it would work for 100k records but still you can try. It really worked well for 6k record. Modified the template in isteven-multi-select.js as follows
'ng-repeat="item in filteredModel | filter:removeGroupEndMarker" class="multiSelectItem"'
to
'ng-repeat="item in filteredModel | filter:removeGroupEndMarker | limitTo:100" class="multiSelectItem"'
回答2:
May be try this one:
<div isteven-multi-select ... max-height="250px"></div>
PS. I can't add a comment because the following answer
来源:https://stackoverflow.com/questions/36712528/angularjs-isteven-multi-select-limit-display-options