function expandCollapse(stElement, isGrid){
    var firstClass = 'x-treelist-item-collapsed';
    var secondClass = 'x-treelist-item-expanded';
    if(isGrid){
        firstClass = 'x-collapsed';
        secondClass = 'x-expanded';
    }
    stElement.and(function(el){
        //scroll
        Lib.scrollToElement('#' + el.dom.id, 'container');
        var classes = el.dom.className;
        if(classes.indexOf('x-treelist-item-expanded') > 0){
            firstClass = secondClass;
            secondClass = 'x-treelist-item-collapsed';
        }
        else if(isGrid && classes.indexOf('x-expanded') > 0){
            firstClass = secondClass;
            secondClass = 'x-collapsed';
        }
        expect(classes).toContain(firstClass);
    });
    if(isGrid){
        stElement.down('>> .x-expander-el')
            .click();
    }
    else{
        stElement.down('>> .x-treelist-item-expander').click();
    }
    stElement.and(function(el){
        expect(el.dom.className).toContain(secondClass);
    });
}
/**
 * help function for expanding / collapsing items
 */
help function for expanding / collapsing items
help function for expanding / collapsing items
function expandCollapse(stElement, isGrid){
    var firstClass = 'x-treelist-item-collapsed';
    var secondClass = 'x-treelist-item-expanded';
    if(isGrid){
        firstClass = 'x-collapsed';
        secondClass = 'x-expanded';
    }
    stElement.and(function(el){
        Lib.scrollToElement('#' + el.dom.id, 'container');
        var classes = el.dom.className;
        if(classes.indexOf('x-treelist-item-expanded') > 0){
            firstClass = secondClass;
            secondClass = 'x-treelist-item-collapsed';
        }
        else if(isGrid && classes.indexOf('x-expanded') > 0){
            firstClass = secondClass;
            secondClass = 'x-collapsed';
        }
        expect(classes).toContain(firstClass);
    });
    if(isGrid){
        stElement.down('>> .x-expander-el')
            .click();
    }
    else{
        stElement.down('>> .x-treelist-item-expander').click();
    }
    stElement.and(function(el){
        expect(el.dom.className).toContain(secondClass);
    });
}
function expandCollapse ( stElement , isGrid ) { var firstClass = 'x-treelist-item-collapsed' ; var secondClass = 'x-treelist-item-expanded' ; if ( isGrid ) { firstClass = 'x-collapsed' ; secondClass = 'x-expanded' ; } stElement . and ( function ( el ) { Lib . scrollToElement ( '#' + el . dom . id , 'container' ) ; var classes = el . dom . className ; if ( classes . indexOf ( 'x-treelist-item-expanded' ) > 0 ) { firstClass = secondClass ; secondClass = 'x-treelist-item-collapsed' ; } else if ( isGrid && classes . indexOf ( 'x-expanded' ) > 0 ) { firstClass = secondClass ; secondClass = 'x-collapsed' ; } expect ( classes ) . toContain ( firstClass ) ; } ) ; if ( isGrid ) { stElement . down ( '>> .x-expander-el' ) . click ( ) ; } else { stElement . down ( '>> .x-treelist-item-expander' ) . click ( ) ; } stElement . and ( function ( el ) { expect ( el . dom . className ) . toContain ( secondClass ) ; } ) ; }
help function for expanding / collapsing items
help function for expanding / collapsing items
//scroll