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

[Solved] Issues with grids embedded in grid detail row

3 Answers 362 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jeff
Top achievements
Rank 1
jeff asked on 09 Mar 2015, 12:59 PM
Hi folks,
Two issues with grids embedded in detail rows;

1) 'undefined' data in grids embedded in detail row - the primary grid, which holds the other two tables in the detail row, uses a json array called 'mystuff', for example. The two other grids/tables, in the detail row I'm attempting to use, uses child arrays from that same 'mystuff' array.. I seem to be connecting to it, but all data comes back as 'undefined'..

So, in my columns definition, I am calling to:

template: "#=childarrayName.niftyDataField#"

..and my schema is:

1.schema: {
2.     data: "arrayName[0].childarrayName"
3.},

is this correct? It doesn't seem like I should have to call to the child array in the template declaration.. by doing this, I get no errors on the page, but all data is 'undefined'.. I've been trying to find an example of multiple grids using the same data source with child arrays, maybe you can point me to one? I can't find anything in the dom that points to anything conclusive (other than undefined)..

2) The grids I've embedded in the details row are getting their widths from the initial grid; I've tried sizing their containers, etc.. but nothing seems to 'contain' it, lol! Ideas?

Thank you!

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 11 Mar 2015, 09:36 AM
Hi Jeff,

From the provided information it's not clear for us what is the exact setup that you have - could you please provide runable example where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Also for your convenience I created small example which shows possible solution for editing navigation property using grid nested inside detailTemplate which you can use as baseline:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jeff
Top achievements
Rank 1
answered on 11 Mar 2015, 12:40 PM
Thank you very much Vladimir; that helps; much deeper than I thought to traverse child json arrays - if everything is going to sit in the same tables, I now have a plan!

However, data architects being who they are, I think we might end up grabbing data for those details tables based on a unique id number we have displayed in each row of the initial grid; sooooooooooo... if I was going to pull the 'details grid' data based on that unique id, how could I send that unique id field for that row out? I hope there's an existing example somewhere..

Whew! Next...

In order to illustrate the OTHER issue, I modified your dojo:

Modified grid

So, you'll notice, when you open the details for row 1, the grid has 'previous' and 'next' on it.. perfect!

Open the second row details, and it reverts to < and >, etc.. 

How can I get that more consistent, with previous/next everywhere? Thank you! 
0
Accepted
Vladimir Iliev
Telerik team
answered on 12 Mar 2015, 10:16 AM
Hello Jeff,

Please check the example below which shows how to filter the nested data using the parent row ID:

Also the pager buttons are not updated as the current selector is finding only the first available grid. Pease check the updated code below:

function onDetailInit(e) {
   e.detailRow.find('[data-role=grid]').data().kendoGrid.dataSource.data(e.data.Territories);
   var mopager =  e.detailRow.find(".k-grid-pager");

Regards,
Vladimir Iliev
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
jeff
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
jeff
Top achievements
Rank 1
Share this question
or