0

我正在开发一个 MVC 项目,我将jqGrid 用于 ASP.NET MVC。但是,我被告知纯 jquery 客户端版本(jqGrid)的性能更好。这是真的?对我来说,他们似乎都在做同样的事情,只是代码在不同的地方——所有的批量工作仍然是使用 ajax 完成的。任何建议将不胜感激。

编辑-我使用网格的大多数地方都少于 100 行,页面大小 30,大约 10-12 列,主要是字符串和日期。只有一页我使用了 500 行的网格,但很少使用。

4

1 回答 1

0

I don't think that you should rewrite your existing code, but I can agree that in case of usage less then 1000 rows of data the usage of loadonce: true is real alternative.

The design of jqGrid is oriented on server side sorting, paging and filtering/searching. So most users who start to use jqGrid in version less then 3.7 have already good implementation of backend. SQL Server with native code should be sure more quickly as JavaScript code were originally designed as interpreter language. On the other side current versions of web browsers contain quickly JavaScript engine. Every new version improve more and more performance of JavaScript.

It could be important for the user the total time of the paring, sorting or filtering operation. It includes the round trip time to the web server. One can better do exact measure in productive environment to compare performance of local grids with grids with pure remote datatype ("json" or "xml" without usage of loadonce). The rough rule which I use myself is:

  • if the number of rows under some 1000 rows I use loadonce: true and so client side paging, sorting and filtering of data
  • if the total number of rows larger as 10000 I use always server side paging, sorting and filtering

Your environment (network, Round trip time to the server and so on) could be other. So the edge when you should better user client side holding of data and when server side holding could be other. Nevertheless the usage of loadonce: true could be really very effective in the practice.

I personally don't use commertal version of jqGrid which you referenced. So I have to write backend side myself. In case of usage of loadonce: true the server code is very simple. It's easy to debug and to maintain.

于 2013-04-04T15:46:56.973 回答