diff -r 87cfa131b535 -r e7e0ae78773e configurationengine/source/scripts/tablefilter.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configurationengine/source/scripts/tablefilter.js Tue Aug 10 14:29:28 2010 +0300 @@ -0,0 +1,4843 @@ +/*------------------------------------------------------------------------ + - HTML Table Filter Generator v1.9.6 + - By Max Guglielmi (tablefilter.free.fr) + - Licensed under the MIT License +-------------------------------------------------------------------------- +Copyright (c) 2009 Max Guglielmi + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------- + - Special credit to: + Cedric Wartel, cnx.claude@free.fr, Florent Hirchy, Váry Péter, + Anthony Maes, Nuovella Williams, Fuggerbit, Venkata Seshagiri Rao + Raya for active contribution and inspiration +------------------------------------------------------------------------*/ + +function setFilterGrid(id) +/*==================================================== + - Sets filters grid bar + - Calls TF Constructor and generates grid bar + - Params: + - id: table id (string) + - refRow (optional): row index (number) + - config (optional): configuration + object (literal object) +=====================================================*/ +{ + if( arguments.length==0 ) return; + eval( 'tf_'+id+' = new TF(arguments[0],arguments[1],arguments[2])' ); + eval( 'tf_'+id+'.AddGrid();' ); +} + +/*===BEGIN removable section=========================== + - Unobtrusive grid bar generation using + 'filterable' class + - If you don't use it you can remove safely this + section +/*=====================================================*/ +tf_addEvent(window, 'load', initFilterGrid); + +function initFilterGrid() +{ + if (!document.getElementsByTagName) return; + var tbls = tf_Tag(document,'table'), config; + for (var i=0; i1) + { + for(var i=0; i1 ? 1 : f.filters_row_index : 0; + this.fltCellTag = f!=undefined && f.filters_cell_tag!=undefined //defines tag of the cells containing filters (td/th) + ? (f.filters_cell_tag!='th' ? 'td' : 'th') : 'td'; + this.fltIds = []; //stores filters ids + this.searchArgs = null; //stores filters values + this.tblData = []; //stores table data + this.validRowsIndex = null; //stores valid rows indexes (rows visible upon filtering) + this.fltGridEl = null; //stores filters row element + this.isFirstLoad = true; //is first load boolean + this.infDiv = null; //container div for paging elements, reset btn etc. + this.lDiv = null; //div for rows counter + this.rDiv = null; //div for reset button and results per page select + this.mDiv = null; //div for paging elements + this.contDiv = null; //table container div for fixed headers (IE only) + this.infDivCssClass = f!=undefined && f.inf_div_css_class!=undefined //defines css class for div containing + ? f.inf_div_css_class : 'inf'; //paging elements, rows counter etc. + this.lDivCssClass = f!=undefined && f.left_div_css_class!=undefined //defines css class for left div + ? f.left_div_css_class : 'ldiv'; + this.rDivCssClass = f!=undefined && f.right_div_css_class!=undefined //defines css class for right div + ? f.right_div_css_class : 'rdiv'; + this.mDivCssClass = f!=undefined && f.middle_div_css_class!=undefined //defines css class for mid div + ? f.middle_div_css_class : 'mdiv'; + this.contDivCssClass = f!=undefined && f.content_div_css_class!=undefined + ? f.content_div_css_class : 'cont'; //table container div css class + + /*** filters' grid appearance ***/ + this.fltsRowCssClass = f!=undefined && f.flts_row_css_class!=undefined //defines css class for filters row + ? f.flts_row_css_class : 'fltrow'; + this.alternateBgs = f!=undefined && f.alternate_rows ? true : false; //enables/disbles rows alternating bg colors + this.hasColWidth = f!=undefined && f.col_width ? true : false; //defines widths of columns + this.colWidth = f!=undefined && this.hasColWidth ? f.col_width : null; + this.fixedHeaders = f!=undefined && f.fixed_headers ? true : false; //enables/disables fixed headers + this.tBodyH = f!=undefined && f.tbody_height ? f.tbody_height : 200; //tbody height if fixed headers enabled + this.fltCssClass = f!=undefined && f.flt_css_class!=undefined //defines css class for filters + ? f.flt_css_class : 'flt'; + this.fltMultiCssClass = f!=undefined && f.flt_multi_css_class!=undefined //defines css class for multiple selects filters + ? f.flt_multi_css_class : 'flt_multi'; + this.fltSmallCssClass = f!=undefined && f.flt_small_css_class!=undefined //defines css class for filters + ? f.flt_small_css_class : 'flt_s'; + this.singleFltCssClass = f!=undefined && f.single_flt_css_class!=undefined //defines css class for single-filter + ? f.single_flt_css_class : 'single_flt'; + this.isStartBgAlternate = true; + this.rowBgEvenCssClass = f!=undefined && f.even_row_css_class!=undefined //defines css class for even rows + ? f.even_row_css_class :'even'; + this.rowBgOddCssClass = f!=undefined && f.odd_row_css_class!=undefined //defines css class for odd rows + ? f.odd_row_css_class :'odd'; + + /*** filters' grid behaviours ***/ + this.enterKey = f!=undefined && f.enter_key==false ? false : true; //enables/disables enter key + this.isModFilterFn = f!=undefined && f.mod_filter_fn ? true : false; //enables/disables alternative fn call + this.modFilterFn = this.isModFilterFn ? f.mod_filter_fn : null;// used by tf_DetectKey fn + this.onBeforeFilter = f!=undefined && tf_isFn(f.on_before_filter) //calls function before filtering starts + ? f.on_before_filter : null; + this.onAfterFilter = f!=undefined && tf_isFn(f.on_after_filter) //calls function after filtering + ? f.on_after_filter : null; + this.matchCase = f!=undefined && f.match_case ? true : false; //enables/disables case sensitivity + this.exactMatch = f!=undefined && f.exact_match ? true : false; //enables/disbles exact match for search + this.refreshFilters = f!=undefined && f.refresh_filters ? true : false; //refreshes drop-down lists upon validation + this.activeFlt = null; //stores active filter element + this.activeFilterId = null; //id of active filter + this.hasColOperation = f!=undefined && f.col_operation ? true : false; //enables/disbles column operation(sum,mean) + this.colOperation = null; + this.hasVisibleRows = f!=undefined && f.rows_always_visible ? true : false; //enables always visible rows + this.visibleRows = this.hasVisibleRows ? f.rows_always_visible : [];//array containing always visible rows + this.searchType = f!=undefined && f.search_type!=undefined //defines search type: include or exclude + ? f.search_type : 'include'; + this.isExternalFlt = f!=undefined && f.external_flt_grid ? true : false; //enables/disables external filters generation + this.externalFltTgtIds = f!=undefined && f.external_flt_grid_ids!=undefined //array containing ids of external elements containing filters + ? f.external_flt_grid_ids : null; + this.externalFltEls = []; //stores filters elements if isExternalFlt is true + this.execDelay = f!=undefined && f.exec_delay ? parseInt(f.exec_delay) : 100; //delays filtering process if loader true + this.status = f!=undefined && f.status ? true : false; //enables/disables status messages + this.onFiltersLoaded = f!=undefined && tf_isFn(f.on_filters_loaded) //calls function when filters grid loaded + ? f.on_filters_loaded : null; + this.singleSearchFlt = f!=undefined && f.single_search_filter ? true : false; //enables/disables single filter search + this.onRowValidated = f!=undefined && tf_isFn(f.on_row_validated) //calls function after row is validated + ? f.on_row_validated : null; + this.customCellDataCols = f!=undefined && f.custom_cell_data_cols ? f.custom_cell_data_cols : []; //array defining columns for customCellData event + this.customCellData = f!=undefined && tf_isFn(f.custom_cell_data) //calls custom function for retrieving cell data + ? f.custom_cell_data : null; + + /*** selects customisation and behaviours ***/ + this.displayAllText = f!=undefined && f.display_all_text!=undefined ? f.display_all_text : ''; //defines 1st option text + this.onSlcChange = f!=undefined && f.on_change==false ? false : true; //enables/disables onChange event on combo-box + this.sortSlc = f!=undefined && f.sort_select==false ? false : true; //enables/disables select options sorting + this.isSortNumAsc = f!=undefined && f.sort_num_asc ? true : false; //enables/disables ascending numeric options sorting + this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : null; + this.isSortNumDesc = f!=undefined && f.sort_num_desc ? true : false; //enables/disables descending numeric options sorting + this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : null; + this.slcFillingMethod = f!=undefined && f.slc_filling_method!=undefined //sets select filling method: 'innerHTML' or + ? f.slc_filling_method : 'createElement'; //'createElement' + this.fillSlcOnDemand = f!=undefined && f.fill_slc_on_demand ? true : false; //enabled selects are populated on demand + this.activateSlcTooltip = f!=undefined && f.activate_slc_tooltip!=undefined //IE only, tooltip text appearing on select + ? f.activate_slc_tooltip : 'Click to activate'; // before it is populated + this.multipleSlcTooltip = f!=undefined && f.multiple_slc_tooltip!=undefined //tooltip text appearing on multiple select + ? f.multiple_slc_tooltip : 'Use Ctrl key for multiple selections'; + this.hasCustomSlcOptions = f!=undefined && f.custom_slc_options && + (typeof f.custom_slc_options).tf_LCase() == 'object' + ? true : false; + this.customSlcOptions = f!=undefined && f.custom_slc_options!=undefined + ? f.custom_slc_options : null; + this.onBeforeOperation = f!=undefined && tf_isFn(f.on_before_operation) //calls function before col operation + ? f.on_before_operation : null; + this.onAfterOperation = f!=undefined && tf_isFn(f.on_after_operation) //calls function after col operation + ? f.on_after_operation : null; + + /*** checklist customisation and behaviours ***/ + this.checkListDiv = []; //checklist container div + this.checkListDivCssClass = f!=undefined && f.div_checklist_css_class!=undefined + ? f.div_checklist_css_class : 'div_checklist'; //defines css class for div containing checklist filter + this.checkListCssClass = f!=undefined && f.checklist_css_class!=undefined //defines css class for checklist filters + ? f.checklist_css_class : 'flt_checklist'; + this.checkListItemCssClass = f!=undefined && f.checklist_item_css_class!=undefined //defines css class for checklist item (li) + ? f.checklist_item_css_class : 'flt_checklist_item'; + this.checkListSlcItemCssClass = f!=undefined && f.checklist_selected_item_css_class!=undefined //defines css class for selected checklist item (li) + ? f.checklist_selected_item_css_class : 'flt_checklist_slc_item'; + this.activateCheckListTxt = f!=undefined && f.activate_checklist_text!=undefined //Load on demand text + ? f.activate_checklist_text : 'Click to load data'; + + /*** Filter operators ***/ + this.orOperator = f!=undefined && f.or_operator!=undefined ? f.or_operator : '||'; + this.anOperator = f!=undefined && f.and_operator!=undefined ? f.and_operator : '&&'; + this.grOperator = f!=undefined && f.greater_operator!=undefined ? f.greater_operator : '>'; + this.lwOperator = f!=undefined && f.lower_operator!=undefined ? f.lower_operator : '<'; + this.leOperator = f!=undefined && f.lower_equal_operator!=undefined ? f.lower_equal_operator : '<='; + this.geOperator = f!=undefined && f.greater_equal_operator!=undefined ? f.greater_equal_operator : '>='; + this.dfOperator = f!=undefined && f.different_operator!=undefined ? f.different_operator : '!'; + this.lkOperator = f!=undefined && f.like_operator!=undefined ? f.like_operator : '*'; + this.eqOperator = f!=undefined && f.equal_operator!=undefined ? f.equal_operator : '='; + this.stOperator = f!=undefined && f.start_with_operator!=undefined ? f.start_with_operator : '{'; + this.enOperator = f!=undefined && f.end_with_operator!=undefined ? f.end_with_operator : '}'; + this.curExp = f!=undefined && f.cur_exp!=undefined ? f.cur_exp : '^[¥£€$]'; + this.separator = f!=undefined && f.separator!=undefined ? f.separator : ','; + + /*** rows counter ***/ + this.rowsCounter = f!=undefined && f.rows_counter ? true : false; //show/hides rows counter + this.rowsCounterTgtId = f!=undefined && f.rows_counter_target_id!=undefined //id of custom container element + ? f.rows_counter_target_id : null; + this.rowsCounterDiv = null; //element containing tot nb rows + this.rowsCounterSpan = null; //element containing tot nb rows label + this.rowsCounterText = f!=undefined && f.rows_counter_text!=undefined + ? f.rows_counter_text : 'Rows: '; //defines rows counter text + this.totRowsCssClass = f!=undefined && f.tot_rows_css_class!=undefined //defines css class rows counter + ? f.tot_rows_css_class : 'tot'; + + /*** status bar ***/ + this.statusBar = f!=undefined && f.status_bar ? true : false; //show/hides status bar + this.statusBarTgtId = f!=undefined && f.status_bar_target_id!=undefined //id of custom container element + ? f.status_bar_target_id : null; + this.statusBarDiv = null; //element containing status bar label + this.statusBarSpan = null; //status bar + this.statusBarSpanText = null; //status bar label + this.statusBarText = f!=undefined && f.status_bar_text!=undefined + ? f.status_bar_text : ''; //defines status bar text + this.statusBarCssClass = f!=undefined && f.status_bar_css_class!=undefined //defines css class status bar + ? f.status_bar_css_class : 'status'; + this.statusBarCloseDelay = 250; //delay for status bar clearing + + /*** loader ***/ + this.loader = f!=undefined && f.loader ? true : false; //enables/disables loader + this.loaderTgtId = f!=undefined && f.loader_target_id!=undefined //id of container element + ? f.loader_target_id : null; + this.loaderDiv = null; //div containing loader + this.loaderText = f!=undefined && f.loader_text!=undefined ? f.loader_text : 'Loading...'; //defines loader text + this.loaderHtml = f!=undefined && f.loader_html!=undefined ? f.loader_html : null; //defines loader innerHtml + this.loaderCssClass = f!=undefined && f.loader_css_class!=undefined //defines css class for loader div + ? f.loader_css_class : 'loader'; + this.loaderCloseDelay = 200; //delay for hiding loader + this.onShowLoader = f!=undefined && tf_isFn(f.on_show_loader) //calls function before loader is displayed + ? f.on_show_loader : null; + this.onHideLoader = f!=undefined && tf_isFn(f.on_hide_loader) //calls function after loader is closed + ? f.on_hide_loader : null; + + /*** validation - reset buttons/links ***/ + this.displayBtn = f!=undefined && f.btn ? true : false; //show/hides filter's validation button + this.btnText = f!=undefined && f.btn_text!=undefined ? f.btn_text : 'go'; //defines validation button text + this.btnCssClass = f!=undefined && f.btn_css_class!=undefined //defines css class for validation button + ? f.btn_css_class : 'btnflt'; + this.btnReset = f!=undefined && f.btn_reset ? true : false; //show/hides reset link + this.btnResetTgtId = f!=undefined && f.btn_reset_target_id!=undefined //id of container element + ? f.btn_reset_target_id : null; + this.btnResetEl = null; //reset button element + this.btnResetText = f!=undefined && f.btn_reset_text!=undefined ? f.btn_reset_text : 'Reset'; //defines reset text + this.btnResetHtml = f!=undefined && f.btn_reset_html!=undefined ? f.btn_reset_html : null; //defines reset button innerHtml + this.btnResetCssClass = f!=undefined && f.btn_reset_css_class!=undefined //defines css class for reset button + ? f.btn_reset_css_class :'reset'; + + /*** paging ***/ + this.paging = f!=undefined && f.paging ? true : false; //enables/disables table paging + this.pagingTgtId = f!=undefined && f.paging_target_id!=undefined //id of container element + ? f.paging_target_id : null; + this.pagingLength = f!=undefined && f.paging_length!=undefined ? f.paging_length : 10; //defines table paging length + this.hasResultsPerPage = f!=undefined && f.results_per_page ? true : false; //enables/disables results per page drop-down + this.resultsPerPageTgtId = f!=undefined && f.results_per_page_target_id!=undefined //id of container element + ? f.results_per_page_target_id : null; + this.resultsPerPage = null; //stores results per page text and values + this.pagingSlc = null; //stores paging select element + this.isPagingRemoved = false; //indicates if paging elements were previously removed + this.pgSlcCssClass = f!=undefined && f.paging_slc_css_class!=undefined + ? f.paging_slc_css_class :'pgSlc'; //css class for paging select element + this.pgInpCssClass = f!=undefined && f.paging_inp_css_class!=undefined + ? f.paging_inp_css_class :'pgNbInp'; //css class for paging input element + this.resultsPerPageSlc = null; //results per page select element + this.resultsSlcCssClass = f!=undefined && f.results_slc_css_class!=undefined + ? f.results_slc_css_class :'rspg'; //defines css class for results per page select + this.resultsSpanCssClass = f!=undefined && f.results_span_css_class!=undefined + ? f.results_span_css_class :'rspgSpan'; //css class for label preceding results per page select + this.nbVisibleRows = 0; //nb visible rows + this.nbHiddenRows = 0; //nb hidden rows + this.startPagingRow = 0; //1st row index of current page + this.nbPages = 0; //total nb of pages + this.currentPageNb = 1; //current page nb + this.btnNextPageText = f!=undefined && f.btn_next_page_text!=undefined + ? f.btn_next_page_text : '>'; //defines next page button text + this.btnPrevPageText = f!=undefined && f.btn_prev_page_text!=undefined + ? f.btn_prev_page_text : '<'; //defines previous page button text + this.btnLastPageText = f!=undefined && f.btn_last_page_text!=undefined + ? f.btn_last_page_text : '>|'; //defines last page button text + this.btnFirstPageText = f!=undefined && f.btn_first_page_text!=undefined + ? f.btn_first_page_text : '|<' ; //defines first page button text + this.btnNextPageHtml = f!=undefined && f.btn_next_page_html!=undefined + ? f.btn_next_page_html : null; //defines next page button html + this.btnPrevPageHtml = f!=undefined && f.btn_prev_page_html!=undefined + ? f.btn_prev_page_html : null; //defines previous page button html + this.btnFirstPageHtml = f!=undefined && f.btn_first_page_html!=undefined + ? f.btn_first_page_html : null; //defines last page button html + this.btnLastPageHtml = f!=undefined && f.btn_last_page_html!=undefined + ? f.btn_last_page_html : null; //defines previous page button html + this.btnPageCssClass = f!=undefined && f.paging_btn_css_class!=undefined + ? f.paging_btn_css_class :'pgInp'; //css class for paging buttons (previous,next,etc.) + this.nbPgSpanCssClass = f!=undefined && f.nb_pages_css_class!=undefined + ? f.nb_pages_css_class :'nbpg'; //css class for span containing tot nb of pages + this.hasPagingBtns = f!=undefined && f.paging_btns==false ? false : true; //enables/disables paging buttons + this.pagingBtnEvents = null; //stores paging buttons events + this.pageSelectorType = f!=undefined && f.page_selector_type!=undefined + ? f.page_selector_type : this.fltTypeSlc; //defines previous page button html + + /*** webfx sort adapter ***/ + this.sort = f!=undefined && f.sort ? true : false; //enables/disables default table sorting + this.isSortEnabled = false; //indicates if sort is set (used in tfAdapter.sortabletable.js) + this.sorted = false; //indicates if tables was sorted + this.sortConfig = f!=undefined && f.sort_config!=undefined + ? f.sort_config : {}; + this.sortConfig.name = f!=undefined && f.sort_config!=undefined && f.sort_config.name + ? f.sort_config.name : 'sortabletable'; + this.sortConfig.src = f!=undefined && f.sort_config!=undefined && f.sort_config.src + ? f.sort_config.src : 'sortabletable.js'; + this.sortConfig.adapterSrc =f!=undefined && f.sort_config!=undefined && f.sort_config.adapter_src + ? f.sort_config.adapter_src : 'tfAdapter.sortabletable.js'; + this.sortConfig.initialize =f!=undefined && f.sort_config!=undefined && f.sort_config.initialize + ? f.sort_config.initialize + : function(o){ if(o.SetSortTable) o.SetSortTable(); }; + this.sortConfig.sortTypes = f!=undefined && f.sort_config!=undefined && f.sort_config.sort_types + ? f.sort_config.sort_types : []; + this.sortConfig.sortCol = f!=undefined && f.sort_config!=undefined && f.sort_config.sort_col!=undefined + ? f.sort_config.sort_col : null; + this.sortConfig.asyncSort = f!=undefined && f.sort_config!=undefined && f.sort_config.async_sort + ? true : false; + this.sortConfig.triggerIds =f!=undefined && f.sort_config!=undefined && f.sort_config.sort_trigger_ids + ? f.sort_config.sort_trigger_ids : []; + + /*** onkeyup event ***/ + this.onKeyUp = f!=undefined && f.on_keyup ? true : false; //enables/disables onkeyup event, table is filtered when user stops typing + this.onKeyUpDelay = f!=undefined && f.on_keyup_delay!=undefined ? f.on_keyup_delay : 900; //onkeyup delay timer (msecs) + this.isUserTyping = null; //typing indicator + this.onKeyUpTimer = undefined; + + /*** keyword highlighting ***/ + this.highlightKeywords = f!=undefined && f.highlight_keywords ? true : false; //enables/disables keyword highlighting + this.highlightCssClass = f!=undefined && f.highlight_css_class!=undefined //defines css class for highlighting + ? f.highlight_css_class : 'keyword'; + + /*** data types ***/ + this.defaultDateType = f!=undefined && f.default_date_type!=undefined //defines default date type (european DMY) + ? f.default_date_type : 'DMY'; + this.thousandsSeparator = f!=undefined && f.thousands_separator!=undefined //defines default thousands separator + ? f.thousands_separator : ','; //US = ',' EU = '.' + this.decimalSeparator = f!=undefined && f.decimal_separator!=undefined //defines default decimal separator + ? f.decimal_separator : '.'; //US & javascript = '.' EU = ',' + this.hasColNbFormat = f!=undefined && f.col_number_format ? true : false; //enables number format per column + this.colNbFormat = f!=undefined && this.hasColNbFormat ? f.col_number_format : null; //array containing columns nb formats + this.hasColDateType = f!=undefined && f.col_date_type ? true : false; //enables date type per column + this.colDateType = f!=undefined && this.hasColDateType ? f.col_date_type : null; //array containing columns date type + + /*** status messages ***/ + this.msgFilter = f!=undefined && f.msg_filter!=undefined //filtering + ? f.msg_filter : 'Filtering data...'; + this.msgPopulate = f!=undefined && f.msg_populate!=undefined //populating drop-downs + ? f.msg_populate : 'Populating filter...'; + this.msgPopulateCheckList = f!=undefined && f.msg_populate_checklist!=undefined //populating drop-downs + ? f.msg_populate_checklist : 'Populating list...'; + this.msgChangePage = f!=undefined && f.msg_change_page!=undefined //changing paging page + ? f.msg_change_page : 'Collecting paging data...'; + this.msgClear = f!=undefined && f.msg_clear!=undefined //clearing filters + ? f.msg_clear : 'Clearing filters...'; + this.msgChangeResults = f!=undefined && f.msg_change_results!=undefined //changing nb results/page + ? f.msg_change_results : 'Changing results per page...'; + this.msgResetValues = f!=undefined && f.msg_reset_grid_values!=undefined //re-setting grid values + ? f.msg_reset_grid_values : 'Re-setting filters values...'; + this.msgResetPage = f!=undefined && f.msg_reset_page!=undefined //re-setting page + ? f.msg_reset_page : 'Re-setting page...'; + this.msgResetPageLength = f!=undefined && f.msg_reset_page_length!=undefined //re-setting page length + ? f.msg_reset_page_length : 'Re-setting page length...'; + this.msgSort = f!=undefined && f.msg_sort!=undefined //table sorting + ? f.msg_sort : 'Sorting data...'; + this.msgLoadExtensions = f!=undefined && f.msg_load_extensions!=undefined //table sorting + ? f.msg_load_extensions : 'Loading extensions...'; + + /*** ids prefixes ***/ + this.prfxFlt = 'flt'; //filters (inputs - selects) + this.prfxValButton = 'btn'; //validation button + this.prfxInfDiv = 'inf_'; //container div for paging elements, rows counter etc. + this.prfxLDiv = 'ldiv_'; //left div + this.prfxRDiv = 'rdiv_'; //right div + this.prfxMDiv = 'mdiv_'; //middle div + this.prfxContentDiv = 'cont_'; //table container if fixed headers enabled + this.prfxCheckListDiv = 'chkdiv_'; //checklist filter container div + this.prfxSlcPages = 'slcPages_'; //pages select + this.prfxSlcResults = 'slcResults_'; //results per page select + this.prfxSlcResultsTxt = 'slcResultsTxt_'; //label preciding results per page select + this.prfxBtnNextSpan = 'btnNextSpan_'; //span containing next page button + this.prfxBtnPrevSpan = 'btnPrevSpan_'; //span containing previous page button + this.prfxBtnLastSpan = 'btnLastSpan_'; //span containing last page button + this.prfxBtnFirstSpan = 'btnFirstSpan_'; //span containing first page button + this.prfxBtnNext = 'btnNext_'; //next button + this.prfxBtnPrev = 'btnPrev_'; //previous button + this.prfxBtnLast = 'btnLast_'; //last button + this.prfxBtnFirst = 'btnFirst_'; //first button + this.prfxPgSpan = 'pgspan_'; //span for tot nb pages + this.prfxPgBeforeSpan = 'pgbeforespan_'; //span preceding pages select (contains 'Page') + this.prfxPgAfterSpan = 'pgafterspan_'; //span following pages select (contains ' of ') + this.prfxCounter = 'counter_'; //rows counter div + this.prfxTotRows = 'totrows_span_'; //nb displayed rows label + this.prfxTotRowsTxt = 'totRowsTextSpan_'; //label preceding nb rows label + this.prfxResetSpan = 'resetspan_'; //span containing reset button + this.prfxLoader = 'load_'; //loader div + this.prfxStatus = 'status_'; //status bar div + this.prfxStatusSpan = 'statusSpan_'; //status bar label + this.prfxStatusTxt = 'statusText_';//text preceding status bar label + this.prfxCookieFltsValues = 'tf_flts_'; //filter values cookie + this.prfxCookiePageNb = 'tf_pgnb_'; //page nb cookie + this.prfxCookiePageLen = 'tf_pglen_'; //page length cookie + this.prfxMainTblCont = 'gridCont_'; //div containing grid elements if grid_layout true + this.prfxTblCont = 'tblCont_'; //div containing table if grid_layout true + this.prfxHeadTblCont = 'tblHeadCont_'; //div containing headers table if grid_layout true + this.prfxHeadTbl = 'tblHead_'; //headers' table if grid_layout true + this.prfxGridFltTd = '_td_'; //id of td containing the filter if grid_layout true + this.prfxGridTh = 'tblHeadTh_'; //id of th containing column header if grid_layout true + + /*** cookies ***/ + this.hasStoredValues = false; + this.rememberGridValues = f!=undefined && f.remember_grid_values ? true : false; //remembers filters values on page load + this.fltsValuesCookie = this.prfxCookieFltsValues + this.id; //cookie storing filter values + this.rememberPageNb = this.paging && f!=undefined && f.remember_page_number + ? true : false; //remembers page nb on page load + this.pgNbCookie = this.prfxCookiePageNb + this.id; //cookie storing page nb + this.rememberPageLen = this.paging && f!=undefined && f.remember_page_length + ? true : false; //remembers page length on page load + this.pgLenCookie = this.prfxCookiePageLen + this.id; //cookie storing page length + this.cookieDuration = f!=undefined && f.set_cookie_duration + ? parseInt(f.set_cookie_duration) :100000; //cookie duration + + /*** extensions ***/ + this.hasExtensions = f!=undefined && f.extensions ? true : false; //imports external script + this.extensions = (this.hasExtensions) ? f.extensions : null; + + /***(deprecated: backward compatibility) ***/ + this.hasBindScript = f!=undefined && f.bind_script ? true : false; //imports external script + this.bindScript = (this.hasBindScript) ? f.bind_script : null; + + /*** TF events ***/ + var o = this; + this.Evt = { + name: { + filter: 'Filter', + populateselect: 'Populate', + populatechecklist: 'PopulateCheckList', + changepage: 'ChangePage', + clear: 'Clear', + changeresultsperpage: 'ChangeResults', + resetvalues: 'ResetValues', + resetpage: 'ResetPage', + resetpagelength: 'ResetPageLength', + sort: 'Sort', + loadextensions: 'LoadExtensions' + }, + _DetectKey: function(e) + /*==================================================== + - common fn that detects return key for a given + element (onkeypress for inputs) + =====================================================*/ + { + if(!o.enterKey) return; + var evt=(e)?e:(window.event)?window.event:null; + if(evt) + { + var key=(evt.charCode)?evt.charCode: + ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0)); + if(key=='13') + { + o.Filter(); + } else { + o.isUserTyping = true; + window.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + } + }//if evt + }, + _OnKeyUp: function(e) + /*==================================================== + - onkeyup event for text filters + (onKeyUp property) + =====================================================*/ + { + if(!o.onKeyUp) return; + var evt=(e)?e:(window.event)?window.event:null; + var key=(evt.charCode)?evt.charCode: + ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0)); + o.isUserTyping = false; + + if( key!=13 && key!=9 && key!=27 && key!=38 && key!=40 ) + { + function filter() + { + window.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + if( !o.isUserTyping ) + { + o.Filter(); + o.isUserTyping = null; + } + } + if(o.onKeyUpTimer==undefined) + o.onKeyUpTimer = window.setInterval( filter, o.onKeyUpDelay ); + } else { + window.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + } + }, + _OnKeyDown: function(e) + /*==================================================== + - onkeydown event for input filters + (onKeyUp property) + =====================================================*/ + { + if(!o.onKeyUp) return; + o.isUserTyping = true; + }, + _OnInpBlur: function(e) + /*==================================================== + - onblur event for input filters (onKeyUp property) + =====================================================*/ + { + if(!o.onKeyUp) return; + o.isUserTyping = false; + window.clearInterval(o.onKeyUpTimer); + }, + _OnInpFocus: function() + /*==================================================== + - onfocus event for input filters + =====================================================*/ + { + o.activeFilterId=this.getAttribute('id'); + o.activeFlt = tf_Id(o.activeFilterId); + }, + _OnSlcFocus: function() + /*==================================================== + - onfocus event for select filters + =====================================================*/ + { + o.activeFilterId = this.getAttribute('id'); + o.activeFlt = tf_Id(o.activeFilterId); + if(o.fillSlcOnDemand && this.getAttribute('filled') == '0') + {// select is populated when element has focus + var ct = this.getAttribute('ct'); + o.PopulateSelect(ct); + if(!tf_isIE) this.setAttribute('filled','1'); + } + }, + _OnSlcChange: function() + /*==================================================== + - onchange event for select filters + =====================================================*/ + { + if(o.onSlcChange) o.Filter(); + }, + _OnSlcBlur: function() + /*==================================================== + - onblur event for select filters + =====================================================*/ + { + }, + _OnCheckListClick: function() + /*==================================================== + - onclick event for checklist filters + =====================================================*/ + { + if(o.fillSlcOnDemand && this.getAttribute('filled') == '0') + { + var ct = this.getAttribute('ct'); + o.PopulateCheckList(ct); + o.checkListDiv[ct].onclick = null; + o.checkListDiv[ct].title = ''; + } + }, + _OnCheckListFocus: function() + /*==================================================== + - onclick event for checklist filter container + =====================================================*/ + { + o.activeFilterId = this.firstChild.getAttribute('id'); + o.activeFlt = tf_Id(o.activeFilterId); + }, + _OnBtnClick: function() + /*==================================================== + - onclick event for validation button + (btn property) + =====================================================*/ + { + o.Filter(); + }, + _OnSlcPagesChange: function() + /*==================================================== + - onchange event for paging select + =====================================================*/ + { + if(o.Evt._Paging._OnSlcPagesChangeEvt) + o.Evt._Paging._OnSlcPagesChangeEvt(); + o.ChangePage(); + this.blur(); + //ie only: blur is not enough... + if(this.parentNode && tf_isIE) + this.parentNode.focus(); + }, + _OnSlcPagesChangeEvt: null, //used by sort adapter + _OnSlcResultsChange: function() + /*==================================================== + - onchange event for results per page select + =====================================================*/ + { + o.ChangeResultsPerPage(); + this.blur(); + //ie only: blur is not enough... + if(this.parentNode && tf_isIE) + this.parentNode.focus(); + }, + _Paging: {// paging buttons events + slcIndex: function(){ + return (o.pageSelectorType==o.fltTypeSlc) + ? o.pagingSlc.options.selectedIndex + : parseInt(o.pagingSlc.value)-1; + }, + nbOpts: function(){ + return (o.pageSelectorType==o.fltTypeSlc) + ? parseInt(o.pagingSlc.options.length)-1 + : (o.nbPages-1); + }, + next: function(){ + if(o.Evt._Paging.nextEvt) o.Evt._Paging.nextEvt(); + var nextIndex = (o.Evt._Paging.slcIndex()0 + ? o.Evt._Paging.slcIndex()-1 : o.Evt._Paging.nbOpts(); + o.ChangePage(prevIndex); + }, + prevEvt: null, //used by sort adapter + last: function(){ + if(o.Evt._Paging.lastEvt) o.Evt._Paging.lastEvt(); + o.ChangePage(o.Evt._Paging.nbOpts()); + }, + lastEvt: null, //used by sort adapter + first: function(){ + if(o.Evt._Paging.firstEvt) o.Evt._Paging.firstEvt(); + o.ChangePage(0); + }, + firstEvt: null, //used by sort adapter + _detectKey: function(e) + { + var evt=(e)?e:(window.event)?window.event:null; + if(evt) + { + var key=(evt.charCode)?evt.charCode: + ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0)); + if(key=='13'){ + if(o.sorted){ o.Filter(); o.ChangePage(o.Evt._Paging.slcIndex()); } + else o.ChangePage(); + this.blur(); + } + }//if evt + } + }, + _EnableSlc: function() + /*==================================================== + - onclick event slc parent node (enables filters) + IE only + =====================================================*/ + { + this.firstChild.disabled = false; + this.firstChild.focus(); + this.onclick = null; + }, + _Clear: function() + /*==================================================== + - clears filters + =====================================================*/ + { + o.ClearFilters(); + }, + _EnableSort: function() + /*==================================================== + - enables table sorting + =====================================================*/ + { + if(tf_isImported(o.sortConfig.adapterSrc)) + o.sortConfig.initialize.call(null,o); + else + o.IncludeFile( + o.sortConfig.name+'_adapter', + o.sortConfig.adapterSrc, + function(){ o.sortConfig.initialize.call(null,o); } + ); + } + }; + + /*** TF extensions ***/ + this.Ext = { + list: {}, + add: function(extName, extDesc, extPath, extCallBack) + { + var file = extPath.split('/')[extPath.split('/').length-1]; + var re = new RegExp(file); + var path = extPath.replace(re,''); + o.Ext.list[extName] = { + name: extName, + description: extDesc, + file: file, + path: path, + callback: extCallBack + }; + } + }; + + }//if tbl!=null +} + +TF.prototype = { + + AddGrid: function() + /*==================================================== + - adds row with filtering grid bar and sets grid + behaviours and layout + =====================================================*/ + { + if(this.hasGrid) return; + this.refRow = this.startRow==undefined ? 2 : (this.startRow+1); + if(this.gridLayout) this.refRow = this.startRow==undefined ? 0 : this.startRow; + this.headersRow = (this.filtersRowIndex==0) ? 1 : 0; + try{ this.nbCells = this.GetCellsNb(this.refRow) } + catch(e){ this.nbCells = this.GetCellsNb(0) } + + var f = this.fObj==undefined ? {} : this.fObj; + var n = (this.singleSearchFlt) ? 1 : this.nbCells, inpclass; + + if(this.gridLayout) + { + this.isExternalFlt = true; + this.SetGridLayout(); + //Once grid generated 1st filterable row is 0 again + this.refRow = (tf_isIE || tf_isIE7) ? (this.refRow+1) : 0; + } + + if(this.loader) this.SetLoader(); + + if(this.hasResultsPerPage) + { + this.resultsPerPage = f['results_per_page']!=undefined + ? f['results_per_page'] : this.resultsPerPage; + if(this.resultsPerPage.length<2) + this.hasResultsPerPage = false; + else + this.pagingLength = this.resultsPerPage[1][0]; + } + + if(!this.fltGrid) + {//filters grid is not genetared + this.refRow = (this.refRow-1); + if(this.gridLayout) this.refRow = 0; + this.nbFilterableRows = this.GetRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.nbFilterableRows; + } else { + if(this.isFirstLoad) + { + if(!this.gridLayout){ + var fltrow; + var thead = tf_Tag(this.tbl,'thead'); + if( thead.length>0 ) + fltrow = thead[0].insertRow(this.filtersRowIndex); + else + fltrow = this.tbl.insertRow(this.filtersRowIndex); + + if(this.fixedHeaders) this.SetFixedHeaders(); + + fltrow.className = this.fltsRowCssClass; + //Disable for grid_layout + if( this.isExternalFlt && !this.gridLayout ) fltrow.style.display = 'none'; + } + + this.nbFilterableRows = this.GetRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.tbl.rows.length; + + for(var i=0; i0 ) this.tbl.removeChild(thead[0]); + + //Headers table style + this.headTbl.style.width = this.tbl.style.width; + this.headTbl.style.tableLayout = 'fixed'; + this.tbl.style.tableLayout = 'fixed'; + this.headTbl.cellPadding = this.tbl.cellPadding; + this.headTbl.cellSpacing = this.tbl.cellSpacing; + + //Headers container width + this.headTblCont.style.width = this.tblCont.clientWidth+'px'; + + //content table without headers needs col widths to be reset + this.SetColWidths(); + + this.tbl.style.width = ''; + if(tf_isIE || tf_isIE7) this.headTbl.style.width = ''; + + //scroll synchronisation + var o = this; //TF object + this.tblCont.onscroll = function(){ + o.headTblCont.scrollLeft = this.scrollLeft; + var _o = this; //this = scroll element + //New pointerX calc taking into account scrollLeft + if(!o.isPointerXOverwritten){ + try{ + TF.Evt.pointerX = function(e) + { + e = e || window.event; + var scrollLeft = tf_StandardBody().scrollLeft + _o.scrollLeft; + return (e.pageX + _o.scrollLeft) || (e.clientX + scrollLeft); + } + o.isPointerXOverwritten = true; + } catch(ee) { + o.isPointerXOverwritten = false; + } + } + } + + /*** Default behaviours activation ***/ + var f = this.fObj==undefined ? {} : this.fObj; + + //Sort is enabled if not specified in config object + if(f.sort != false){ + this.sort = true; + this.sortConfig.asyncSort = true; + this.sortConfig.triggerIds = sortTriggers; + } + + if(this.gridEnableColResizer){ + if(!this.hasExtensions){ + this.extensions = { + name:['ColumnsResizer'], + src:['TFExt_ColsResizer/TFExt_ColsResizer.js'], + description:['Columns Resizing'], + initialize:[function(o){o.SetColsResizer('ColumnsResizer');}] + } + this.hasExtensions = true; + } else { + if(!this.__containsStr('colsresizer',this.extensions.src.toString().tf_LCase())){ + this.extensions.name.push('ColumnsResizer'); + this.extensions.src.push('TFExt_ColsResizer/TFExt_ColsResizer.js'); + this.extensions.description.push('Columns Resizing'); + this.extensions.initialize.push(function(o){o.SetColsResizer('ColumnsResizer');}); + } + } + } + + //Default columns resizer properties for grid layout + f.col_resizer_cols_headers_table = this.headTbl.getAttribute('id'); + f.col_resizer_cols_headers_index = this.gridHeadRowIndex; + f.col_resizer_width_adjustment = 0; + f.col_enable_text_ellipsis = false; + + //Cols generation for all browsers excepted IE<=7 + o.tblHasColTag = (tf_Tag(o.tbl,'col').length > 0) ? true : false; + if(!tf_isIE && !tf_isIE7){ + //Col elements are enough to keep column widths after sorting and filtering + function createColTags(o) + { + if(!o) return; + for(var k=(o.nbCells-1); k>=0; k--) + { + var col = tf_CreateElm( 'col', ['id', o.id+'_col_'+k]); + o.tbl.firstChild.parentNode.insertBefore(col,o.tbl.firstChild); + col.style.width = o.colWidth[k]; + o.gridColElms[k] = col; + } + o.tblHasColTag = true; + } + if(!o.tblHasColTag) createColTags(o); + else{ + var cols = tf_Tag(o.tbl,'col'); + for(var i=0; i0 ) r = tbody[0].insertRow(0); + else r = o.tbl.insertRow(0); + r.style.height = '0px'; + for(var i=0; i0 ) + tbody[0].moveRow(o.leadColWidthsRow.rowIndex, 0); + else o.tbl.moveRow(o.leadColWidthsRow.rowIndex, 0); + } + if(afterSortFn!=null) afterSortFn.call(null,o,colIndex); + } + } + + var afterColResizedFn = tf_isFn(f.on_after_col_resized) ? f.on_after_col_resized : null; + f.on_after_col_resized = function(o,colIndex){ + if(colIndex==undefined) return; + var w = o.crWColsRow.cells[colIndex].style.width; + var col = o.gridColElms[colIndex]; + col.style.width = w; + + var thCW = o.crWColsRow.cells[colIndex].clientWidth; + var tdCW = o.crWRowDataTbl.cells[colIndex].clientWidth; + + if(tf_isIE || tf_isIE7) + o.tbl.style.width = o.headTbl.clientWidth+'px'; + + if(thCW != tdCW && !tf_isIE && !tf_isIE7) + o.headTbl.style.width = o.tbl.clientWidth+'px'; + + if(afterColResizedFn!=null) afterColResizedFn.call(null,o,colIndex); + } + + if(this.tbl.clientWidth != this.headTbl.clientWidth) + this.tbl.style.width = this.headTbl.clientWidth+'px'; + }, + + RemoveGridLayout: function() + { + if(!this.gridLayout) return; + var t = this.tbl.parentNode.removeChild(this.tbl); + this.tblMainCont.parentNode.insertBefore(t, this.tblMainCont); + this.tblMainCont.parentNode.removeChild( this.tblMainCont ); + this.tblMainCont = null; + this.headTblCont = null; + this.headTbl = null; + this.tblCont = null; + //TO DO: alternative solution for Firefox + this.tbl.outerHTML = this.sourceTblHtml; + this.tbl = tf_Id(this.id); + this.isFirstLoad = true; + this.activeFlt = null; + this.isStartBgAlternate = true; + this.hasGrid = false; + }, + + SetTopDiv: function() + /*==================================================== + - Generates div above table where paging, + reset button, rows counter label etc. are placed + =====================================================*/ + { + if( this.infDiv!=null ) return; + + /*** container div ***/ + var infdiv = tf_CreateElm( 'div',['id',this.prfxInfDiv+this.id] ); + infdiv.className = this.infDivCssClass;// setAttribute method doesn't seem to work on ie<=6 + if(this.fixedHeaders && this.contDiv) + this.contDiv.parentNode.insertBefore(infdiv, this.contDiv); + else if(this.gridLayout){ + this.tblMainCont.appendChild(infdiv); + infdiv.className = this.gridInfDivCssClass; + } + else + this.tbl.parentNode.insertBefore(infdiv, this.tbl); + this.infDiv = tf_Id( this.prfxInfDiv+this.id ); + + /*** left div containing rows # displayer ***/ + var ldiv = tf_CreateElm( 'div',['id',this.prfxLDiv+this.id] ); + ldiv.className = this.lDivCssClass;/*'ldiv'*/; + infdiv.appendChild(ldiv); + this.lDiv = tf_Id( this.prfxLDiv+this.id ); + + /*** right div containing reset button + + nb results per page select ***/ + var rdiv = tf_CreateElm( 'div',['id',this.prfxRDiv+this.id] ); + rdiv.className = this.rDivCssClass/*'rdiv'*/; + infdiv.appendChild(rdiv); + this.rDiv = tf_Id( this.prfxRDiv+this.id ); + + /*** mid div containing paging elements ***/ + var mdiv = tf_CreateElm( 'div',['id',this.prfxMDiv+this.id] ); + mdiv.className = this.mDivCssClass/*'mdiv'*/; + infdiv.appendChild(mdiv); + this.mDiv = tf_Id( this.prfxMDiv+this.id ); + }, + + RemoveTopDiv: function() + /*==================================================== + - Removes div above table where paging, + reset button, rows counter label etc. are placed + =====================================================*/ + { + if( this.infDiv==null ) return; + this.infDiv.parentNode.removeChild( this.infDiv ); + this.infDiv = null; + }, + + SetFixedHeaders: function() + /*==================================================== + - CSS solution making headers fixed + =====================================================*/ + { + if((!this.hasGrid && !this.isFirstLoad) || !this.fixedHeaders) return; + if(this.contDiv) return; + var thead = tf_Tag(this.tbl,'thead'); + if( thead.length==0 ) return; + var tbody = tf_Tag(this.tbl,'tbody'); + if( tbody[0].clientHeight!=0 ) + {//firefox returns tbody height + //previous values + this.prevTBodyH = tbody[0].clientHeight; + this.prevTBodyOverflow = tbody[0].style.overflow; + this.prevTBodyOverflowX = tbody[0].style.overflowX; + + tbody[0].style.height = this.tBodyH+'px'; + tbody[0].style.overflow = 'auto'; + tbody[0].style.overflowX = 'hidden'; + } else { //IE returns 0 + // cont div is added to emulate fixed headers behaviour + var contDiv = tf_CreateElm( 'div',['id',this.prfxContentDiv+this.id] ); + contDiv.className = this.contDivCssClass; + this.tbl.parentNode.insertBefore(contDiv, this.tbl); + contDiv.appendChild(this.tbl); + this.contDiv = tf_Id(this.prfxContentDiv+this.id); + //prevents headers moving during window scroll (IE) + this.contDiv.style.position = 'relative'; + + var theadH = 0; + var theadTr = tf_Tag(thead[0],'tr'); + for(var i=0; i= ' + + 'offsetParent.offsetHeight ? 0 - parentNode.parentNode.offsetHeight + '+ + 'offsetParent.offsetHeight + offsetParent.scrollTop : 0);'; + } + }, + + RemoveFixedHeaders: function() + /*==================================================== + - Removes fixed headers + =====================================================*/ + { + if(!this.hasGrid || !this.fixedHeaders ) return; + if( this.contDiv )//IE additional div + { + this.contDiv.parentNode.insertBefore(this.tbl, this.contDiv); + this.contDiv.parentNode.removeChild( this.contDiv ); + this.contDiv = null; + var thead = tf_Tag(this.tbl,'thead'); + if( thead.length==0 ) return; + var theadTr = tf_Tag(thead[0],'tr'); + if( theadTr.length==0 ) return; + for(var i=0; i'; + else { + var opt0 = tf_CreateOpt(o.displayAllText,''); + slc.appendChild(opt0); + } + } + + function AddOpts() + {// populates select + var slcValue = slc.value; + slc.innerHTML = ''; + AddOpt0(); + + for(var y=0; y'+slcCustomTxt+''; + } else { + var opt; + //fill select on demand + if(o.fillSlcOnDemand && slcValue==optArray[y] && o['col'+colIndex]==o.fltTypeSlc) + opt = tf_CreateOpt( (isCustomSlc) ? optTxt[y] : optArray[y], + optArray[y], + true ); + else{ + if( o['col'+colIndex]!=o.fltTypeMulti ) + opt = tf_CreateOpt( (isCustomSlc) ? optTxt[y] : optArray[y], + optArray[y], + (flts_values[colIndex]!=' ' && optArray[y]==flts_values[colIndex]) + ? true : false ); + else + { + opt = tf_CreateOpt( (isCustomSlc) ? optTxt[y] : optArray[y], + optArray[y], + (fltArr.tf_Has(optArray[y].tf_MatchCase(o.matchCase),o.matchCase)) + ? true : false ); + } + } + slc.appendChild(opt); + } + }// for y + + if( fillMethod == 'innerhtml' ) + slc.innerHTML += slcInnerHtml; + + slc.setAttribute('filled','1'); + }// fn AddOpt + }, + + PopulateCheckList: function(colIndex, isExternal, extFltId) + { + this.EvtManager( + this.Evt.name.populatechecklist, + { slcIndex:colIndex, slcExternal:isExternal, slcId:extFltId } + ); + }, + _PopulateCheckList: function(colIndex, isExternal, extFltId) + /*==================================================== + - populates checklist filters + =====================================================*/ + { + isExternal = (isExternal==undefined) ? false : isExternal; + var divFltId = this.prfxCheckListDiv+colIndex+'_'+this.id; + if( tf_Id(divFltId)==null && !isExternal ) return; + if( tf_Id(extFltId)==null && isExternal ) return; + var flt = (!isExternal) ? this.checkListDiv[colIndex] : tf_Id(extFltId); + var ul = tf_CreateElm('ul',['id',this.fltIds[colIndex]],['colIndex',colIndex]); + ul.className = this.checkListCssClass; + ul.onchange = this.Evt._OnSlcChange; + var o = this, row = this.tbl.rows; + var optArray = []; + var isCustomSlc = (this.hasCustomSlcOptions //custom select test + && this.customSlcOptions.cols.tf_Has(colIndex)); + var optTxt = []; //custom selects text + var activeFlt; + if(this.refreshFilters && this.activeFilterId){ + activeFlt = this.activeFilterId.split('_')[0]; + activeFlt = activeFlt.split(this.prfxFlt)[1]; + } + + for(var k=this.refRow; k