This is a migrated thread and some comments may be shown as answers.

using template variable for generating id

0 Answers 64 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Muhammed Shakir
Top achievements
Rank 2
Muhammed Shakir asked on 05 May 2012, 09:56 AM
Hi ,

I have a function to call in a listView which is generated using a template. The function takes id of the div and does something to it. The cannot be same of all div(s) generated in the listView or else the function logic will for a toss. I tried generating the id of div like this :

<div id="menuitemtarget#= eventId #" ..... 
But to my dismay, the id does not take in menuitemtarget101 (if eventId is 101) it takes it as id="menuitemtarget#= eventId #" as it is.


My Code is somewhat like this :


<div id="menuitemtarget" class="searchcell"

onclick="# tntToggleMenu("#menuitemtarget", "#menuActions") #>

<span>Actions</span> <span class="iconaero"> <!-- -->

</span>

<div class="clear"></div>

<ul class="actionsMenu displayNone" style="margin: 0;"

id="menuActions">

<li class="actionMenuItem"><a href="">Option 1</a> </li>

<li class="actionMenuItem"><a href="">Option 2</a> </li>

</ul>

</div>





Please help

No answers yet. Maybe you can help?

Tags
Templates
Asked by
Muhammed Shakir
Top achievements
Rank 2
Share this question
or