JSFiddle - React, Tailwind, and code Playground
by Balagangadhar
JavaScript
values = [{
id : 'v1',
name : 'Value1'
}, {
id : 'v2',
name : 'Value2'
}, {
id : 'v3',
name : 'Value3'
}, {
id : 'v4',
name : 'Value4'
}, {
id : 'v5',
name : 'Value5'
}];
var tpl = new Ext.XTemplate(
'<p>Values: ',
'<tpl for=".">',
'<div style="display: inline-block" data-valueid="{id}" class="values-class">{name}</div><br/>',
'</tpl></p>');
var panel = Ext.create('Ext.panel.Panel', {
renderTo : Ext.getBody()
,
});
tpl.overwrite(panel.body, values);
var el = Ext.getBody();
el.on('mouseover', function(e, t, eOpts) {
alert(t.getAttribute('data-valueid'));
}, this, {
delegate : '.values-class'
});