-
4 Jul 2012 11:04 PM #1
Ext.Msg.confirm() is not working on tap of the image
Ext.Msg.confirm() is not working on tap of the image
Here is Mycode:
I want to show confirmation alert message to user on tap of the image. in the listeners i have defined tap function, within that defined Ext.Msg.confirm(""). when i tap the image i am not getting confirmation message. so below of this one i have defined normal alert message "Hi". after this one i am able to see only normal alert message "HI". not getting confirmation message. on image tap i need to display confirmation message to user to confirm Yes/No. same code i have used for button handler function. Ext.Msg.confirm(""). message working fine. is image tap support Ext.Msg.confirm("") or not? if possible then how to achieve this one. any one tell me how to do.Code:{ xtype: 'image', src: 'Imagepath', listeners: { tap: function () { //Confirmation message Ext.Msg.confirm( "Confirmation", "Are you sure you want to proceed?", function (btn) { if (btn === 'yes') { Ext.Msg.alert("You have selected Yes", ""); } else { Ext.Msg.alert("You have selected NO", ""); } }, this ); //Normal alert message alert("HI"); } }
-
5 Jul 2012 11:30 AM #2
That is wierd.. I went to Ext.Img to try their demo and inserted your code (formatted to fit their demo) and it worked fine.
Edit: When you have that extra alert('HI') in your previous code, that is done first before the Ext.Msg can be painted on the screen.Code:var img = Ext.create('Ext.Img', { src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png', height: 64, width: 64, listeners: { tap: function(me){ Ext.Msg.confirm('confirm', 'yes or no?', function(btn){ if(btn === 'yes'){ Ext.Msg.alert("You have selected Yes", ""); } else { Ext.Msg.alert("You have selected NO", ""); } }); } } }); Ext.Viewport.add(img);
-
5 Jul 2012 8:14 PM #3
Thanks a lot...it is working fine.


Reply With Quote