1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    41
    Vote Rating
    0
    Dig4Fire is on a distinguished road

      0  

    Default Unanswered: Get element

    Unanswered: Get element


    How to get the ul element?

    PHP Code:
                Ext.onReady(function () {
                
                    
    Ext.select('h3').on('click', function (x,y) {

                        var 
    el Ext.get(y).next(); // doesn't work -> null

                            
    if (el.isVisible()) {
                                
    el.slideOut('t', {useDisplaytrue});
                            } else {
                                
    el.slideIn();
                            }

                    });

                });

            
    </script>

        </head>
        <body>

                <h3><a href="#">Chapter 1</a></h3>

                <ul>
                    <li><a href="test1.htm">Test 1</a> </li>
                    <li><a href="test2.htm">Test 2</a> </li>
                </ul>

                <h3><a href="#">Chapter 2</a></h3>

                <ul>
                    <li><a href="test3.htm">Test 3</a> </li>
                    <li><a href="test4.htm">Test 4</a> </li>
                </ul> 

  2. #2
    Sencha User
    Join Date
    Aug 2009
    Posts
    41
    Vote Rating
    0
    Dig4Fire is on a distinguished road

      0  

    Default


    Has been settled.

    PHP Code:
    var el Ext.get(y).parent().next(); 

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    167
    Vote Rating
    0
    hello2008 is on a distinguished road

      0  

    Default


    if you click the link within the title container (<h3>), target will be a link, then parent().next() is correct, if clicking <h3> only, target is just you want, then next() is correct.

  4. #4
    Sencha User
    Join Date
    Aug 2009
    Posts
    41
    Vote Rating
    0
    Dig4Fire is on a distinguished road

      0  

    Default


    After a doubleclick on hr the ul elementis no more visible.

    Any suggestions?

  5. #5
    Sencha User
    Join Date
    Aug 2009
    Posts
    41
    Vote Rating
    0
    Dig4Fire is on a distinguished road

      0  

    Default


    Solved with jQuery

    PHP Code:
        $("h3").click(function (el) {
            $(
    el.target).parent().next().slideToggle();
        }); 

  6. #6
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78
    Vote Rating
    0
    jnicora is on a distinguished road

      0  

    Default


    there is no slide toggle, but i would go about this in a different way. i'd make my own slideToggle method

    PHP Code:
            Ext.Element.prototype.slideToggle = function(){
                var 
    self this;
                if (
    this.isVisible()) {
                    
    this.lastHeight this.getHeight();
                    
    this.shift({
                        
    height0,
                        
    useDisplaytrue,
                        
    blocktrue,
                        
    callback: function(){
                            
    self.hide();
                        }
                    })
                }
                else {
                    
    this.show().shift({
                        
    heightthis.lastHeight,
                        
    blocktrue,
                        
    useDisplaytrue
                    
    });
                }
            }; 
    then use this routine

    PHP Code:
            Ext.onReady(function () {
                
    Ext.select('h3').on('click', function (x,y) {
                    
    Ext.fly(y).parent().next().slideToggle();
                });
            }); 
    and in my example i wrapped the UL's in DIV's because it seemed more symantec

    PHP Code:
                <h3><a href="#">Chapter 1</a></h3>
                <
    div>
                <
    ul>
                    <
    li><a href="test1.htm">Test 1</a> </li>
                    <
    li><a href="test2.htm">Test 2</a> </li>
                </
    ul>
                </
    div>
                <
    h3><a href="#">Chapter 2</a></h3>
                <
    div>
                <
    ul>
                    <
    li><a href="test3.htm">Test 3</a> </li>
                    <
    li><a href="test4.htm">Test 4</a> </li>
                </
    ul
                </
    div

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi