Hello,
I need collapse the rest of de expanded rows when the user expand a new row and scroll this row to the top position of the grid. I have tried with the next code unsuccessfully.
Html.Kendo().Grid<ProductorViewModel>().Name("productors")
......
.Events(e => e
.DataBound("onDataBound")
.DetailInit("onDetailInit")
.DetailExpand("onExpand")
)
.....
<script type="text/javascript">
function onExpand(e) {
var grid = $("#productors").data("kendoGrid");
var dataView = this.dataSource.view();
var model = e.data;
for (var i = 0; i < dataView.length; i++) {
var uid = dataView[i].uid;
if (uid != model.uid) {
var tr = $("tr[data-uid=" + uid + "]");
grid.collapseRow(tr);
}
}
}
</script>
Can you help me with some example?
Thanks!