Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!