How can one assign a click event to an arbitrary span (eg. <span id="foo">foo</span>
) in an ST2 app?
I have a trivial example that illustrates the idea of what I'd like to do. In the example, I write the letters A,B,C
and I'd like to tell the user which letter they clicked.
Here's an image:
CODE SNIPPET
Ext.application({
launch: function() {
var view = Ext.create('Ext.Container', {
layout: {
type: 'vbox'
},
items: [{
html: '<span id="let_a">A</span> <span id="let_b">B</span> <span style="float:right" id="let_c">C</span>',
style: 'background-color: #c9c9c9;font-size: 48px;',
flex: 1
}]
});
Ext.Viewport.add(view);
}
});