- 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();
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user