lundi 28 avril 2014

Sencha buttons remains focused and other problems with buttons ( windows phone 8 only

I'm using sencha touch 2.3.1 I have an app which works fine in android , IOS and even windows apps ( windows store apps ). In windows phone 8, I have the following issues:

1) When I tap on a button, it gets focused and the event I assigned is triggered as expected and a new view is opened. But after closing the new view/returning to the page containing the button I tapped, i noticed that it remains tapped. I'm attaching a few screenshots for better understanding

wp_ss_20140428_0001[1].png









wp_ss_20140428_0002[1].png


2) When a new window or view opens after clicking a button, if I tap on the new view on the places where there is button in the view below, the button gets tapped and the event of the button is fired. I used the following in my previous app to prevent this:

if(Ext.getCmp('center-report')){ return false; }This code checks for the id ( center-report ) and it doesn't view of same report to open. But this works only if all the button's have same id. Also, I can still focus the button below. I ignored this till now, but it's really important to me now.

PS: I'm using direct html code for the buttons.

Here's a sample code:


'<table class="dashboardTable" border=0 cellpadding=1 cellspacing=1 width="100%">', '<tr><td width="80%" class="cardText" valign=top>View service revenue trends</td><td width="20%" >{[this.buttonReport(2,"Revenue")]}</td></tr>', '<tr><td class="cardText" valign=top>View sales trends</td><td>{[this.buttonReport(1,"Sales")]}</td></tr>', '</table>' buttonReport: function(id, name) { return Soham.object.Util.getConfirmButtonHtml('buttonReport0' + id, name, 'chart', id); },getConfirmButtonHtml: function(cls, text, icon, dataid) { var strHtml = ''; if (dataid) { strHtml = '<div ref="' + dataid + '" class="x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '" '; } else { strHtml = '<div class="x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '" '; } strHtml += 'ontouchstart="this.className = \'x-button-pressing x-button x-button-confirm x-iconalign-left ' + cls + '\'" '; strHtml += 'onmousedown="this.className=\'x-button-pressing x-button x-button-confirm x-iconalign-left ' + cls + '\'" '; strHtml += 'ontouchend="this.className=\'x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '\'" '; strHtml += 'onmouseup="this.className=\'x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '\'">'; if (icon != '') { strHtml += '<span class="x-button-icon ' + icon + ' x-shown" style></span>'; } if (text != '') { strHtml += '<span style class="x-button-label">' + text + '</span>'; } strHtml += '</div>'; return strHtml;},Is there anything I have to add to resolve this issue? Please help me resolve this as this is really important to me. Thanks





Aucun commentaire:

Enregistrer un commentaire