分层 Telerik RadGrids:如何消除排序错误?

发布于 2024-12-01 10:05:27 字数 596 浏览 0 评论 0原文

我正在使用分层 RadGrid(Telerik 控件),但存在一些关于第二级排序的错误。我有两个级别,第二个级别是根据第一个级别加载的。

第一级的列:Foo1、Foo2、Foo3

第二级的列:Bar1、Foo2、Bar2、Bar3

通过函数发出绑定。

问题:

  1. 如果展开第一层的单行(我们可以从第二层看到单个子网格)并且我想按 Bar1 排序,排序会发生,但会发生错误:

    Uncaught TypeError: Cannot call method 'sort' of null

  2. 如果扩展第一级的单行(我们可以从第二级看到单个子网格)并且我想要对第二级进行排序Foo2,排序发生在父网格的 (!) Foo2 列

  3. 如果第一级的两行被展开(我们可以看到第二级的两个子网格)并且我想按同栏异样出现矩形而不是升序/降序符号,我得到与第一个问题中描述的相同的错误,但未发出排序。

我想摆脱这些问题,我的问题如下:

如果我们有一个分层的 RadGrid,并且第一级和第二级都是可排序的,我怎样才能实现第二级而不存在错误?

预先感谢您的回复。

I'm using a hierarchical RadGrid (Telerik control) but there are some bugs regarding the sort of the second level. I have two levels and the second level is loaded based on the first level.

Columns of the first level: Foo1, Foo2, Foo3

Columns of the second level: Bar1, Foo2, Bar2, Bar3

Binding is issued through a function.

Problems:

  1. If a single row of the first level is expanded (we can see a single sub-grid from the second level) and I want to sort by Bar1, the sort happens, but an error occures:

    Uncaught TypeError: Cannot call method 'sort' of null

  2. If a single row of the first level is expanded (we can see a single sub-grid from the second level) and I want to sort the second level by Foo2, the sort happens for the parent grid's (!) Foo2 column

  3. If two rows of the first level are expanded (we can see two sub-grids from the second level) and I want to sort both the subgrids by the same column a strange rectangle appears instead of the ascending/descending sign, I get the same error as described in the first problem but the sorting is not issued.

I would like to get rid of these problems, my question is the following:

If we have a hierarchical RadGrid and both the first and the second level is sortable how can I implement a sort of the second level to be free of bugs?

Thank you in advance for your responses.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再浓的妆也掩不了殇 2024-12-08 10:05:27

我已经找到答案了。

问题在于列是自动生成的,并且自动生成列的分层 RadGrid 在 Telerik 中存在错误。当列未排序时,其标题(th 标记)没有 rgSorted 类,并且没有输入标记作为子项。当列被排序时,它有一个 rgSorted 类,并且里面有一个输入。输入具有 rgSortedAsc 或 rgSortedDesc 类,具体取决于排序方向。所以,如果我想解决这个问题,我就必须进行修改,这将与未来的版本不兼容。这很痛苦,因为我需要网格的第二层,我需要自动生成列(列在运行时显示)并且我希望能够对它们进行排序,但是不幸的是我的问题的答案是这个错误没有解决方案。

请在 Telerik 论坛上查看此帖子:
http://www.telerik.com/community/forums/aspnet-ajax/grid/hierarchical-radgrid-sorting-problems.aspx#1782047

我希望我已经拯救了一些程序员同事从我所面临的酷刑中。

谢谢各位小伙伴的评论,
拉约斯·阿帕德.

I've found the answer.

The problem is that the columns are automatically generated and hierarchical RadGrids where the columns are automatically generated have a bug in Telerik. When a column is not sorted, its header (th tag) doesn't have rgSorted class and doesn't have an input tag as a child. When the column is sorted, it has an rgSorted class and it has an input inside it. The input has rgSortedAsc or rgSortedDesc class, depending on the sorting direction. So, if I want to solve it I'll have to make a hack, which will be incompatible with future versions. This is painful, because I need the second level of my grid, I need the columns to be automatically generated (the columns are revealed at runtime) and I want to be able to sort them, but, unfortunately the answer to my question is that there is no solution for this bug.

Please view this thread on the Telerik forum:
http://www.telerik.com/community/forums/aspnet-ajax/grid/hierarchical-radgrid-sorting-problems.aspx#1782047

I hope I've saved some fellow programmers from the torture I've faced.

Thanks for the comments, fellows,
Lajos Arpad.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文