1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    3
    Vote Rating
    0
    dppware is on a distinguished road

      0  

    Default how to get Ext.Button.click proxy

    how to get Ext.Button.click proxy


    Hello, first of all sorry for my english poor. ;-(

    In my application, before any button click event, I would to fires an "validationFunction" for each button action (handler).

    To do this, i should to override Ext.Button (to get this performs for all my application buttons) and I tried this:
    Ext.override(Ext.Button, {
    initComponent:function() {
    // call parent init component
    Ext.Button.superclass.initComponent.apply(this, arguments);
    // add custom events
    this.addEvents('criticalAction',this.criticalAction);
    //Add listener
    Ext.Button.superclass.mon(this.el, 'criticalAction', this.criticalAction(), this,{buffer: 50});
    //change click event to fires criticalAction
    this.clickEvent = 'criticalAction';
    log(Ext.Button);

    },
    criticalAction : function (){
    alert('es una accion critica');
    Ext.Button.onClick(this);

    }
    });

    but this not work, because AddListener throws me.events = undefined

    I found preventEvent() on Ext.Button.onclick but I dont know how edit it.

    Thanks your help!!

  2. #2
    Ext User
    Join Date
    Oct 2010
    Posts
    3
    Vote Rating
    0
    dppware is on a distinguished road

      0  

    Default


    well, better do:
    criticalAction: function (){
    this.fireEvet('click', this);
    }

    what im doing wrong?

    thks

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    Take a look at Observable.observeClass

  4. #4
    Ext User
    Join Date
    Oct 2010
    Posts
    3
    Vote Rating
    0
    dppware is on a distinguished road

      0  

    Talking reply

    reply


    thanks !!

Similar Threads

  1. [Solved] Programmatically click an Ext.Button ??
    By chalu in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 9 Aug 2012, 11:22 AM
  2. New Ext.Window on Button Click
    By nitesh35103 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 14 Jun 2012, 11:39 PM
  3. Ext Button Click Calls a servlet?
    By rohangpatil in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 27 May 2010, 10:51 PM
  4. Cannot fire click event on Ext.Button
    By fermo111 in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 11 Dec 2007, 6:24 PM

Thread Participants: 1

Tags for this Thread