- updated tables, fixed bug of not updating auto calculated total;

This commit is contained in:
Vitalii Kiiko
2025-04-30 11:17:14 +02:00
parent e4e76aa1c3
commit 02cda22580
3 changed files with 16 additions and 10 deletions

View File

@@ -8,7 +8,11 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
e.target.select();
}
const onChange = (value) => {
/*const onChange = (value) => {
table.options.meta?.updateData(index, id, value);
};*/
const onBlur = (value) => {
table.options.meta?.updateData(index, id, value);
};
@@ -16,8 +20,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
<InputNumber
disabled={disabled}
value={initialValue}
onValueChange={(e) => onChange(e.value)}
/*onValueChange={(e) => onChange(e.value)}*/
onFocus={onFocus}
onBlur={(e) => onBlur(e.target.value)}
minFractionDigits={0}
maxFractionDigits={2}
locale='it-IT'

View File

@@ -8,7 +8,12 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
e.target.select();
}
const onChange = (value) => {
/*const onChange = (value) => {
console.log('table.options.meta', table.options.meta)
table.options.meta?.updateData(index, id, value);
};*/
const onBlur = (value) => {
table.options.meta?.updateData(index, id, value);
};
@@ -16,8 +21,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
<InputNumber
disabled={disabled}
value={initialValue}
onValueChange={(e) => onChange(e.value)}
/*onValueChange={(e) => onChange(e.value)}*/
onFocus={onFocus}
onBlur={(e) => onBlur(e.target.value)}
minFractionDigits={0}
maxFractionDigits={2}
locale='it-IT'

View File

@@ -122,13 +122,8 @@ const Table = ({
useEffect(() => {
const stateFieldData = pathOr([], ['stateFieldData'], tableColumns);
/*const obj = stateFieldData
.reduce((acc, cur) => {
acc[cur.name] = ''
return acc;
}, {});*/
let rowsData = pathOr([], ['rowsData'], tableColumns);
//rowsData = isEmpty(rowsData) ? [obj] : rowsData;
setColumnsCfg(stateFieldData);
setRowsCfg(rowsData);