AngularJS isteven-multi-select限制显示选项 [英] AngularJS isteven-multi-select limit display options

查看:405
本文介绍了AngularJS isteven-multi-select限制显示选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用isteven-multi-select来显示DB中的选择选项.不幸的是,它可能是非常大的数组(从几个"到"+ 100K"记录).这就是为什么我将智能选择与过滤器一起使用的原因.有什么方法可以设置渲染选项的限制以提高性能?当前,大型数组会删除一个js和一个firefox.

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.

我的选择:

<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>

控制器:

...
DataInfoResource.query(
    function(data) {
        $scope.data.select.options = data;
        console.log(data);
    }
);
....

我也尝试过select2,但找不到任何方法.

I also tried select2 but I do not find any way how to do it.

谢谢您的建议.

推荐答案

当列表大小更大时,这就是我要做的事情.不知道它是否适用于10万条记录,但是您仍然可以尝试. 6k记录确实很好用. 修改了isteven-multi-select.js中的模板,如下所示

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 ="filteredModel中的项目| filter:removeGroupEndMarker" class ="multiSelectItem"'

filteredModel中的ng-repeat ="item | filter:removeGroupEndMarker | limitTo:100" class ="multiSelectItem"'

这篇关于AngularJS isteven-multi-select限制显示选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆