mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Minor fixes for table autogenerate column
This commit is contained in:
parent
dd1620a3bd
commit
8515d226bc
2 changed files with 3 additions and 7 deletions
|
|
@ -139,7 +139,6 @@ export const Table = React.memo(
|
|||
const updatedDataReference = useRef([]);
|
||||
const preSelectRow = useRef(false);
|
||||
const initialPageCountRef = useRef(null);
|
||||
const isInitialRender = useRef(true);
|
||||
const allAppEvents = useEvents();
|
||||
// const { events: allAppEvents } = useAppInfo();
|
||||
const tableEvents = allAppEvents.filter((event) => event.target === 'component' && event.sourceId === id);
|
||||
|
|
@ -578,10 +577,8 @@ export const Table = React.memo(
|
|||
dynamicColumn,
|
||||
setComponentProperty,
|
||||
properties.autogenerateColumns ?? false,
|
||||
id,
|
||||
isInitialRender.current
|
||||
id
|
||||
);
|
||||
isInitialRender.current = false;
|
||||
if (useDynamicColumn) {
|
||||
const dynamicColumnHasId = dynamicColumn && dynamicColumn.every((column) => 'id' in column);
|
||||
if (!dynamicColumnHasId) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ export default function autogenerateColumns(
|
|||
dynamicColumn = [],
|
||||
setProperty,
|
||||
generateNestedColumns,
|
||||
id,
|
||||
isInitialRender
|
||||
id
|
||||
) {
|
||||
if (useDynamicColumn) {
|
||||
if (dynamicColumn.length > 0 && dynamicColumn[0].name) {
|
||||
|
|
@ -111,7 +110,7 @@ export default function autogenerateColumns(
|
|||
setTimeout(
|
||||
() =>
|
||||
setProperty(id, 'columns', finalColumns, 'properties', undefined, undefined, undefined, {
|
||||
skipUndoRedo: isInitialRender,
|
||||
skipUndoRedo: true,
|
||||
saveAfterAction: true,
|
||||
}),
|
||||
10
|
||||
|
|
|
|||
Loading…
Reference in a new issue