mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Feature :: Table sort disable/enable (#4142)
* feat :: disable sorting * disable action buttons * cleanup * cleanup * revert :: unwanted changes
This commit is contained in:
parent
f734ba0d3a
commit
5a88464600
5 changed files with 13 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ export function Table({
|
|||
parsedDisabledState,
|
||||
actionButtonRadius,
|
||||
actions,
|
||||
disabledSort,
|
||||
} = loadPropertiesAndStyles(properties, styles, darkMode, component);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
|
@ -347,6 +348,7 @@ export function Table({
|
|||
pageCount: -1,
|
||||
manualPagination: false,
|
||||
getExportFileBlob,
|
||||
disableSortBy: disabledSort,
|
||||
manualSortBy: serverSideSort,
|
||||
},
|
||||
useFilters,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import React from 'react';
|
|||
const generateActionsData = ({ actions, columnSizes, defaultColumn, fireEvent, setExposedVariables }) => {
|
||||
const leftActions = () => actions.filter((action) => action.position === 'left');
|
||||
const rightActions = () => actions.filter((action) => [undefined, 'right'].includes(action.position));
|
||||
|
||||
const leftActionsCellData =
|
||||
leftActions().length > 0
|
||||
? [
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export default function loadPropertiesAndStyles(properties, styles, darkMode, co
|
|||
if (typeof serverSidePagination !== 'boolean') serverSidePagination = false;
|
||||
|
||||
const serverSideSearch = properties.serverSideSearch ?? false;
|
||||
const disabledSort = properties?.disabledSort ?? false;
|
||||
|
||||
const serverSideSort = properties.serverSideSort ?? false;
|
||||
|
||||
|
|
@ -70,5 +71,6 @@ export default function loadPropertiesAndStyles(properties, styles, darkMode, co
|
|||
actionButtonRadius,
|
||||
loadingState,
|
||||
actions,
|
||||
disabledSort,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -862,6 +862,7 @@ class TableComponent extends React.Component {
|
|||
'showBulkUpdateActions',
|
||||
'showBulkSelector',
|
||||
'highlightSelectedRow',
|
||||
'disabledSort',
|
||||
'serverSideSort',
|
||||
'serverSideFilter',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -141,6 +141,13 @@ export const widgets = [
|
|||
schema: { type: 'boolean' },
|
||||
},
|
||||
},
|
||||
disabledSort: {
|
||||
type: 'toggle',
|
||||
displayName: 'Disable sorting',
|
||||
validation: {
|
||||
schema: { type: 'boolean' },
|
||||
},
|
||||
},
|
||||
clientSidePagination: {
|
||||
type: 'toggle',
|
||||
displayName: 'Client-side pagination',
|
||||
|
|
|
|||
Loading…
Reference in a new issue