i have master grid contains child grid contains child grid. , have custom command in 3rd child, when clicked to, want extract cells master grid. how can that?
well here comes power of jquery. need go traversal find masterrow , dataitem of mastergrid.
something (i named each element make clearer):
var thirdlevelgrid = $(yourcommandbuttonhtmlelement).closest('.k-grid'); var secondlevelgrid = thirdlevelgrid.parents('.k-grid'); var topdetailrow = secondlevelgrid.closest('tr'); var topmasterrow = topdetailrow.prev(); var mastergrid = $('#nameofthemastergrid').data().kendogrid; var andfinallythemodelwewerewaitingfor = mastergrid.dataitem(topmasterrow);
of course can chain more fancy or optimize in way.
i hope helps idea.
Comments
Post a Comment