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

210
Visualizações
AG Grid: clearing a drop-down field programmatically

I have a two grid columns set up to display as editable drop-down fields. The column definition for each field uses this code to render the selection values:

return '<div class="editCell-innerDiv">' + params.value +
            '<img class="alignRight" src="/resource/images/triangle-down_filled_12.png" alt="">' +
            '</div>';

and render like this in the grid:

enter image description here

When the user changes a value in one drop-down, I need to clear the value in the other drop-down. When I use this JS code:

params.node.setDataValue('Some_Field', '');

I get this error in the console:

Cannot read properties of null (reading 'getColDef')

What code would I use to programmatically clear the other editable select field in the grid?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The way I do this, although I am not sure if the context is exactly the same (I do it within an event handler for Tab keys), is as follows...

params.node.data.Some_Field = '';
api.refreshCells({ rowNodes: [params.node], force: true });

I am not sure how you will get access to the ag-grid api (the api object in my code sample). This will depend on the context of your code.

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