-
2 Mar 2013 3:42 AM #1
Ext.device.notification.PhoneGap broken
Ext.device.notification.PhoneGap broken
Hi there,
the PhoneGap notification is not working, because its broken at several points.
VERSION
Sencha Touch 2.1.1
FILE
Ext.device.notification.PhoneGap
REPRODUCTION
Add anywhere:
RESULTCode:Ext.device.Notifcation.show({ title: 'foo', message: 'bar', buttons: Ext.MessageBox.OKCANCEL, callback: function() {alert('closed')} });
1) button is written as buton
2) buttons are not shown, as the buttons are passed in the wrong way
3) callback throws an error, as it tries to make an array to lowercase
EXPECTED RESULT
Show a native popup and call the callback fn at the end.
WORKING CODE
Code:show: function () { var config = this.callParent(arguments), buttons = (config.buttons), onShowCallback = function (index) { if (config.callback) { config.callback.apply(config.scope, (config.buttons) ? [config.buttons[index - 1].itemId.toLowerCase()] : []); } }; // change Ext.MessageBox buttons into normal arrays var ln = buttons.length; if (ln && typeof buttons[0] != "string") { var newButtons = [], i; for (i = 0; i < ln; i++) { newButtons.push(buttons[i].text); } buttons = newButtons.join(','); } navigator.notification.confirm( config.message, // message onShowCallback, // callback config.title, // title buttons // array of button names ); }
-
2 Mar 2013 10:57 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Thanks for the report! I have opened a bug in our bug tracker.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-4080
in
Sprint 31.


Reply With Quote