1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    13
    Vote Rating
    1
    manishnp is on a distinguished road

      0  

    Default Unanswered: Extjs Button Clicked Multiple Times

    Unanswered: Extjs Button Clicked Multiple Times


    Hi ,
    I found one solution for the problem which I am facing , but it was for Sencha Touch.You can follow the link

    http://stackoverflow.com/questions/1...h-a-view-twice

    What I need now how I can prevent a button which if gets clicked multiple times executes the code and then there is a mess.

    On my button click I am loading a View and Showing it to a Center Region panel.When I click the Button multiple times(i.e keep on clicking the button ) it just make the screen blank.

    I want to prevent this multiple clicks.


    Thanks
    Manish Pandit



  2. #2
    Sencha Premium Member
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    34
    Vote Rating
    8
    Answers
    10
    Johnny Major will become famous soon enough

      0  

    Default


    When the button is clicked you could first mask the screen then proceed.

  3. #3
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I think I'd disable (or mask) the button add a listener to the store's load event to enable (unmask) it.

    Code:
    handler: function (btn) {
        var store = view.getStore();
    
    
        store.on({
            load: function () {
                btn.enable();
            },
            single: true
        });
    
    
        btn.disable();
        store.load();
    }
    If the view's store and this load button are stable fixtures you could even just add a beforeload and load listener to the store to disable / mask the button and then enable it on load and the button handler would just have the view.getStore().load() action.


    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager:
    sheryl@sencha.com

Thread Participants: 2

Tags for this Thread