Friday, 6 September 2013

how to insert the tag in existing tag based on the div id using extjs?

how to insert the tag in existing tag based on the div id using extjs?

I need to insert some tag in the existing tags using extjs based on the
div id 'task123' and also display some alert accordingly.
HTML code:
<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>
insert the the new tag in to the old tag after the
<div>Messages</div>
based on the div id task123 here is the extjs code:
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);
The above code not working properly.

No comments:

Post a Comment