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

Detail template while having dynamically columns order

2 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 25 Oct 2019, 07:08 AM

Hi

I'm having a problem with a detail template in combination to reorderable columns.

Because I want to reorder and save and load the state, the internet solution was to do this myself.
This is in the row-template and the getRowTemplate function.

But while doing this, there seems to be a problem when using a detail template.
Just expand detail template in exmple below and console will throw "Cannot convert undefined or null to object".

http://dojo.telerik.com/uMUluKUj/5

Greets Robin

2 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 28 Oct 2019, 02:20 PM

Hi Robin,

Thank you for the provided Dojo sample.

The issue is actually thrown because of the row template that is set. In order to have a detail template along with the row template, the k-master-row class has to be added:

    <script id="row-template" type="text/x-kendo-template">
  	#var columns = $('\#grid').data('kendoGrid').columns#
    <tr class='k-master-row' data-bind="attr: { style: ddlItem.Style }">
    	<td class="k-hierarchy-cell"><a class="k-icon k-i-expand" href="\\#"></a></td>
    	<!-- Tempaltes via index because of sortable columns -->
      #=getRowTemplate(columns, 0,  data)#
      #=getRowTemplate(columns, 1,  data)#
      </tr>
    </script>

Here is the updated Dojo:

http://dojo.telerik.com/EkaZuwin

 

Best regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Robin
Top achievements
Rank 1
answered on 04 Nov 2019, 01:54 PM

Hi Tsvetomir

Unintuitive, but simple - it's working this way, thanks :)

Greets Robin

Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Robin
Top achievements
Rank 1
Share this question
or