Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

239
Visualizações
EditableProTable Edit is Not working in ant design pro

I created table with ant design ProTable Component and its Edit function is not working. It showing error like this. ("Cannot read properties of undefined (reading 'toString')"). I tried many ways to solve this problem and cannot found a solution yet.

I want get table data from CSV file upload. That function is already working and data retrieved to the table.

const columns = [
    {
      title: 'First Name',
      valueType: 'string',
      typeof:'string',
      dataIndex: 'fName',
      formItemProps: () => {
        return {
          rules: [{ required: true, message: '' }],
        };
      },
    },
    {
      title: 'Last Name',
      valueType: 'string',
      typeof:'string',
      dataIndex: 'lName',
      formItemProps: () => {
        return {
          rules: [{ required: true, message: '' }],
        };
      },
    },
    {
      title: 'Email',
      valueType: 'string',
      typeof:'string',
      dataIndex: 'email',
      formItemProps: () => {
        return {
          rules: [{ required: true, message: '' }],
        };
      },
    },
    {
      title: 'Position',
      valueType: 'string',
      typeof:'string',
      dataIndex: 'position',
      formItemProps: () => {
        return {
          rules: [{ required: true, message: '' }],
        };
      },
    },
    {
      title: 'Actions',
      valueType: 'option',
      width: 200,
      render: (text, record, _, action) => [
        <a
          key="delete"
          onClick={() => {
            setData(data.filter((item) => item.id !== record.id));
          }}
        >
          Delete
        </a>,
        <a
          key="editable"
          onClick={() => {
            var _a;
            (_a = action === null || action === void 0 ? void 0 : action.startEditable) === null ||
            _a === void 0
              ? void 0
              : _a.call(action, record.id);
          }}
        >
          Edit
        </a>,
      ],
    },
  ];

EditableProTable
          rowKey="id"
          actionRef={actionRef}
          headerTitle=""
          maxLength={5}
          recordCreatorProps={false}
          columns={columns}
          request={async () => ({
            data: data,
            total: 3,
            success: true,
          })}
          value={csvArray}
          onChange={setCsvArray}
          editable={{
            type: 'multiple',
            editableKeys,
            onSave: async (rowKey, data, row) => {
              await waitTime(2000);
            },
            onChange: setEditableRowKeys,
            actionRender: (row, config, defaultDom) => [
              defaultDom.save,
              defaultDom.delete || defaultDom.cancel,
            ],
          }}
        />[![enter image description here][1]][1]
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The editableKeys array contains rows that are in the editing state

const [editableKeys, setEditableRowKeys] = useState(() => csvArray.map((item) => item.index)); // or .map((item=) => item.key));
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda