DkGridColumnDef

You can access this instance through the property named columnDef of the DkGridComponent, or by listening to the DkGridComponent event called gridColumnDefInstance.

Generics

<T> represents the object's shape coming from the data source.

<R> represents the column data type: string, number, Date, or boolean.

Methods

MethodDescription

addColumns()

It inserts a new column or a set of new columns. Params:

  1. columns: DkColumnDef | DkColumnDef[].

Return: void.

removeColumns()

It deletes the given columns permanently.

Params:

  1. columns: DkColumnDef | DkColumnDef[].

Return: void.

findColumn()

It searches a column in all panels. The found column must meet the compare function criteria.

Params:

  1. compare: CompareColumnFn.

Return: DkColumnDef.

findNode()

It searches a node in all panels. The found node must meet the compare function criteria.

Params:

  1. compare: CompareNodeFn.

Return: DkNodeColumnDef.

setColumnVisible()

It makes visible or non-visible the given column.

Params:

  1. column: DkColumnDef.

  2. isVisible: boolean.

Return: void.

changeColumnWidth<R>()

It modifies a data column in width. You can set the minimum and the maximum values.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. columnSize: { width: number, minWidth?: number, maxWidth?: number }.

Return: void.

setColumnGroupable()

It makes the given column groupable or non-groupable.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. isGroupable: boolean.

Return: void.

lockColumn()

It locks the column for moving. Remember that the column must be draggable. Params:

  1. column: DkColumnDef.

Return: void.

unlockColumn()

It unlocks the column for moving. Remember that the column must be draggable.

Params:

  1. column: DkColumnDef.

Return: void.

setColumnResizable()

It makes the given column resizable or non-resizable.

Params:

  1. column: DkColumnDef.

  2. isResizable: boolean.

Return: void.

swapColumns()

It interchanges the source and destination columns. Columns must belong to the same group.

Params:

  1. sourceColumn: DkColumnDef.

  2. destinationColumn: DkColumnDef.

Return: void.

moveColumnBefore()

It moves the given column at the left of the target column. Columns must belong to the same group.

Params:

  1. column: DkColumnDef.

  2. targetColumn: DkColumnDef.

Return: void.

moveColumnAfter()

It moves the given column to the right side of the target column. Columns must belong to the same group.

Params:

  1. column: DkColumnDef.

  2. targetColumn: DkColumnDef.

Return: void.

moveColumnIntoPanel()

It moves the given column to the given panel.

Params:

  1. column: DkColumnDef.

  2. panel: DkGridPanel.

Return: void.

movePanelColumns()

It moves all columns from the fromPanel panel to the destinationPanel panel. You can move only visible columns by providing the onlyVisibleColumns parameter.

Params:

  1. fromPanel: DkGridPanel.

  2. destinationPanel: DkGridPanel.

  3. onlyVisibleColumns: boolean.

Return: void.

setColumnFilterability<R>()

It changes the given column as filterable or not. You can specify an initial filter, and you can also define your custom filter conditions.

Params:

  1. column: DikeDataColumnDef<T, R>.

  2. isFilterable: boolean.

  3. filter?: DikeFilter[].

  4. customFilterConditions?: CustomFilterConditionInstance<T>.

Return: void.

changeColumnFilter<R>()

This method establishes a new filter for the given column. The column must be filterable.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. filter: DkFilter[].

Return: void.

setColumnEditable<R>()

It changes the given column as editable or not. You can specify the edition setting and the edition template for the given column.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. isEditable: boolean.

  3. settings: { editionSettings?: EditionFieldSettings, editionTemplate?: TemplateRef<any> }.

Return: void.

setDefaultEditionTemplateColumn<R>()

It sets the default edition template again.

Params:

  1. column: DkDataColumnDef<T, R>.

Return: void.

setDisplayTemplateColumn<R>()

It establishes the given template for the given column.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. displayTemplate: TemplateRef<any>.

Return: void.

setDefaultDisplayTemplateColumn<R>()

It establishes the default template for the given column.

Params:

  1. column: DkDataColumnDef<T, R>.

Return: void.

displayRowIndexColumn()

It makes visible or non-visible the column that shows the row identifier. You can also change the width of this column.

Params:

  1. visible: boolean.

  2. width: number.

Return: void.

changeColumnGroupStatus()

It sets the given status to the given column group.

Params:

  1. columnGroup: DkGroupColumnDef.

  2. status: DisplayStatus.

Return: void.

setColumnSortable<R>()

It makes sortable or non-sortable the given column.

Params:

  1. column: DkDataColumnDef<T, R>.

  2. isSortable: boolean.

Return: void.

getColumns()

It returns all the existing columns.

Params: None.

Return: DkColumnDef[].

getLinkedColumns()

It returns all the existing columns in a linked-node structure.

Params: None.

Return: DkNodeColumnDef[].

Events

EventDescription

columnSizeChange

It emits the column that has changed in width.

Params: None.

Return: Observable<DkDataColumnDef<T, R>>.

columnGroupStatusChange

It emits the column group that has changed its status.

It sends the column group until the leaves.

Params: None.

Return: Observable<DkGroupColumnDef>.

columnLockedChange

It emits the locked column for moving.

For column groups, it sends the column group until the leaves.

Params: None.

Return: Observable<DkColumnDef>.

columnUnLockedChange

It emits the unlocked column for moving.

For column groups, it sends the column group until the leaves.

Params: None.

Return: Observable<DkColumnDef>.

columnVisibleChange

It emits the column that changes its visibility.

For column groups, it sends the column group until the leaves.

Params: None.

Return: Observable<DkColumnDef>.

columnMove

It emits an object of type DkColumnMoveEvent. In this object is specified the type of movement and the columns involved.

Params: None.

Return: Observable<DkColumnMoveEvent>.

columnsChange

It emits the current columns from all panels. DkGrid emits this event every time a column operation occurs.

Params: None.

Return: Observable<DkColumnDef[]>.

contentPanelsColumnsChange

It emits the current columns from the content panels. DkGrid emits this event every time a column operation occurs.

Params: None.

Return: Observable<DkColumnDef[]>.

columnsRemovedChange

DkGrid emits this event when you delete a column.

Params: None.

Return: Observable<DkColumnDef[]>.

Last updated