Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nz-select 数据源在数据量过大时可设置加载数据量的条数 #3537

Closed
HelloValue opened this issue Jun 5, 2019 · 6 comments
Closed

Comments

@HelloValue
Copy link

What problem does this feature solve?

数据量过大时需要配合搜索的情况。目前数据量过大会导致初始化组件时,页面无反应。搜索也比较迟钝。

What does the proposed API look like?

<nz-select
nzShowSearch
nzAllowClear
nzPlaceHolder="选择..."
[(ngModel)]="selected"
[nzDataSource]="data"
>
<ng-container *ngFor="let b of data">
<nz-option [nzValue]="b.Id" [nzLabel]="b.Name">

@ng-zorro-bot
Copy link
Collaborator

Translation of this issue:


nz-select Data source can set the number of loaded data when the amount of data is too large

What problem does this feature solve?

When the amount of data is too large, it is necessary to match the search. When the current data volume is over the assembly, the page does not respond when the component is initialized. Search is also slow.

What does the proposed API look like?

<nz-select
          nzShowSearch
          nzAllowClear
          nzPlaceHolder="Select..."
          [(ngModel)]="selected"
          [nzDataSource]="data"
          >
          <ng-container *ngFor="let b of data">
            <nz-option [nzValue]="b.Id" [nzLabel]="b.Name">
          
        

@vthinkxie
Copy link
Member

可设置加载数据量的条数 可以自己限制,数组一个slice操作

@HelloValue
Copy link
Author

可设置加载数据量的条数 可以自己限制,数组一个slice操作

<nz-option *ngFor="let b of brCollectionList.slice(0,300)" [nzValue]="b.brandCollectionId" [nzLabel]="b.brandCollectionName">
这样的话,搜索也搜索不到 300条以后的数据了。

@vthinkxie
Copy link
Member

搜索和数据展示本来就是一体的,数据量过大时不建议使用前端搜索

@HelloValue
Copy link
Author

搜索和数据展示本来就是一体的,数据量过大时不建议使用前端搜索

不考虑增加一个选项单独把搜索数据源和展示数据源分开么?

@vthinkxie
Copy link
Member

你可以很方便的通过 nzOnSearch 自行修改数据源数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants