Results 1 to 7 of 7

Thread: target = e.getTarget('a:not(.exi)', 3), what does it mean?

  1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    4
    Vote Rating
    0
      0  

    Default target = e.getTarget('a:not(.exi)', 3), what does it mean?

    target = e.getTarget('a:not(.exi)', 3)
    what does it mean?
    the following code come from EXT EXAMPLE
    onClick: function(e, target){alert(target);
    if(target = e.getTarget('a:not(.exi)', 3)){
    var cls = Ext.fly(target).getAttributeNS('ext', 'cls');
    e.stopEvent();
    if(cls){
    var member = Ext.fly(target).getAttributeNS('ext', 'member');
    this.loadClass(target.href, cls, member);
    }else if(target.className == 'inner-link'){
    this.getActiveTab().scrollToSection(target.href.split('#')[1]);
    }else{
    window.open(target.href);
    }
    }else if(target = e.getTarget('.micon', 2)){
    e.stopEvent();
    var tr = Ext.fly(target.parentNode);
    if(tr.hasClass('expandable')){
    tr.toggleClass('expanded');
    }
    }
    },

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,597
    Vote Rating
    874
      0  

    Default

    It's a css selector, which looks for:

    Anchor tags, that don't have the class name "exi", to a height of 3 above the current element.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Ext User
    Join Date
    Aug 2007
    Posts
    4
    Vote Rating
    0
      0  

    Default

    to a height of 3 above the current element.
    what does it mean?

    <a ext:cls="Ext.util.JSON" ext:member="encode" href="output/Ext.util.JSON.html#encode">Ext.util.JSON.encode</a>

    onClick: function(e, target){alert(target);
    if(target = e.getTarget('a:not(.exi)', 3)){...
    when you click the link,the alert window show 'http://localhost/ext/docs/output/Ext.util.JSON.html#encode'
    why e.getTarget('a:not(.exi)', 3) ='http://localhost/ext/docs/output/Ext.util.JSON.html#encode'

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,597
    Vote Rating
    874
      0  

    Default

    You could always just get this info from the docs: http://extjs.com/deploy/dev/docs/?cl...mber=getTarget
    Evan Trimboli
    Twitter - @evantrimboli

  5. #5
    Ext User wolverline's Avatar
    Join Date
    Oct 2008
    Location
    Timbuktu, Mali
    Posts
    11
    Vote Rating
    0
      0  

    Default Is this a "PC Load Letter" thingy?

    Looked up the API doc.. but there's no lines explaining what is ".exi" or "height above" all about. Is this a new web geek[guru] jargon?

    Quote Originally Posted by evant View Post
    You could always just get this info from the docs: http://extjs.com/deploy/dev/docs/?cl...mber=getTarget

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,615
    Vote Rating
    54
      0  

    Default

    DomeQuery API docs say "DomQuery supports most of the CSS3 selectors spec, along with some custom selectors and basic XPath."

    And http://extjs.com/deploy/dev/docs/?cl...mber=getTarget actually tells you what the depth is.

  7. #7
    Sencha Premium User
    Join Date
    Dec 2010
    Posts
    199
    Vote Rating
    9
      0  

    Default getTarget( event ) : HTMLElement - 4.1.3 doc doesn't tell you anything

    All it says is that selector is a string???

    selector
    : String (optional)A simple selector to filter the target or look for an ancestor of the target

    No info regarding format, links to resources or even mention of CSS3 or XPATH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •