Kendo UI Grid 摺疊明細裡面再一個Grid 的抓法 | How to get Kendo UI Grid with children detail's grid

背景

同事在寫的應用:一個 GRID 裡面有子 GRID
資料在展開 master row 時才會去抓
但不知道怎麼抓

#解法
我第一個想法是在 master grid 展開前先記住外面 row 的 uid,
再用 uid 反推 index,再用 index 去抓到 row,再抓到裡面的 grid,但很麻煩;

他研究很久後發現在 master grid 的 detailInit 事件做 detail grid 宣告,
detail grid 裡的 databound 事件
可以用

1
$(this.element[0]).data('kendoGrid');

來抓到裡面的 grid,簡單明瞭