PDA

View Full Version : [DUP] Notification Sencha - Buttons



Kurt001
12 Nov 2012, 7:57 AM
Notification.PhoneGap shows [object Object] for button

REQUIRED INFORMATION

Ext version tested:

Sencha Touch 2.1.0 Commertial FINAL
Browser versions tested against:

Android app using Sencha
Description:

Passing OKCancel as the buttons option for Notification.show() causes buttons to display as [object Object]
Problem:

Ext.device.notification.Sencha shows buttons: .../@todo fix this

Here is a possible fix:


/**
* @private
*/
Ext.define('Ext.device.notification.Sencha', {
extend: 'Ext.device.notification.Abstract',
requires: ['Ext.device.Communicator'],


show: function() {
var config = this.callParent(arguments),
buttons = [];


for (i = 0, ln = config.buttons.length; i < ln; i++){


buttons[i]= config.buttons[i].text;
}


Ext.device.Communicator.send({
command: 'Notification#show',
callbacks: {
callback: config.callback
},
scope : config.scope,
title : config.title,
message: config.message,
buttons: buttons.join(',') //old-->@todo fix this
});
},


vibrate: function() {
Ext.device.Communicator.send({
command: 'Notification#vibrate'
});
}
});

mitchellsimoens
12 Nov 2012, 11:08 AM
Thanks for the report! I have opened a bug in our bug tracker.

matthewpayne
18 Mar 2013, 11:55 AM
This is still broken in 2.1.1...any ETA?

csowell
26 Sep 2013, 2:46 PM
I'm using Sencha 2.2.1, and I'm still having this issue. Has it been resolved yet?

Kurt001
27 Sep 2013, 3:01 AM
Definately fixed in 2.3