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

Get ID's for all grid rows in the correct order.

1 Answer 530 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 05 Apr 2016, 01:21 PM

Hi

I am trying to return IDs for all grid rows in the order the grid is shown in...I have a hidden column which contains the ID.

I first tried with the code below.. where gridData is the datasource.data

        for (var i = 0; i < gridData.length; i++) {
            var dataitem = gridData[i].Id;            
        }

The above works, however the ID order is always the same even after fort or filters have been applied.

What am I doing wrong or what property should I be using?

Regards

Mike

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 07 Apr 2016, 08:27 AM

Hello Mike,

 

The data method is not affected by any expression applied to the DataSource (grouping, sorting or etc). The view method returns the data items which correspond to the current page, filter, sort and group configuration.

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or