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
addColumns()
It inserts a new column or a set of new columns. Params:
columns:
DkColumnDef|DkColumnDef[].
Return: void.
removeColumns()
It deletes the given columns permanently.
Params:
columns:
DkColumnDef|DkColumnDef[].
Return: void.
findColumn()
It searches a column in all panels. The found column must meet the compare function criteria.
Params:
compare:
CompareColumnFn.
Return: DkColumnDef.
findNode()
It searches a node in all panels. The found node must meet the compare function criteria.
Params:
compare:
CompareNodeFn.
Return: DkNodeColumnDef.
setColumnVisible()
It makes visible or non-visible the given column.
Params:
column:
DkColumnDef.isVisible:
boolean.
Return: void.
changeColumnWidth<R>()
It modifies a data column in width. You can set the minimum and the maximum values.
Params:
column:
DkDataColumnDef<T, R>.columnSize: { width:
number, minWidth?:number, maxWidth?:number}.
Return: void.
setColumnGroupable()
It makes the given column groupable or non-groupable.
Params:
column:
DkDataColumnDef<T, R>.isGroupable:
boolean.
Return: void.
lockColumn()
It locks the column for moving. Remember that the column must be draggable. Params:
column:
DkColumnDef.
Return: void.
unlockColumn()
It unlocks the column for moving. Remember that the column must be draggable.
Params:
column:
DkColumnDef.
Return: void.
setColumnResizable()
It makes the given column resizable or non-resizable.
Params:
column:
DkColumnDef.isResizable:
boolean.
Return: void.
swapColumns()
It interchanges the source and destination columns. Columns must belong to the same group.
Params:
sourceColumn:
DkColumnDef.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:
column:
DkColumnDef.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:
column:
DkColumnDef.targetColumn:
DkColumnDef.
Return: void.
moveColumnIntoPanel()
It moves the given column to the given panel.
Params:
column:
DkColumnDef.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:
fromPanel:
DkGridPanel.destinationPanel:
DkGridPanel.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:
column:
DikeDataColumnDef<T, R>.isFilterable:
boolean.filter?:
DikeFilter[].customFilterConditions?:
CustomFilterConditionInstance<T>.
Return: void.
changeColumnFilter<R>()
This method establishes a new filter for the given column. The column must be filterable.
Params:
column:
DkDataColumnDef<T, R>.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:
column:
DkDataColumnDef<T, R>.isEditable:
boolean.settings: { editionSettings?:
EditionFieldSettings, editionTemplate?:TemplateRef<any>}.
Return: void.
setDefaultEditionTemplateColumn<R>()
It sets the default edition template again.
Params:
column:
DkDataColumnDef<T, R>.
Return: void.
setDisplayTemplateColumn<R>()
It establishes the given template for the given column.
Params:
column:
DkDataColumnDef<T, R>.displayTemplate:
TemplateRef<any>.
Return: void.
setDefaultDisplayTemplateColumn<R>()
It establishes the default template for the given column.
Params:
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:
visible:
boolean.width:
number.
Return: void.
changeColumnGroupStatus()
It sets the given status to the given column group.
Params:
columnGroup:
DkGroupColumnDef.status:
DisplayStatus.
Return: void.
setColumnSortable<R>()
It makes sortable or non-sortable the given column.
Params:
column:
DkDataColumnDef<T, R>.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
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