You can design unique key by using ${$index}
like;
<script type="text/x-jquery-tmpl" id="jqTpl">
{{each data.users}}
<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dropdown-user" data-for=".user${$index +1}">
<i class="glyphicon glyphicon-chevron-down text-muted"></i>
</div>
<div class="row user-infos user${$index +1}">
User${$index +1}
</div>
{{/each}}
</script>
<script type="text/javascript">
var json={
"data": {
"users": [
3,
2,
1
]
}
}
</script>
For show this template in page;
$( "#jqTpl" ).tmpl( json ).appendTo( "body" )
You can see working demo here: http://jsfiddle.net/huseyinbabal/eQbvT/2/
On demo, inspect element and see class names are unique
Update: For tooltip fix add following;
$('i[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'bottom',
});
Here is working demo: http://jsfiddle.net/huseyinbabal/eQbvT/1/