Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 MVC 应用程序,我正在使用 Telerik 网格来显示列表。我也在列上使用过滤选项。是否可以知道当前过滤应用于哪一列,即获取列名和值,或者如果可能突出显示这些列。
谢谢苏普里亚
您可以使用以下 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];
我有一张大桌子,大约有 300 行和 12 列。在通过页面翻页滚动表格时<thead>,默认情况下不显示内容。我想在滚动 "within" 时看到它<tbody>。也就是说,如果屏幕顶部以一行开头,我希望首先显示标题。否则它应该表现得像一个普通的表。
<thead>
<tbody>
到目前为止,我看到的常见解决方案是创建一个可以自行滚动的表格(因此独立于页面滚动)。也就