Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

278
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda