3 Answers, 1 is accepted
0
Hello Scott,
Could you please elaborate a bit more on your scenario? What do you try to achieve? If you want to get DOM elements of all group rows and the corresponding data rows you can find all rows in the grid and iterate over them. When the row has class k-grouping-row it is a group header, all rows till the next row with class k-grouping-row will be the data rows corresponding to the header row.
Please give the suggestions try and let me know if it helps you.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Could you please elaborate a bit more on your scenario? What do you try to achieve? If you want to get DOM elements of all group rows and the corresponding data rows you can find all rows in the grid and iterate over them. When the row has class k-grouping-row it is a group header, all rows till the next row with class k-grouping-row will be the data rows corresponding to the header row.
Please give the suggestions try and let me know if it helps you.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Scott
Top achievements
Rank 1
answered on 25 Nov 2015, 03:56 PM
Thanks for the reply, but this does not help solve my requirement.
Basically, I am trying to solve the issue from this posting.
In essence, if a GROUP is dragged-dropped, I need to identify ONLY it's children, then move the children along with it. If I iterate all rows (as you suggested), this does not help because I will have no idea which group was moved.
Rows seem to have a unique identifier (uid), but Groups do not. This would make life much easier if it existed. Until then, I am open for suggestions and hopeful that there is some kind of workaround. Any help appreciated.
0
Hello Scott,
You can try using following approach for getting the group header row with corresponding data rows: In dataBound event find each header row and corresponding data rows and add name attribute with some value:
Then in the change event handler you can get the name value and find with jquery all corresponding rows:
I hope this helps.
Regards,
Radoslav
Telerik
You can try using following approach for getting the group header row with corresponding data rows: In dataBound event find each header row and corresponding data rows and add name attribute with some value:
dataBound:
function
(e) {
var
rows = e.sender.element.find(
"tbody > .k-grouping-row"
);
for
(
var
i=0; i< rows.length; i++)
{
$(rows[i]).attr(
"name"
,i);
// Find all rows corresponding to this group and add the same name attribute.
}
},
Then in the change event handler you can get the name value and find with jquery all corresponding rows:
change:
function
(e) {
var
name = e.item.attr(
"name"
);
…
// Find all rows with this name
}
I hope this helps.
Regards,
Radoslav
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!