NNKL.COM
welcome to my space
X
Search:  
 HOME   Meaning of Ext.Util.AddEvents parameters?
Meaning of Ext.Util.AddEvents parameters?
Published by: cfz 2009-01-09
Welcome to:nnkl.com

  • Hi,
    I am trying to understand how ExtJS Event "plumbing" works, and I had a very simple question:

    When defining events, are there any side effects if I change the property values of the object being passed to something different than "true" ? or is "true" just being used as a placeholder?


    Employee = function(name){
    this.name = name;
    this.addEvents({
    "fired" : true,
    "quit" : true
    });
    }
    Ext.extend(Employee, Ext.util.Observable);


    I changed the value to "false", "undefined" or an empty string and I didn't notice any difference...

    Employee = function(name){
    this.name = name;
    this.addEvents({
    "fired":'',
    "quit":''
    });
    }
    Ext.extend(Employee, Ext.util.Observable);

    var bob= new Employee("bob");
    bob.addListener("fired", function(){
    alert("Think of the children!");
    }
    );
    bob.fireEvent("fired");


    I looked at the API documentation for addEvents, but it is not much more descriptive 8-
    Meaning of Ext.Util.AddEvents parameters? - Ext JS Forums::
    Meaning of Ext.Util.AddEvents parameters? Ext: Help Meaning of Ext.Util.AddEvents parameters? User Name. Remember Me? Password. FAQ. Members List
    http://extjs.com/forum/showthread.php?p=115206
    HOME
    Ext: Help [Archive] - Page 27 - Ext JS Forums::
    [Archive] Page 27 Community help forum for Ext JS version 2.0 Get to GridPanel on load event of store. Meaning of Ext.Util.AddEvents parameters?
    http://extjs.com/forum/archive/index.php/f-9-p-27.html
    HOME
    Parameters:
    * object : Object
    The object with the events defined
    Returns:
    * void

    Thanks!


  • addEvents adds entries to the objects events array. This can be useful if you want to check if an event is supported, e.g.

    if(obj.events['click']) {
    // click event supported by obj
    }

    addListener will also add the event if it wasn't already in the events array.

    ps. There are 3 ways to specify events:
    obj.addEvents('event1', 'event2');
    obj.addEvents({'event1':true, 'event2':true});
    obj.addEvents({'event1':new Ext.util.Event(obj, 'event1'), 'event2':new Ext.util.Event(obj, 'event2')});

    but due to a bug in Ext the first one doesn't work.





  • I Am a Sinner – What About You?
    Global Sourcing and Supplier Online by Dylan

    You are looking at:nnkl.com's Meaning of Ext.Util.AddEvents parameters?, click nnkl.com to home
  • estonia
  • even more waterfowl shots
  • jerry the giraffe
  • at the dallas arboretum
  • hoar frost up close and far away
  • back to lasalle part 2
  • snowy day lake louise alberta jan 2005
  • lucena quezon philippines
  • raymond airic and chiller have nothing to fear
  • scenes from my drive to work
  • winter returns
  • broadwalk by the seaside
  • penumbral lunar eclipse
  • they come from sea
  •  
  • sun dappled in stanley park 2005
  • cashew drive
  • butterflies with the canon 30d
  • snowy day on sulphur mtn banff alberta
  • mum
  • flowers for lafoto
  • to steal malachite s subject from dusk till dawn
  • fenced tresspassing
  • before the balance is lost
  • geranium pansies
  • lake crescent
  • moon over maryland
  • back to lasalle
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 nnkl.com        Site made:CFZ