优化的 Web 数据网格 - ASP .NET 与 ASP .NET MVC 和 jQuery
我正在开发一个网络应用程序,它将以网格形式显示数据。我需要能够快速加载数千行。我还需要能够按多列对数据进行排序并按搜索字符串过滤列。我目前正在使用 ASP .NET MVC 和 Infragistics jQuery iGrid。
目前我正在加载 1000 条记录,并且已经开始遇到一些性能问题。
我最初使用分页来使初始加载更快,但这意味着我需要在服务器端进行排序/过滤,否则它只会排序/过滤该页面上的记录,而不是整个数据源上的记录。
或者,我可以将整个数据源加载到网格中(其中有 1000 条记录需要大约 20 秒才能绑定),然后在客户端执行所有排序/过滤,这几乎是即时的。
我的同事认为我们应该废弃 jQuery 控件并使用 ASP .NET 控件 相反。它们更加成熟并且具有更多功能。
值得采纳我同事的建议吗? ASP .NET 控件会比 jQuery 控件更快吗?我应该转向直接的 ASP .NET 项目还是值得尝试将 ASP .NET 控件合并到 MVC 项目中?
I am developing a web application that will display data in grid form. I need to be able to load thousands of rows quickly. I also need to be able to sort data by multiple columns and filter columns by search string. I am currently using ASP .NET MVC and Infragistics jQuery iGrid.
At the moment I am loading 1000 records and have already started to hit some performance problems.
I was originally using pagination to make the inital load quicker, however this means I need to do my sorting/filtering server side otherwise it will only sort/filter the records on that page, and not on the entire datasource.
Alternatively I can load the entire datasource into the grid (which with 1000 records takes ~20 secs to bind) and then do all sorting/filtering client side which is pretty much instantaneous.
My colleague reckons we should scrap the jQuery controls and use the ASP .NET controls instead. They are more mature and have more functionality.
Is it worth taking my colleague's advice? Will the ASP .NET controls be faster than the jQuery controls? Should I move to a straight ASP .NET project or would it be worth trying to incorporate the ASP .NET controls into an MVC project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不是一个成熟的项目,但确实值得一看,因此请查看 Telerik Kendo UI 和网格小部件,它基于 jQuery。
http://demos.kendoui.com/grid/index.html
It's not a mature project but it's sure worth a look, so check out Telerik Kendo UI and grid widget, it's based on jQuery.
http://demos.kendoui.com/grid/index.html
我认为这取决于你的 jQuery 网格控件(如果它使用 JSON 进行分页,我认为不存在性能问题)。
我在两个应用程序上使用两种不同的网格:
- Telerik RadGrid 采用 ASP.NET,成熟,有很多选项,并且具有良好的服务器端代码,具有良好的性能
- 我自己的 jquery 网格实现,在服务器端使用 JSON 和 ASP.NET MVC。更少的选择,但更好的性能。
没有分页就不可能有好的性能,这就是重点。
我认为 jQuery UI 团队将在几周内提供一个新的网格组件。所以这对你来说可能很酷。
I think It depends of your jQuery grid control (if it's using JSON for paging, I think there is no performance problems).
I use two differents grids on two apps :
- Telerik RadGrid with ASP.NET, mature, with lots of options and, with a good server side code, with good performance
- My own jquery grid implementation with JSON and ASP.NET MVC on server side. Less more options but a better performance.
You cannot have good perfs without pagination, that's the point.
The jQuery UI team will provide a new grid component in a few weeks I think. So it may be cool for you.
我想你的问题与这篇文章有关:
jQuery Grid ASP .NET MVC 中的绑定非常慢
基本上,igGrid(Infragistics jQuery 网格)的渲染和数据绑定占用的空间非常小,对性能的影响也很小。而且,如果启用行虚拟化(也支持列虚拟化),那么就渲染速度而言,无论是 100 条记录还是 100 000 条记录都没有关系。
如果您仍然遇到与渲染相关的问题,您还可以查看以下白皮书:
http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.1/CLR4.0/html/igGrid_Performance_Guide.html
让我知道这是否有帮助。感谢您的反馈。
天使
I guess your question is related to this post:
jQuery Grid Binding in ASP .NET MVC is so slow
Basically the rendering and databinding of the igGrid (Infragistics jQuery grid) has very small footprint and impact on performance. Moreover, if you enable row virtualization (column virtualization is also supported), it shoudln't matter if you have 100 records or 100 000 in terms of rendering speed.
If you still experience issues which are related to rendering, you can also have a look at the following whitepaper:
http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.1/CLR4.0/html/igGrid_Performance_Guide.html
Let me know if this helps. And thanks for the feedback.
Angel