开发者

jqGrid dual paging (both client-side and server-side)

Is there an easy way to do dual paging (i.e., client and server side)?

Right now I'm using client-side paging (loadonce=true, which works extremely fast btw!) using a fixed 'rowTotal' (with rowTotal > rowNum). The problem is that rowTotal < Total-Records-in-DB, so I'm only displaying the first rowTotal records from the database and paging through it on the client's side. Loading all the records from DB is not an option (that's why you use a paging grid ;p).

On the other side, doing just server-side paging yields poor performance (that's why you use an AJAX component ;p). So I thought a combined approach will achieve best of both worlds.

Ideally this would be performed automatically. This is: the pager should display first rowTotal/rowNum results as the first of N pages loaded in memory (client-side). When jumping to page N+1 it should hit the backend and retrieve next rowTotal results. The problem I see right now is (I guess) that the number of pages is calculated based on the size of the result set divided by rowNum instead of the records on the database, plus most pager properties are immutable :(

Does this make any sense? Is开发者_如何学Go there an easy way to accomplish this without hacking into jqGrid's code?

Best regards!


You are not the first person who has the requirements, see this question for example. The behavior which you asked has different disadvantages. For example, you will be unable to use sorting of data. For example if the user click on the column header, only local data will be sorted which would be wrong.

In my expirience server side paging per AJAX work very quickly. All depends on the implementation on the server side, but in case of optimal implementation the server side the results of the corresponding query are cached and the next/previous page will be get from the SQL Server cache.

I recommend you to use pure server side paging and make some performance tuning if it is needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜