telerik radGrid - 在排序/分页/过滤器上保持客户端状态 [英] telerik radGrid - persist client state on sort/paging/filter

查看:101
本文介绍了telerik radGrid - 在排序/分页/过滤器上保持客户端状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使在这个 ajax示例中也是如此b $ b我真的很喜欢这个样子,当顶级网格排序时,你正在做的状态消失

Even in this ajax example which I really like the look of, when ever the top level grid is sorted the "state" of what you were doing "disappears"

例如,


打开第一个人的行(Nancy Davolio),这样你就可以看到销售网格

Open the first person's row (Nancy Davolio) so you can see the Sales grid

按销售网格中的订单总数排序

Sort by Order Total in the Sales grid

按顶层网格中的出生日期排序

Sort by Birth Date in the top level grid

南希达沃伊现在应该排在第二位。打开她的行。

Nancy Davoilo should now be second. Open her row.

销售网格不再按订单总额排序

The sales grid is no longer sorted by Order Total



<这可能看似微不足道,或者说我很挑剔;但是:

This may seem trivial, or that i'm being picky; However:

如果我在销售网格上有一些文本框(或其他一种接受用户输入的方法),我会认为这会在排序时被破坏顶级网格。
我还认为即使我在顶级网格上有这个输入,对顶级网格进行排序(或者如果有过滤器则进行过滤)会破坏此输入。

If I have some text box(or some other type of method of accepting user input) on the sales grid, I would assume that this would get destroyed when sorting the top level grid. I would also think that even if I had this input on the top level grid, that sorting the top level grid (or filtering if there were filters) would destroy this input.

看起来即使是分页也会破坏它。

It seems that even paging destroys this.

所需的行为不仅仅是排序和分页似乎要完成客户端,因为它使用的是ajax请求,但实际上是客户端完成的。这意味着网格的实际行按字面顺序排序(过滤,分页等)客户端,以便任何客户端更改,例如向文本框添加文本,向对象添加css类,[或更复杂示例通过Jquery将javascript对象的引用添加到对象: $(#div1)。data(object,someObject)将在排序,分页和过滤。

The desired behavior would be for sorting and paging not just "appear" to be done client side because it's using an ajax request, but to ACTUALLY be done client side. Meaning that the actual rows of the grid are literally sorted(filtered, paged, etc.) client side so that any client side changes such as adding text to a text box, adding a css class to an object, [or in a more complex example adding a reference to a javascript object to an object via Jquery: $("#div1").data("object",someObject) would persist after sorting, paging and filtering.

有没有办法让这种情况发生?

Is there a way to make this happen?

我正在制作我想要的东西清楚吗?如果不是,我很乐意澄清。

Am I making what i'm looking to do clear? If not i'm happy to clarify.

附加说明:我认为只要没有这样的话,客户端性能上的影响就会很小行数非常多。实际上,在重新创建所有记录,重复调用服务器/数据库时,服务器上的工作量会少得多,而在顶部的示例中,子页面只需要创建一次而不是两次。

Additional Notes: I would think the client side performance hit would be minimal to do something like this as long as there were not a very large number of rows. In fact there would be a lot less work on the server in recreating all of the records, repeated calls to the server/database and as in my example at the top the subPages would only need to be created once rather than twice.

推荐答案

我最近得到了Telerik支持的答复,他们的AJAX网格支持带有排序,分页和开箱即用的客户端绑定仅使用扁平结构过滤(如此演示)。

I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).

对于您的情况,您可能有两种选择:

For your case you may have two options:

  • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx
  • implement custom solution to simulate hierarchy with client binding as presented in this blog post.

这篇关于telerik radGrid - 在排序/分页/过滤器上保持客户端状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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