我做了一些测试来确定为什么绑定大型数组时标头过滤器中的结果显示为空白。似乎网格在将值加载到控件中时遇到问题。
var foo2 = new Array(200000);
var test2 = [];
for (var i = 0; i < foo2.length; i++) {
test2.push({ Id: i, Description: 'Item: ' + (i + 1) + ' of ' + foo2.length });
}
$("#testgrid").dxDataGrid({
height: 500,
scrolling: {
showScrollbar: 'always',
scrollByThumb: true
},
filterRow: {
visible: true,
applyFilter: "auto"
},
headerFilter: {
visible: true
},
dataSource: test2,
columns: [{
dataField: "Description",
caption: "Description"
}],
hoverStateEnabled: true,
editing: {
mode: "batch",
allowUpdating: true,
allowDeleting: true,
allowAdding: true
},
pager: {
allowedPageSizes: [5, 10, 15, 20, 50, 100],
infoText: "Page {0} of {1}",
showInfo: true,
showNavigationButtons: true,
showPageSizeSelector: true,
visible: "auto"
},
paging: {
enabled: true,
pageIndex: 0,
pageSize: 20,
},
});
下面是我尝试绑定大数据时的结果。