diff --git a/src/client/src/components/table/index.tsx b/src/client/src/components/table/index.tsx index cbcb5948..4400e59b 100644 --- a/src/client/src/components/table/index.tsx +++ b/src/client/src/components/table/index.tsx @@ -22,6 +22,7 @@ interface TableProps { filterPlaceholder?: string; withGlobalSort?: boolean; // enables the global search box withSorting?: boolean; // enables columns to be sorted + initSorting?: SortingState; withBorder?: boolean; alignCenter?: boolean; fontSize?: string; @@ -94,9 +95,10 @@ export default function Table({ toggleConfiguration, withGlobalSort = false, withSorting = false, + initSorting, }: TableProps) { const [globalFilter, setGlobalFilter] = useState(''); - const [sorting, setSorting] = useState([]); + const [sorting, setSorting] = useState(initSorting || []); const [isOpen, setIsOpen] = useState(false); const [columnVisibility, setColumnVisibility] = useState( diff --git a/src/client/src/views/channels/channels/ChannelTable.tsx b/src/client/src/views/channels/channels/ChannelTable.tsx index cfe1ebc6..07429d47 100644 --- a/src/client/src/views/channels/channels/ChannelTable.tsx +++ b/src/client/src/views/channels/channels/ChannelTable.tsx @@ -580,6 +580,12 @@ export const ChannelTable = () => { data={tableData} withGlobalSort={true} withSorting={true} + initSorting={[ + { + id: 'balanceBars', + desc: false, + }, + ]} toggleConfiguration={handleToggle} defaultHiddenColumns={hiddenColumnState} filterPlaceholder="channels"