Results 1 to 5 of 5

Thread: confirm() callback function not passing button variable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Vote Rating

    Default Answered: confirm() callback function not passing button variable

    I have a list with items and want to delete on swipe. The way i have it now is that when you swipe, it will prompt you whether you want to delete or not. after clicking yes or no the callback function is called. But i can't find out which button is clicked. i pass the index and the button clicked to a new function, but the value of button is always undefined, i do get the index right.

    this is in app.views.CustomerList.js:

    itemswipe: function(list, index) {
                       controller: app.controllers.customer,
                       action: 'confirmremove',
                       index: index,
                       scope: this
    this is in customer.js:

    confirmremove: function(params) {
            var customer = app.stores.customer.getAt(params.index);
            // android quirk? doesn't display "message", only title
            confirm('Delete?\n' + 
           + ' ' + + '\n' +
           + '\n' +
           + ' ' +, this.remove(this.button, params.index));
        remove: function(btn, index) {
            if (btn == 'yes') {
                Ext.Msg.alert('yes was clicked on ' + index);

  2. Why not use Ext.Msg.confirm instead of a regular javascript confirm popup?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts