如何加载和显示数据不同步 [英] How to load and show data Asynchronously

查看:108
本文介绍了如何加载和显示数据不同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET和SQL Server。我想从数据库中异步加载数据并显示这些部分直接加载数据。

假设有在查询结果吨的记录。 3秒后,它加载20%的话,我必须处理,并立即显示出20%的数据,而不是等待完全反应。我知道$就在jQuery中加载数据异步。是否可以处理部分缓解,不待完全缓解,并立即表现出来。

有没有办法让这个?

解决方案
  

假设有在查询结果吨的纪录

您必须自己AKS:将最终用户看到的吨的纪录一次


您没有指定什么,你是如何显示的数据,所以我会假设你是显示的东西就像一个网格中的数据。

我们做什么这天就这样COMMUN方案是使用加载页面数据,并启动它当用户滚动网格下,你甚至可以看到这样的移动设备,甚至在Facebook,微博等...

这将加载的第一个页面(例如,我们需要进行页面设置为20的记录),所以它会加载第20条记录(页0 ),但是当你到达底部,它会自动加载20更多的记录(页1 )。

此技术称为 无限滚动

I am using ASP.NET and SQL Server. I would like to load data from database asynchronously and show data which are partially loaded immediately.

Suppose there are tons of records in a query result. After 3 sec,It loads 20% then I have to process and show 20% data immediately, not waiting for complete response. I know $.Ajax in jQuery to load data async. Is it possible to process partial response, Not wait for complete response and show it immediately.

Is there any way to get this?

解决方案

Suppose there are tons of records in a query result

You have to aks yourself: Will the end user see a ton of records at once?


You don't specify what and how you are showing the data, so I'm going to assume that you are showing the data in something like a Grid.

What we do this days on such commun scenario is to load data using pages and fire it when the user scrolls the grid down, you can even see this in mobile devices and even on facebook, Twitter, etc...

It will load the first page (for example we set up the page to be 20 records), so it will load the first 20 records (page 0), but soon you reach the bottom, it will automatically load 20 more records (page 1).

This technique is called Infinite Scroll

这篇关于如何加载和显示数据不同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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