This is a migrated thread and some comments may be shown as answers.

dataItem when grouping in effect

1 Answer 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim R
Top achievements
Rank 1
Tim R asked on 25 Dec 2012, 01:46 AM
The following code works until a column header is dragged to the group-panel; then dataItem becomes undefined:


    var grid = $('#grid').data('kendoGrid');
    $(grid.tbody, "tr").each(function (idx, elem) {     
        var dataItem = grid.dataItem(elem);            
        }
    });

I have tried changing the selector to this:

       $(grid.tbody, "tr:not(.k-grouping-row)")

but without success; dataItem is still undefined.

How to get the dataItem for each row when the grid is being grouped?

Thanks

1 Answer, 1 is accepted

Sort by
0
Tim R
Top achievements
Rank 1
answered on 25 Dec 2012, 02:40 PM
Success with this:

      $(grid.tbody).find("> tr:not(.k-grouping-row, .k-detail-row, .k-group-footer)").each(...
Tags
Grid
Asked by
Tim R
Top achievements
Rank 1
Answers by
Tim R
Top achievements
Rank 1
Share this question
or