2014-10-18 64 views
6

我想使用select2与5000的数据集。角度选择2慢与大数据集

交互速度很慢,特别是搜索。在不久的将来我需要处理大于500,000的数据集。

关于如何提高效率的任何建议?

我没有任何性能问题,但引导程序typeahead,虽然授予,具有较少的功能和显示元素。我也不知道搜索功能如何与typeahead一起使用。

这里的plunker例如,同为演示了选择2,但与5000行数据 http://plnkr.co/edit/RyCTTloW6xp81WvoCzkf?p=preview

<ui-select ng-model="person.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;"> 
    <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match> 
    <ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}"> 
     <div ng-bind-html="person.name | highlight: $select.search"></div> 
     <small> 
      email: {{person.email}} 
      age: <span ng-bind-html="''+person.age | highlight: $select.search"></span> 
     </small> 
    </ui-select-choices> 
</ui-select> 
+3

在我看来,对于大数据集来说,给出下拉功能是没有意义的,你应该只使用typeahead,对于大数据我不认为在给用户下拉值时总是会使用值搜索选择一个项目。 – PSL 2014-10-19 01:44:01

回答

1

的我有同样的问题。 Ui-select的性能非常差。我建议使用Selectize。它表现好得多,但我认为500k可能太多了。 角质材料虚拟列表可以作为答案。他们当时只提供很少的选项,只是更新绑定。