Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Section Click Function - Show/Collapse a Section

RusFM
Contributor III

Archer Community,

If anyone needs a function to show or collapse a section, e.g. simulate a click, here's a function to do it.

Pass the section name as the parameter.  Written in Archer version 6.9. SP2.

function sectionClick( sectionName ) {

    // find the spans with the section label text
    $('.SectionLabel.sectionLabelWithInfo').each( function() {
    
        // console.log( 'sectionClick: checking section = ' + $(this).text() );

        // is this the one we're looking for?
        if( $(this).text() == sectionName ) {
        
            // console.log( 'sectionClick: found it' );

            // yes, walk up the dom, click the enclosing row, and break the each loop
            $(this).parents('tr')[0].click();
            return false;
        
        }
    
    } );

}

 

Rus

 

1 REPLY 1

Ilya_Khen
Champion III