I am looking to insert a new tag within existing tags using extjs, based on the div id 'task123', and also trigger an alert message accordingly.
Below is the HTML code snippet:
<div id="task123">
<div class="msg" id="sample">
<ul class="msg-icons"> editButton </ul>
<h3>Task Details</h3>
<div>Messages</div>
<br/>
<a class="closeMessageBox" style="cursor:pointer; float: right; font-size:7pt;">Click here to close</a>
</div>
</div>
The task is to insert the new tag after the following line in the old tag:
<div>Messages</div>
With reference to the div id task123, here is the extjs code snippet:
var iconDisplay = {};
iconDisplay.html = '<div class="icon-right">' +'</div>';
var icondisp =
Ext.fly("task123").query('a.closeMessageBox');
Ext.core.DomHelper.insertBefore(icondisp[0], iconDisplay);
Ext.fly("task123").select('div.icon-right').on('click', function() {
alert("tested icon right...")
},_message);
It seems that the above code is not functioning properly as expected.