Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use rowTemplate and detailTemplate together in KendoUI?

Tags:

kendo-ui

I having trouble using a rowtemplate with a detail grid.

Basically when I use them in combination, the rendering is messed up.

See this fiddle, http://jsfiddle.net/yzKqV/, to reproduce this error (uncomment the commented out line and run again to see the error).

How do I fix this?

like image 273
numan salati Avatar asked Jul 08 '12 23:07

numan salati


People also ask

Can I use the detail template feature of the kendo grid?

... This example demonstrates how you can utilize the detail template feature of the Kendo UI grid when implementing hierarchical table presentation. The key steps here are to:

How do I use rowtemplate with detailtemplate?

If rowTemplate is used alongside with detailTemplate, the row ( <tr>) element needs to have class k-master-row. The first <td> element of the row needs to have class k-hierarchy-cell. Check the Row Templates documentation for more information.

How do I use the detail row template with locked columns?

The detail row template does not work with locked columns. To use the detail row template in virtual scrolling, set the detailRowHeight option. For the specifics of exporting the detail row template to Excel, refer to the section on known limitations.

How do I display detail rows in Kendo UI grid for angular?

The Kendo UI Grid for Angular enables you to configure whether a given row is displayed or not. To indicate if a detail row will be displayed, specify the DetailTemplateShowIfFn setting.


1 Answers

I think the reason your rowTemplate is not working when you use detailTemplate is because it needs to have the tr and first td defined like a hierarchy grid. (http://jsfiddle.net/yzKqV/3/)

<script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr class="k-master-row"> 
        <td class="k-hierarchy-cell"><a href="\#" class="k-icon k-plus"></a></td>
        <td> #= FirstName # </td>
        <td> #= LastName # </td> 
    </tr>
</script>
like image 108
Daniel Avatar answered Sep 29 '22 23:09

Daniel