- updated tables, fixed bug of not updating auto calculated total;
This commit is contained in:
@@ -8,7 +8,11 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
e.target.select();
|
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);
|
table.options.meta?.updateData(index, id, value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -16,8 +20,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={initialValue}
|
value={initialValue}
|
||||||
onValueChange={(e) => onChange(e.value)}
|
/*onValueChange={(e) => onChange(e.value)}*/
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
|
onBlur={(e) => onBlur(e.target.value)}
|
||||||
minFractionDigits={0}
|
minFractionDigits={0}
|
||||||
maxFractionDigits={2}
|
maxFractionDigits={2}
|
||||||
locale='it-IT'
|
locale='it-IT'
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
e.target.select();
|
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);
|
table.options.meta?.updateData(index, id, value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -16,8 +21,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={initialValue}
|
value={initialValue}
|
||||||
onValueChange={(e) => onChange(e.value)}
|
/*onValueChange={(e) => onChange(e.value)}*/
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
|
onBlur={(e) => onBlur(e.target.value)}
|
||||||
minFractionDigits={0}
|
minFractionDigits={0}
|
||||||
maxFractionDigits={2}
|
maxFractionDigits={2}
|
||||||
locale='it-IT'
|
locale='it-IT'
|
||||||
|
|||||||
@@ -122,13 +122,8 @@ const Table = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const stateFieldData = pathOr([], ['stateFieldData'], tableColumns);
|
const stateFieldData = pathOr([], ['stateFieldData'], tableColumns);
|
||||||
/*const obj = stateFieldData
|
|
||||||
.reduce((acc, cur) => {
|
|
||||||
acc[cur.name] = ''
|
|
||||||
return acc;
|
|
||||||
}, {});*/
|
|
||||||
let rowsData = pathOr([], ['rowsData'], tableColumns);
|
let rowsData = pathOr([], ['rowsData'], tableColumns);
|
||||||
//rowsData = isEmpty(rowsData) ? [obj] : rowsData;
|
|
||||||
setColumnsCfg(stateFieldData);
|
setColumnsCfg(stateFieldData);
|
||||||
setRowsCfg(rowsData);
|
setRowsCfg(rowsData);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user