PDA

View Full Version : Click event only fires once in IE8



extop
5 Jun 2014, 8:05 AM
Hello !

I have a form panel that is embedded inside a popup window. I use html table element to create the title of the form. In the html table, I have a span element in a table cell. I am using icon fonts to show the close window icon X. Then I use use "on" function to set the click event on the span containing the icon font. When I click the icon font the window is supposed to close. Everything works well in other browsers but in IE8, the click event only fires once. Then when I show the window again, X button doesn't work. Any ideas what might be causing this? Any help will be appreciated. Thank you!
Here is how the code looks like,

var title = <table ><tr><td >This is title</td><td ><span id='closewin' class='icon'> </span></td></tr></table>;
form.setTitle(title);
var spanEl = Ext.get("closewin");
spanEl.el.on('click', function() {
window.close();
}, this);

mdnaveed42
5 Jun 2014, 10:33 PM
Hi,

Please use Sencha Fiddle (https://fiddle.sencha.com/#home) to demonstrate your issue.

Anyways, This issue might be because of popup. If popup instance isn't destroyed then there will be multiple elements created in the DOM due to which click isn't working as expected.

Please try to execute the following line and check the output(for 2nd attempt)
Ext.query('#closewin') --> check the count of this

Thanks,
Md Naveed
\m/