简体   繁体   English

如何处理来自后端的大量数据/记录并在 UI 中显示为 Angular

[英]How to handle large no of data/records from backend and display in UI as Angular

There could be following possibilities, need help against each one.可能有以下可能性,需要针对每一种可能性的帮助。

  1. Pagination can be implemented, but if we apply pagination, then can we search data from all the records or only the selected page record.分页是可以实现的,但是如果我们应用分页,那么我们可以从所有记录中搜索数据还是只从选定的页面记录中搜索数据。 If we can search only on the selected page record then how can we search from the entire data.如果我们只能在选定的页面记录上进行搜索,那么我们如何从整个数据中进行搜索。

  2. If we do not apply pagination, then virtual scrolling can be done but again the same question, once we came to the end of the scroll API will hit back to call the next set data, then how do we search from the entire data.如果我们不应用分页,那么虚拟滚动是可以的,但是同样的问题,一旦我们滚动到最后 API 会回击调用下一组数据,那么我们如何从整个数据中搜索。

Need help to know whats the best possible solution to handle large amount of data with good performance and thinking about the basic functions that should be there to cater this kind of request.需要帮助以了解以良好性能处理大量数据的最佳解决方案是什么,并考虑应满足此类要求的基本功能。

Any help would be much appreciated.任何帮助将非常感激。

You can use server-side pagination and sorting and also use the filtering feature on the server side too.您可以使用服务器端分页和排序,也可以在服务器端使用过滤功能。

Considering the data to be an array, create two variable one with the entire data and other with 10-20 of the entire data.考虑到数据是一个数组,创建两个变量,一个包含整个数据,另一个包含整个数据的 10-20。 Use the second variable to render the data and to perform search use the first variable to search the entire record.使用第二个变量呈现数据并执行搜索使用第一个变量搜索整个记录。 When next or more button is clicked push the next 10-20 data or replace the already existing data so the page is re-rendered with new data.单击下一个或更多按钮时,推送下一个 10-20 个数据或替换现有数据,以便使用新数据重新呈现页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM