1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    2
    Vote Rating
    0
    jsonx is on a distinguished road

      0  

    Default Unanswered: first-sibling

    Unanswered: first-sibling


    Hi, I try to select first sibling td's id on click.
    Code:
    Ext.onReady(function(){
            Ext.select("table").on("click", function(e,t){
                e.stopEvent();
                Ext.get(t).first();  //jQuery: $(e.target).siblings("td:first")
            });
        });
    HTML Code:
        <table>
            <tr>
                <td id="foo">alfa</td><td>beta</td>
            </tr>
            <tr>
                <td id="bar">alfa</td><td>beta</td>
            </tr>
        </table>
    any help would be appreciated.

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

      0  

    Default


    Code:
    Ext.override(Ext.Element, {
        siblings: function(s) {
            var n = this.dom.parentNode, r, c, i, l, rl;
            if(s) {
                r = Ext.DomQuery.select('/' + s, n);
                for (i = 0, rl = r.length; i < rl; i++) {
                    if (r[i] === this.dom) {
                        r.splice(i, 1);
                        return r;
                    }
                }
            } else {
                r = [];
                c = n.childNodes;
                for (i = 0, rl = c.length; i < rl; i++) {
                    if (c[i] !== this.dom) {
                        r.push(c[i]);
                    }
                }
                return r;
            }
        }
    });

  3. #3
    Ext User
    Join Date
    Jun 2009
    Posts
    2
    Vote Rating
    0
    jsonx is on a distinguished road

      0  

    Default


    Thanks Animal. I think such methods should be added to the Ext Core.

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

      0  

    Default


    Maybe. But there are several dozen ways to skin any cat. eg:

    Code:
    Ext.onReady(function(){
            Ext.select("table").on("click", function(e,t){
                e.stopEvent();
                Ext.get(t).up('tr').first();
            });
        });

Thread Participants: 1

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