kendo ui for jquery. Where are child columns stored in setOptions

1 Answer 106 Views
Grid
Peter
Top achievements
Rank 1
Peter asked on 02 Dec 2023, 01:49 PM

I cannot work out how to set the CHILD grid column widths and positions. I can set all the master grid column widths and positions.

When calling grid.getOptions(), I can only see a reference to the MASTER grid column properties.

I can set all the master grid column widths and positions with this function:

function setColumFormat(){

    var grid = $("#kdClaimStatus").data("kendoGrid");  
    var options = localStorage["grid-column-options"];  
    if (options) {  
        var parsedOptions = JSON.parse(options);  
        var columns = parsedOptions.columns;
        grid.setOptions({ columns: columns });  
    }  
}

But I cannot work out how to set the CHILD grid column widths and positions. I have searched Telerik documentation and cannot find any solution.

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 07 Dec 2023, 05:35 AM

Hi Peter,

I replied earlier in the support thread regarding the same issue. Please find my reply pasted below as well:

You can get the options of the child Grid not through the parent Grid options, but only after such grid have been rendered. You can get a reference to the specific child Grid the same way as to the parent and then use the getOptions/setOptions method. 

In the example linked here - https://dojo.telerik.com/@NeliKondova/IyelIvet it is demonstrated how the options of the child Grid can be retrieved when a parent row is expanded. 

 detailExpand: function(e) { 
                var childGrid = $(e.detailRow).find('.k-detail-cell .k-grid').data('kendoGrid')
                console.log(childGrid);
   },

 

I hope you will find the provided suggestion helpful.

 

Regards,
Neli
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Saul
Top achievements
Rank 1
commented on 09 Dec 2023, 10:33 PM

Thank you for this. It has solved my problem.
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or