Skip to content

Commit c2f6865

Browse files
authored
chore(netdata table): add external support for onSortingChange (#406)
* chore(netdata table): add external support for onSortingChange * v2.5.3
1 parent 09a05ec commit c2f6865

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "2.5.2",
3+
"version": "2.5.3",
44
"description": "netdata UI kit",
55
"main": "./lib/index.js",
66
"files": [

src/components/tableV2/netdataTable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import MainTable from "./features/mainTable"
2525

2626
import { SharedTableProvider } from "./context/sharedTable"
2727

28+
const noop = () => {}
29+
2830
const NetdataTable = ({
2931
dataColumns,
3032
data,
@@ -38,6 +40,7 @@ const NetdataTable = ({
3840
bulkActions = {},
3941
onClickRow,
4042
onHoverRow,
43+
onSortingChange = noop,
4144
disableClickRow,
4245
enablePagination,
4346
paginationOptions = {
@@ -161,7 +164,10 @@ const NetdataTable = ({
161164
getFilteredRowModel: getFilteredRowModel(),
162165
onRowSelectionChange: setRowSelection,
163166
onGlobalFilterChange: handleGlobalSearch,
164-
onSortingChange: setSorting,
167+
onSortingChange: getSorting => {
168+
onSortingChange(getSorting)
169+
setSorting(getSorting)
170+
},
165171
getSortedRowModel: getSortedRowModel(),
166172
getPaginationRowModel: getPaginationRowModel(),
167173
onPaginationChange: setPagination,

0 commit comments

Comments
 (0)