Releases: komarovalexander/ka-table
Releases · komarovalexander/ka-table
Ability to show custom message in case of no data in the table
Events customisation for the table element
example:
const childAttributes: ChildAttributes = {
table: {
onMouseEnter: (e, extendedEvent) => {
const { dispatch } = extendedEvent;
dispatch('MY_TABLE_onMouseEnter', { extendedEvent });
},
// ... Any other HTMLAttributes ....
},
};
return <Table ... childAttributes={childAttributes}>
Demo: Events
Events customisation for the grid cell
childAttributes prop was added for grid cell events customisation
Demo: Events
const childAttributes: ChildAttributes = {
cell: {
className: '123',
onClick: (e, extendedEvent): any => {
const { childProps: { dispatch } } = extendedEvent;
dispatch('MY_CELL_onClick', { extendedEvent });
},
onContextMenu: (e, extendedEvent) => {
extendedEvent.dispatch('MY_CELL_onContextMenu', { extendedEvent });
},
onDoubleClick: (e, extendedEvent) => {
const { dispatch, childElementAttributes } = extendedEvent;
childElementAttributes.onClick?.(e);
dispatch('MY_CELL_onDoubleClick', { extendedEvent });
},
},
};
return <Table ... childAttributes={childAttributes}>
Predefined filter operations for FilterRow
This release provides filter improvements and consistency in naming, as a result, some breaking changes have been made, also the major version number was increased to 2
Improvements:
- Filter row now working with date
- Predefined filter operations: '=', '>', '<', '<=', '>=', 'contains'
- Filter Row - Custom Editor demo has more customization examples
- 2 options have been added to the column: filterRowValue, filterRowOperator. See Filter Row
Breaking changes:
- onValueChange has been removed from EditorFuncPropsWithChildren. Use dispatch instead. See demos: Custom Editor, Filter Row - Custom Editor
- FilterRow option has been removed. The new option is filteringMode: FilteringMode.FilterRow, - use it to show filter row.
- column.filterCell was renamed to column.filterRowCell
- Events enum was replaced with ActionType enum with new items
RowDataChanged event
onEvent now also returns info about RowDataChanged event
DataRow customisation
dataRow property has been added in this release. It allows to customise DataRow's view in table.
See the demo https://komarovalexander.github.io/ka-table/#/custom-data-row
Sorting, Editing, Customisation, Events, Virtual Scrolling, Filter row, Search, Selection, Validation and more
Name | Type | Description |
---|---|---|
columns | Column[] | Columns in table and their look and behaviour |
data | any[] | The data which is shown in Table's rows |
editableCells | Cell[] | This property contains the array of cells which are being edited Editing Example |
editingMode | EditingMode | Sets the table's editing mode Editing Example |
filterRow | FilterCondition[] | Sets filters for columns Filter Row Example |
groups | Group[] | Group's in the table Grouping Example |
onDataChange | (data: any[]) => void | This function is executed each time when data going to change, use it to override current data Editing Example |
onOptionChange | (value: any) => void | This is mandatory function, this executes each time when grid going to change its state, use it to override current state Example |
onEvent | (type: string, data: any) => void | Use this function to track events in Table Events Example |
groupsExpanded | any[][] | Contains groups which are expanded in the grid |
rowKeyField | string | Property of data's item which is used to identitify row |
search | string | Specifies the text which should be found in the data Search Example |
selectedRows | any[] | Specifies the array of rows keys which are should be marked as selected Selection Example |
sortingMode | SortingMode | Sorting mode Sorting Example |
virtualScrolling | VirtualScrolling | Virtual scrolling options - set it as empty object {} to enable virtual scrolling and auto calculate its parameters Many Rows Example |