如何知道MVC中Telerik网格上应用过滤的列

发布于 2024-09-24 10:00:39 字数 116 浏览 1 评论 0原文

我有一个 MVC 应用程序,我正在使用 telerik grid 来显示列表。我还在列上使用过滤选项。 可以知道当前过滤应用于哪一列,即获取列名称和值,或者如果可能的话突出显示这些列。

谢谢 苏普里亚

I have an MVC application and in that i am using telerik grid to display the list . I am also using filtering option on the column.
Is is possible to know on which column the current filtering is applied i.e to get the column name and value or if possible to highlight thoes column.

Thanks
supriya

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

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

发布评论

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

评论(1

茶花眉 2024-10-01 10:00:39

您可以使用以下 jQuery 语句来查找过滤后的列元素:

$('th:has(.t-active-filter)');

它将返回列标题(元素)。您可以轻松获取列索引:

var index = $('th:has(.t-active-filter)').index();

然后获取列 JavaScript 对象:

var grid = $('#Grid').data('tGrid');
var column = grid.columns[index];

You can use the following jQuery statement to find the filtered column elements:

$('th:has(.t-active-filter)');

It will return the column header (the element). You can obtain the column index easily:

var index = $('th:has(.t-active-filter)').index();

And then get the column JavaScript object:

var grid = $('#Grid').data('tGrid');
var column = grid.columns[index];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文