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

271
Visualizações
Caption Template (cannot send ${Key} value to function

I have a EJ2 Grid. I defined a Caption Template. I am trying to call a Javascript function but it is failing because the ${key} is a string with spaces. I ran an inspect (see the image) and the call fails do to the spaces. I tried to add quotes but those do not work either. Is there some trick to get this value to the JS function?

enter image description here

<script id="captiontemplate" type="text/x-template">
    ${if(field === "DistrictTypeName")}
    <strong>District Type:</strong>&nbsp;${key}&nbsp;
    ${/if}

    ${if(field === "DistrictName")}
    <table>
        <tr>
            <td style="width:500px">
                <strong>District:</strong>&nbsp; ${key}
            </td>
            <td style="width:200px">
                <i onclick="javascript:ShowEditDistrictModal(${key}, 1)" class="viewIcon" title="View" />
                <i class="fa fa-1x fa-eye"></i>
            </td>
            <td style="width:200px">
                <i onclick="javascript:ShowEditDistrictModal(${key}, 0)" class="editIcon" title="Edit" />
                <i class="fa fa-1x fa-edit"></i>
            </td>
        </tr>
    </table>
    ${/if}
</script>

about 4 years ago · Santiago Gelvez
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