nl_tokens: / * ==================================================== - gets search strings from this . SearchFlt array - retrieves data from each td in every single tr and compares to search string for current column - tr is hidden if all search strings are not found =====================================================
pl_tokens: function Filter ( e ) { if ( typeof document === 'undefined' ) return ; var id = e . target . getAttribute ( "id" ) . split ( "_" ) [ 1 ] ; var SearchFlt = getFilters ( id ) ; var t = document . getElementById ( id ) ; var SearchArgs = [ ] ; var ncells = getCellsNb ( id ) ; for ( var i in SearchFlt ) { SearchArgs . push ( document . getElementById ( SearchFlt [ i ] ) . value . toLowerCase ( ) ) ; } var start_row = getStartRow ( id ) ; var row = t . getElementsByTagName ( "tr" ) ; for ( var k = start_row ; k < row . <mask> ; k ++ ) { /*** if table already filtered some rows are not visible ***/ if ( row [ k ] . style . display === "none" ) row [ k ] . style . display = "" ; var cell = getChildElms ( row [ k ] ) . childNodes ; var nchilds = cell . length ; var isRowValid = true ; if ( nchilds === ncells ) { // checks if row has exact cell # var cell_value = [ ] ; var occurence = [ ] ; for ( var j = 0 ; j < nchilds ; j ++ ) // this loop retrieves cell data { var cell_data = getCellText ( cell [ j ] ) ; cell_value . push ( cell_data ) ; if ( SearchArgs [ j ] !== "" ) { occurence [ j ] = cell_data . split ( SearchArgs [ j ] ) . length ; } } //for j for ( var _t = 0 ; _t < ncells ; _t ++ ) { if ( SearchArgs [ _t ] !== "" && occurence [ _t ] < 2 ) { isRowValid = false ; } } //for t } //if if ( isRowValid === false ) row [ k ] . style . display = "none" ; else row [ k ] . style . display = "" ; } // for k }