有大量数据列表时dx-select-box不会加载-DevExtreme [英] dx-select-box does not load when there is huge list of data - DevExtreme

查看:155
本文介绍了有大量数据列表时dx-select-box不会加载-DevExtreme的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,要在选择框中显示的数据最多可以包含8000条记录.

I have a requirement where the data to be displayed in the select box can be as huge as 8000 records.

当前,当我尝试使用数组源将数据绑定到dx-select-box时,该控件会崩溃,甚至会挂起我的浏览器.

Currently when I try to bind the data to a dx-select-box using an array source, the control just crashes and it even hangs my browser.

有什么方法可以虚拟化数据绑定以一次加载少量记录?

Is there any way I can virtualize the data binding to load a handful of records at a time?

注意:我正在使用具有16.2.5版本的dev extreme angular2库

Note: I am using dev extreme angular2 library with 16.2.5 version

推荐答案

您尝试使用使用此选项,选择框将能够逐步呈现数据.

With this option selectbox will be able to render data step by step.

用法:

<dx-select-box
    [dataSource]="data"
    ...
></dx-select-box>

TS:

import DataSource from 'devextreme/data/data_source';
@Component({
...
})
export class AppComponent {
    ...
    constructor(service: Service) { 
        ...
        this.data = new DataSource({
            paginate: true,
            pageSize: 10,
            store: {
            type: "array",
                data: HUGE_ARRAY,
                key: "ID"
            }
        });
    }
}

这篇关于有大量数据列表时dx-select-box不会加载-DevExtreme的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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