1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    11
    Vote Rating
    0
    TrickOfTheMind is an unknown quantity at this point

      0  

    Default Fire event on element

    Fire event on element


    Playing with the slide up/down example in the manual. I want to see how custom events work, so I've introduced an event called slidetextup and now I want to fire this even when the click event is called, however Element does not expose fireEvent - it seems only Ext obj expose this:

    Ext.get('textup').on('slidetextup',function(e,t){
    //simple slide of this element
    slideText('up','slider');
    Ext.get(t.id).frame('cccccc',1);
    });


    Ext.get('textup').on('click',function(e,t)
    {
    var textup = Ext.get('textup');
    textup.fireEvent('slidetextup',null);
    });


    What am I doing wrong? What is the fireEvent equivalant on Ext Element?

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    An Ext.Element does not extend Ext.Observable. It is merely a wrapper of a DOM element, and exposes the DOM element's event.

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    11
    Vote Rating
    0
    TrickOfTheMind is an unknown quantity at this point

      0  

    Default


    Okay thanks,
    so now I wrap my element in an object that extends observerable so I can fireEvents myself:



    MySpecialHyperlink = function(domElement)
    {

    this.el = domElement.dom;

    }

    Ext.extend(MySpecialHyperlink, Ext.util.Observable);



    var me = new MySpecialHyperlink(Ext.get('textup'));




    Now how can I get Ext.get('textup') to return an instance of MySpecialHyperlink without having to do the explicit conversion each time?

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Ext.get returns an Element wrapper of a DOM element.

    You need to keep a reference to the created MySpecialHyperlink object.

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