Question



I am wondering if it is possible to have biaxial headers (1st column/row both be headers) using Kendo grid? An example of what I am looking for can be found here:
- http://jsfiddle.net/uY2JB/1/
- http://tympanus.net/Tutorials/StickyTableHeaders/index2.html

Sample Code (from jsfiddle):

<html>
   <body>
  <TABLE border=1 width=100%>
     <thead>
        <TR>
           <TH>DATE</TH>
           <TH>Acres</TH>
           <TH>Change</TH>
           <TH>Total</TH>
        </TR>
     </thead>
     <TR>
        <TH>Owned</TH>
        <TD></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR>
        <TH>Leased</TH>
        <TD></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR>
        <TH>Total</TH>
        <TD></TD>
        <TD></TD>
        <TD></TD>
     </TR>
     <TR>
        <TH>Reason</TH>
        <td colspan=3></td>
     </TR>
  </TABLE>

Any help is greatly appreciated!

Was it helpful?

Solution

This can be done only via custom row template:

  <div id="grid"></div>
  <script>
    $("#grid").kendoGrid({
      dataSource: [
        { header: "First Row", foo: "foo" },
        { header: "Second Row", foo: "bar" }
      ],
      columns: [
        { width: 100, title: "Header", field: "header"},
        { title: "Foo", field: "foo"},
      ],
      rowTemplate: '<tr data-uid="#=uid#"><th class="k-header">#:header#</th><td>#: foo #</td></tr>',
      altRowTemplate: '<tr data-uid="#=uid#" class="k-alt"><th class="k-header">#:header#</th><td>#: foo #</td></tr>'
    })
  </script>

Here is a live demo: http://trykendoui.telerik.com/@korchev/EneQ

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top