1. #1
    Sencha User
    Join Date
    Apr 2007
    Location
    Ettlingen, Germany
    Posts
    65
    Vote Rating
    0
    Mark is on a distinguished road

      0  

    Default Unanswered: [SOLVED] Ext.select no result

    Unanswered: [SOLVED] Ext.select no result


    I'tried this code with Ext.Core 3.0 but the result of var y is [object].
    The same testcase with Extjs shows the correct coord.



    PHP Code:
    Ext.onReady(function()
          {
            var 
    el Ext.get(document.documentElement || document.body);
            var 
    trigger el.select('a[rel=anchor]');
            
    trigger.on('click', function()
              {
                var 
    target this.getAttribute('href').split('#');
                var 
    anc el.select('a[name='+target[1]+']').first();
                var 
    anc.getY();
                
    console.log(y);
              }
            );
        }) 
    here a short testcase:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
      <title></title>
    <script type="text/javascript" src="../sources/ext3/lib/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="../sources/ext3/lib/ext-all-debug.js"></script>
    <!-- <script type="text/javascript" src="../sources/ext3/core/ext-core.js"></script>    -->
    
    <script type="text/javascript">
    
    
         Ext.onReady(function()
          {
            var el = Ext.get(document.documentElement || document.body);
            var trigger = el.select('a[rel=anchor]');
            trigger.on('click', function()
              {
                var target = this.getAttribute('href').split('#');
                var anc = el.select('a[name='+target[1]+']').first();
                var y = anc.getY();
                console.log(y);
                alert(y);
    
              }
            );
        })
    
      </script>
    </head>
    
    <body>
    <p><a rel='anchor' href='#anker1' >go to anchor1</a></p>
    <p><a name="anker1">Anker</a> </p>
    </body>
    
    </html>
    I spend several hours on this , but I didn't find a solution ? Where is my fault?

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Answers
    1
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    ext-core doesn't have an Ext.CompositeElementLite.first() method, so you end up with Ext.Element.first(), which is something completely different!

    Use item(0) instead of first().

  3. #3
    Sencha User
    Join Date
    Apr 2007
    Location
    Ettlingen, Germany
    Posts
    65
    Vote Rating
    0
    Mark is on a distinguished road

      0  

    Default


    Now I understand! Thank you, Condor!

Similar Threads

  1. Submit form result always failed even when succesful result
    By noso in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 13 Dec 2008, 7:45 AM
  2. Easy Question: Parsing result.responseXML from Ext.Ajax
    By ChewyOHY in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 29 Jul 2008, 11:36 AM
  3. Newbie Problem:Use Ext.extend,but different result In IE and Firefox
    By neoart in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 14 Apr 2008, 5:47 PM
  4. qustion for can't getting the correct result using Ext.ux.InfoPanel!help!
    By hahaEr2003 in forum Ext 1.x: User Extensions and Plugins
    Replies: 1
    Last Post: 1 Aug 2007, 2:29 AM
  5. datastore can't get result on EXT 1.1 beta
    By ryanthe in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 19 Jun 2007, 6:54 PM

Thread Participants: 1