是否可以仅在一定数量的行之后才在 Kendo 中提供详细信息行?
Is it possible to give details rows in Kendo only after a certain number of rows?
我一直在互联网上搜索答案,但我没有任何运气。我想知道是否可以在19行数据之后只显示Kendo个明细行?我有一个非常奇怪的要求,我不确定它是否可以完成。但是,如果有解决方案,我可以看到一个小例子吗?或者我还没有找到的资源?
作为附注,我正在使用 Kendo 和 AngularJS。
提前致谢!
安东尼快车
这可能不是最好的方法,但我只是隐藏了行的详细信息图标。我使用了 dataBound 事件。
dataSource: yourDataSouce,
dataBound: function(e) {
var grid = this,
grid2 = $('#yourGrid').data('kendoGrid');
grid.tbody.find("tr[role='row']").each(function () {
var index = $(this).index();
if (index < 19) {
$(this).find('.k-i-expand').removeClass('k-i-expand');
}
})
}
此外,如果您尝试使用列,比如 ID 列,您可以像下面那样进行操作。
dataSource: yourDataSouce,
dataBound: function(e) {
var grid = this,
grid2 = $('#yourGrid').data('kendoGrid'),
grid.tbody.find("tr[role='row']").each(function () {
var data = grid.dataItem(this);
if (data.yourColumnID < 19) {
$(this).find('.k-i-expand').removeClass('k-i-expand');
}
})
}
我希望这对遇到同样问题的其他人有所帮助。
我一直在互联网上搜索答案,但我没有任何运气。我想知道是否可以在19行数据之后只显示Kendo个明细行?我有一个非常奇怪的要求,我不确定它是否可以完成。但是,如果有解决方案,我可以看到一个小例子吗?或者我还没有找到的资源?
作为附注,我正在使用 Kendo 和 AngularJS。
提前致谢!
安东尼快车
这可能不是最好的方法,但我只是隐藏了行的详细信息图标。我使用了 dataBound 事件。
dataSource: yourDataSouce,
dataBound: function(e) {
var grid = this,
grid2 = $('#yourGrid').data('kendoGrid');
grid.tbody.find("tr[role='row']").each(function () {
var index = $(this).index();
if (index < 19) {
$(this).find('.k-i-expand').removeClass('k-i-expand');
}
})
}
此外,如果您尝试使用列,比如 ID 列,您可以像下面那样进行操作。
dataSource: yourDataSouce,
dataBound: function(e) {
var grid = this,
grid2 = $('#yourGrid').data('kendoGrid'),
grid.tbody.find("tr[role='row']").each(function () {
var data = grid.dataItem(this);
if (data.yourColumnID < 19) {
$(this).find('.k-i-expand').removeClass('k-i-expand');
}
})
}
我希望这对遇到同样问题的其他人有所帮助。