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

How to access the detail grid programmatically

3 Answers 1175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yajing
Top achievements
Rank 1
Yajing asked on 28 Jun 2017, 09:56 PM

Hi there,

I know we can always access a grid like $("#grid").data("kendoGrid"), but this doesn't work for my situation.

Let's say I have a grid with 2 pages, 10 rows each. And each master row has a details row(.k-detail-row) below. So what I want to do is to export the grid's data with all the sorters applied. For the main columns it is pretty simple, I can get the data (a json with 20 length) and the sorter grid.dataSource.sort() and use kendo.data.Query to do the sorting. However this only works for the main grid. The inner grid's data is still unsorted. Could you help? I don't see anything in the API to access the details row programmatically.

Best regards,

Yajing

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Jun 2017, 07:37 AM
Hello Yajing,

The detailed Grid can be accessed using jQuery selectors.

I made a Dojo example demonstrating how to programmatically access a detail Grid and to apply sorting to its dataSource:

http://dojo.telerik.com/iSAKi

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Yajing
Top achievements
Rank 1
answered on 30 Jun 2017, 02:51 PM

Hello Stefan,

So nice to hear from you. I know the details Grid can be accessed using jQuery. But how can you access the details grid on the first page when you are on the second page? Let's say you sort the first details grid on the first page, then go to the second page and sort the second details grid. I want to get the data for the whole grid along with the sorted inner grids' data. Can you do this?

Best regards

Yajing

0
Stefan
Telerik team
answered on 04 Jul 2017, 07:29 AM
Hello Yajing,

Currently, this is not supported by the Grid as the elements from the first page including the detailed Grid are destroyed and are not accessible when the page is changed.

Apologies for the inconvenience this may cause you.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Yajing
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Yajing
Top achievements
Rank 1
Share this question
or