Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    51
    Answers
    7
    Vote Rating
    0
    noromamai is on a distinguished road

      0  

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

    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:

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

    Code:
    confirmremove: function(params) {
            var customer = app.stores.customer.getAt(params.index);
            // android quirk? doesn't display "message", only title
            confirm('Delete?\n' + 
                    customer.data.first + ' ' + customer.data.last + '\n' +
                    customer.data.address + '\n' +
                    customer.data.zipcode + ' ' + customer.data.city, 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?

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar