Threaded View

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Answers
    1
    Vote Rating
    0
    baquila is on a distinguished road

      0  

    Default Answered: referencing child element of list item

    Answered: referencing child element of list item


    Ok, I'm sick that I have to ask this but I can't waste anymore time on it. I have a simple list with an 'itemtap' listener. Within each list item I have a hidden div element that I want to show when the list item is clicked. Baby stuff. But I can't figure out how to reference the element within the list item....

    The itemtap function is simply:

    Code:
    function(list, index, element, event) {
            .....do stuff here
    }
    So if each list item is:

    Code:
    <li>
        <h3>Tom Hanks</h3>
        <div class="hiddenDiv">you can't see this</div>
    </li>
    What is the proper way to access that div.hiddenDiv within the itemtap function and show it? I tried things like:

    Ext.DomQuery.select('element.hiddenDiv').show()
    Ext.DomQuery.select('element>.hiddenDiv').show()

    ...and about a million other things. Sorry for such a dumb question, but I'm just sick of wasting time on this. Thanks so much!

  2. Got it! Good grief!!!!

    element.down('.hiddenDiv').setStyle({'display':'block'});

    I'm not even going to ask how to determine if it's visible and then hide it again. Where's jQuery's toggle() when you need it???

Thread Participants: 1

Tags for this Thread