As title says, i am developing Table component with dx-react-grid
I can´t find the way to sort by selected rows, in the application user need to be able to move selected rows to the top of the table. As sorting
state is an array of objects that are containing column name, and selection column doesn´t have a name, it´s not possible to simply push it to that array as other columns.
As it´s possible to push selection column to left or right columns like this:
leftColumns.push(TableSelection.COLUMN_TYPE)
<TableFixedColumns leftColumns={leftColumns} rightColumns={rightColumns} />
TableSelection.COLUMN_TYPE
is a symbol, i tried to pass sorting like this:
const [integratedSortingColumnExtensions] = useState([{ columnName: TableSelection.COLUMN_TYPE, compare: comparePriority }]);
<IntegratedSorting columnExtensions={integratedSortingColumnExtensions} />
but algorithm doesn´t recive any values to loop through, when i trigger this algorithm i get undefined, undefined
(but it does work for any other column):
function comparePriority(a, b) {
console.log(a, b);
}
there is
selection
state in the main table which is only array of rows IDs that are selected(if nothing selected, array is empty)