fixing table edit

This commit is contained in:
rizky 2024-11-28 20:49:52 -07:00
parent 913f1dc942
commit 8771409229
1 changed files with 12 additions and 5 deletions

View File

@ -266,10 +266,17 @@ export const TableEdit: FC<{
<>
{value.map((row: any, idx: number) => {
return (
<BaseForm is_form={false} data={row}>
<BaseForm name="table-edit-form" tag={"div"} data={row}>
{(form) => {
return (
<tr className={cx("c-border-b ", idx !== value.length -1 ? "c-border-gray-300" : "" )}>
<tr
className={cx(
"c-border-b ",
idx !== value.length - 1
? "c-border-gray-300"
: ""
)}
>
{columns.map((header) => {
return (
<td
@ -322,11 +329,11 @@ export const TableEdit: FC<{
ext_fm={{
add: (e: any) => {
if (Array.isArray(fm.data[name])) {
fm.data[name].push({...e});
fm.data[name].push({ ...e });
} else {
fm.data[name] = [{...e}];
fm.data[name] = [{ ...e }];
}
console.log("CEKK")
console.log("CEKK");
fm.render();
setTimeout(() => {
const last = Array.from(