Skip to content

Releases: komarovalexander/ka-table

Ability to show custom message in case of no data in the table

17 Jan 17:12
6e14e83
Compare
Choose a tag to compare

#17

const tableOption: ITableOption = {
  //...
  noDataRow: () => 'No Data Found',
  //...
};

image
Demo

Events customisation for the table element

12 Jan 21:24
c0e35a3
Compare
Choose a tag to compare

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

12 Jan 10:25
83e5f9d
Compare
Choose a tag to compare

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

31 Dec 16:31
b95f30c
Compare
Choose a tag to compare

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:

  1. Filter row now working with date
  2. Predefined filter operations: '=', '>', '<', '<=', '>=', 'contains'
  3. Filter Row - Custom Editor demo has more customization examples
  4. 2 options have been added to the column: filterRowValue, filterRowOperator. See Filter Row

Breaking changes:

  1. onValueChange has been removed from EditorFuncPropsWithChildren. Use dispatch instead. See demos: Custom Editor, Filter Row - Custom Editor
  2. FilterRow option has been removed. The new option is filteringMode: FilteringMode.FilterRow, - use it to show filter row.
  3. column.filterCell was renamed to column.filterRowCell
  4. Events enum was replaced with ActionType enum with new items

RowDataChanged event

27 Dec 19:42
938afbb
Compare
Choose a tag to compare

onEvent now also returns info about RowDataChanged event

DataRow customisation

23 Dec 14:10
80e222b
Compare
Choose a tag to compare

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

15 Dec 21:21
c3d5d5f
Compare
Choose a tag to compare
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