Skip to content

CGridHeader

Defines layout header.
Can be used in the layout-header slot of CGrid.

Vue Template Structure

vue
<template>
  <div class="demo-grid middle">
    <c-grid :data="records" :frozen-col-count="1">
      <template v-slot:layout-header>
        <!-- header line1 -->
        <c-grid-layout-row>
          <c-grid-header width="85" rowspan="2">ID</c-grid-header>
          <c-grid-header width="20%" min-width="150">
            First Name
          </c-grid-header>
        </c-grid-layout-row>
        <!-- header line2 -->
        <c-grid-layout-row>
          <c-grid-header width="20%" min-width="150"> Last Name </c-grid-header>
        </c-grid-layout-row>
      </template>
      <template v-slot:layout-body>
        <!-- line1 -->
        <c-grid-layout-row>
          <c-grid-column field="personid" width="85" rowspan="2" />
          <c-grid-input-column field="fname" />
        </c-grid-layout-row>
        <!-- line2 -->
        <c-grid-layout-row>
          <c-grid-input-column field="lname" />
        </c-grid-layout-row>
      </template>
    </c-grid>
  </div>
</template>
<script>
export default {
  data() {
    return {
      records,
    };
  },
};
</script>

Slots

default slot

Use this slot to set the header caption

Properties

Optional Properties

NameTypeDescriptionDefault
widthnumber|stringDefines a default column widthundefined
min-widthnumber|stringDefines a column min widthundefined
max-widthnumber|stringDefines a column max widthundefined
captionstring|functionDefines a header caption''
colspannumber|stringDefines the layout colspan.
This property can be used when defining in the layout-header and layout-body slots.
undefined
header-actionobject|string|functionDefines a column header action. Same as the headerAction property of the JS API.undefined
header-fieldstringDefines a column header data fieldundefined
header-iconobject|stringDefines a header iconundefined
header-styleobject|string|functionDefines a column header style. Same as the headerStyle property of the JS APIundefined
header-typeobject|string|functionDefines a column header type. Same as the headerStyle property of the JS APIundefined
rowspannumber|stringDefines the layout rowspan.
This property can be used when defining in the layout-header and layout-body slots.
undefined
sortboolean|string|functionDefines a sort. See "Sort by Column" for detail.undefined

Methods

NameReturn TypeDescription
invalidate---Redraws the whole grid.