我有问题。我用从 REST 获得的几个对象创建了滚动列表:
<script>
...
that.array = ko.observableArray([]);
that.getData = function(){
$.getJson("linkToResource",function(json){
that.array(ko.mapping.toJS(json));
}
}
...
</script>
并将其作为模板显示在 foreach 中:
<ul data-bind="foreach: array">
<li data-bind="template: {name: 'my-element-template'}"></li>
</ul>
我将 mCustomScrollbar 应用于此 ul 列表。一切都很顺利,直到我的 REST 服务返回大量数据(2000-20000 行)。
这个数据包只是杀死浏览器。它必须显示 2000-20000 li 元素。
我做了一些研究,发现像 koGrid 这样的东西非常适合这么多的数据。这个插件在视口中只显示很少的元素,滚动只是改变应该显示的数据。
不幸的是 koGrid 不适合我的问题。
我需要带有自定义滚动的可滚动列表,并且可以在模板上定义为一行。
你知道任何可以帮助我解决这个问题的淘汰赛插件吗?