Kendo UI For Angular2 - Grid Row Select

北城以北 提交于 2019-12-05 18:41:17
emp

I had a similar question here: Select grid row item from code

Basically, you also need to select the grid row item from code without user interaction and this is currently not supported in the current beta build of the Kendo UI Angular2 controls.

In my application, I resort to triggering a click event on the row I want to select. :/

I do this in a case where I have 'up' and 'down' buttons to rearrange the grid and want to maintain my selection when I switch items.

var grid = document.getElementById('myGrid');
var rows = grid.getElementsByTagName('tr');
rows[idx].click(); // add one to the desired row index to skip the header row

Here's a (sloppy, minimal) Plunkr of this scenario: http://plnkr.co/edit/09dlqdl0Xchoy0e5zKRq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!