5.20212.812
Wijmo API Module wijmo.vue2.grid.multirow Wijmo API Module

wijmo.vue2.grid.multirow Module

Contains Vue 2 and 3 components for the wijmo.grid.multirow module.

Variables

WjMultiRow

WjMultiRow: any

Vue component for the wijmo.grid.multirow.MultiRow control.

The wj-multi-row component may contain the following child components: wijmo.vue2.grid.multirow.WjMultiRowCellGroup and wijmo.vue2.grid.multirow.WjMultiRowCellTemplate.

The component supports all properties and events of the pure JavaScript wijmo.grid.multirow.MultiRow control it represents.

The component includes an initialized event that is raised when the control is initialized after it is added to the page. You can use this event to perform further initialization in addition to setting properties in markup. The signature of the handler function is the same as any other Wijmo event handlers.

WjMultiRowCell

WjMultiRowCell: any

Vue component for the wijmo.grid.multirow.MultiRowCell class.

The wj-multi-row-cell component should be contained in a wijmo.vue2.grid.multirow.WjMultiRowCellGroup component.

The wj-multi-row-cell component may contain a wijmo.vue2.grid.multirow.WjMultiRowCellTemplate child component.

The component supports all properties and events of the pure JavaScript wijmo.grid.multirow.MultiRowCell class it represents.

The component includes an initialized event that is raised when the control is initialized after it is added to the page. You can use this event to perform further initialization in addition to setting properties in markup. The signature of the handler function is the same as any other Wijmo event handlers.

WjMultiRowCellGroup

WjMultiRowCellGroup: any

Vue component for the wijmo.grid.multirow.MultiRowCellGroup class.

The wj-multi-row-cell-group component should be contained in a wijmo.vue2.grid.multirow.WjMultiRow component.

The wj-multi-row-cell-group component may contain a wijmo.vue2.grid.multirow.WjMultiRowCell child component.

The component supports all properties and events of the pure JavaScript wijmo.grid.multirow.MultiRowCellGroup class it represents.

The component includes an initialized event that is raised when the control is initialized after it is added to the page. You can use this event to perform further initialization in addition to setting properties in markup. The signature of the handler function is the same as any other Wijmo event handlers.

WjMultiRowCellTemplate

WjMultiRowCellTemplate: any

Vue component for the MultiRow cell templates.

The wj-multi-row-cell-template component defines a template for a certain cell type in MultiRow. The template element must contain a cellType attribute that specifies the {@link wijmo.vue2.grid.CellTemplateType}. Depending on the template's cell type, the wj-multi-row-cell-template element must be a child of either wijmo.vue2.grid.multirow.WjMultiRow or wijmo.vue2.grid.multirow.WjMultiRowCell components.

Column-specific cell templates must be contained in wj-multi-row-cell components, and cells that are not column-specific (like row header or top left cells) must be contained in the wj-multi-row component.

The wj-multi-row-cell-template element may contain an arbitrary HTML fragment with Vue interpolation expressions and other components and directives.

Bindings in HTML fragment can use scoped slot properties that store cell specific data. The properties are col, row, and item, which refer to the MultiRowCell, Row, and Row.dataItem objects pertaining to the cell.

For cell types like Group and CellEdit, an additional value property containing an unformatted cell value is provided.

To reference slot properties, you can use either a new v-slot directive right on the wj-multi-row-cell-template element (it's available in Vue 2.6.0 or higher), or an old slot-scope directive on the <template> element nested in wj-multi-row-cell-template.

For example, here is a MultiRow control with templates for row header cells and, regular and column header cells of the Country column:

<!-- component.html -->
<wj-multi-row :itemsSource="data">
  <wj-multi-row-cell-template cellType="RowHeader" v-slot="cell">
    {{cell.row.index}}
  </wj-multi-row-cell-template>
  <wj-multi-row-cell-template cellType="RowHeaderEdit">
    ...
  </wj-multi-row-cell-template>

  <wj-multi-row-cell-group header="Statistics">
    <wj-multi-row-cell header="Country" binding="country">
      <wj-multi-row-cell-template cellType="ColumnHeader" v-slot="cell">
        <img src="resources/globe.png" />
          {{cell.col.header}}
      </wj-multi-row-cell-template>
      <wj-multi-row-cell-template cellType="Cell" v-slot="cell">
        <img :src="'resources/' + cell.item.country + '.png'" />
        {{cell.item.country}}
      </wj-multi-row-cell-template>
    </wj-multi-row-cell>
    <wj-multi-row-cell header="Sales" binding="sales"></wj-multi-row-cell>
  </wj-multi-row-cell-group>
</wj-multi-row>

The wj-multi-row-cell-template directive supports the following attributes:

cellType
The CellTemplateType value defining the type of cell to which the template is applied.
autoSizeRows
Indicates whether the cell template will increase grid's default row height to accomodate cells content. Defaults to true.
cellOverflow
Defines the style.overflow property value for cells.
forceFullEdit
For cell edit templates, indicates whether cell editing forcibly starts in full edit mode, regardless of how the editing was initiated. In full edit mode pressing cursor keys don't finish editing. Defaults to true.

The cellType attribute takes any of the following enumerated values:

Cell

Defines a regular (data) cell template. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component. For example, this cell template shows flags in the cells of Country column:

<wj-multi-row-cell header="Country" binding="country">
  <wj-multi-row-cell-template cellType="Cell" v-slot="cell">
    <img :src="'resources/' + cell.item.country + '.png'" />
    {{cell.item.country}}
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

CellEdit

Defines a template for a cell in edit mode. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component. This cell type has an additional value scoped slot property available for binding. It contains the original cell value before editing, and the updated value after editing.

For example, here is a template that uses the Wijmo InputNumber control as an editor for the "Sales" column:

<wj-multi-row-cell header="Sales" binding="sales">
  <wj-multi-row-cell-template cellType="CellEdit">
    <wj-input-number v-model="cell.value" :step="1"></wj-input-number>
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

Note that two-way binding can also be specified using the binding's sync modifier:

<wj-multi-row-cell header="Sales" binding="sales">
  <wj-multi-row-cell-template cellType="CellEdit">
    <wj-input-number value.sync="cell.value" :step="1"></wj-input-number>
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

ColumnHeader

Defines a template for a column header cell. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component. For example, this template adds an image to the header of the "Country" column:

<wj-multi-row-cell header="Country" binding="country">
  <wj-multi-row-cell-template cellType="ColumnHeader" v-slot="cell">
    <img src="resources/globe.png" />
    {{cell.col.header}}
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

RowHeader

Defines a template for a row header cell. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRow component. For example, this template shows row indices in the row headers:

<wj-multi-row :itemsSource="data">
  <wj-multi-row-cell-template cellType="RowHeader" v-slot="cell">
    {{cell.row.index / cell.row.grid.rowsPerItem + 1}}
  </wj-multi-row-cell-template>
</wj-multi-row>

Note that this template is applied to a row header cell, even if it is in a row that is in edit mode. In order to provide an edit-mode version of a row header cell with alternate content, define the RowHeaderEdit template.

RowHeaderEdit

Defines a template for a row header cell in edit mode. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRow component. For example, this template shows dots in the header of rows being edited:

<wj-multi-row :itemsSource="data">
  <wj-multi-row-cell-template cellType="RowHeaderEdit">
    ...
  </wj-multi-row-cell-template>
</wj-multi-row>

Use the following RowHeaderEdit template to add the standard edit-mode indicator to cells where the RowHeader template applies:

<wj-multi-row :itemsSource="data">
  <wj-multi-row-cell-template cellType="RowHeaderEdit">
    &#x270e;&#xfe0e;
  </wj-multi-row-cell-template>
</wj-multi-row>

TopLeft

Defines a template for the top left cell. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRow component. For example, this template shows a down/right glyph in the top-left cell of the grid:

<wj-multi-row :itemsSource="data">
  <wj-multi-row-cell-template cellType="TopLeft">
    <span class="wj-glyph-down-right"></span>
  </wj-multi-row-cell-template>
</wj-multi-row>

GroupHeader

Defines a template for a group header cell in a GroupRow. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component.

The row scoped slot property contains an instance of the GroupRow class. If the grouping comes from CollectionView, the item scoped slot property references the CollectionViewGroup object.

For example, this template uses a checkbox element as an expand/collapse toggle:

<wj-multi-row-cell header="Country" binding="country">
  <wj-multi-row-cell-template cellType="GroupHeader" v-slot="cell">
    <input type="checkbox" v-model="cell.row.isCollapsed"/>
    {{cell.item.name}} ({{cell.item.items.length}} items)
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

Group

Defines a template for a regular cell (not a group header) in a GroupRow. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component. This cell type has an additional value scoped slot property available for binding. In cases where columns have the aggregate property specified, it contains the unformatted aggregate value.

For example, this template shows aggregate's value and kind for group row cells in the "Sales" column:

<wj-multi-row-cell header="Sales" binding="sales" aggregate="Avg">
  <wj-multi-row-cell-template cellType="Group" v-slot="cell">
    Average: {{formatNumber(cell.value, 'N0')}}
  </wj-multi-row-cell-template>
</wj-multi-row-cell>

NewCellTemplate

Defines a cell in a new row template. Must be a child of the wijmo.vue2.grid.multirow.WjMultiRowCell component. Note that the cell.item property is undefined for this type of a cell. For example, this cell template shows a placeholder in the Date column's cell in the "new row" item:

<wj-multi-row-cell header="'Date'" binding="'date'">
  <wj-multi-row-cell-template cellType="NewCellTemplate">
    Enter a date here
  </wj-multi-row-cell-template>
</wj-multi-row-cell>