From d903fba53385ee83bef9526d516a0a89f0e8a0be Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Sat, 11 Oct 2014 00:34:45 +1100 Subject: [PATCH] Started refactoring --- Gruntfile.js | 31 +- dist/filtergrid-uncompressed.css | 328 -- dist/filtergrid.css | 2 +- dist/tablefilter-uncompressed.js | 2739 ---------- dist/tablefilter_all-uncompressed.js | 7247 -------------------------- dist/tablefilter_all.js | 12 +- package.json | 2 +- src/index.html | 5 +- src/tablefilter.js | 2739 ---------- src/tablefilter_all.js | 520 +- 10 files changed, 231 insertions(+), 13394 deletions(-) delete mode 100644 dist/filtergrid-uncompressed.css delete mode 100644 dist/tablefilter-uncompressed.js delete mode 100644 dist/tablefilter_all-uncompressed.js delete mode 100644 src/tablefilter.js diff --git a/Gruntfile.js b/Gruntfile.js index 7c633fbc..55ccfe70 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,25 +4,40 @@ module.exports = function (grunt) { pkg: grunt.file.readJSON('package.json'), - version: 'v1.0', + version: '<%= pkg.version %>', dist_folder: 'dist/', source_folder: 'src/', + meta: { + src: [ + '<%= source_folder %>string.js', + '<%= source_folder %>dom.js', + '<%= source_folder %>event.js', + '<%= source_folder %>tablefilter_all.js' + ] + }, + // A list of files, which will be syntax-checked by JSHint jshint: { - src: ['Gruntfile.js', '<%= source_folder %>tablefilter_all.js'], + src: ['Gruntfile.js', 'src/*.js'], options: { '-W069': true, // ['xxx'] is better written in dot notation '-W107': true, // Script URL '-W061': true, // Eval can be harmful - '-W041': true + '-W041': true, + // options here to override JSHint defaults + globals: { + console: true/*, + module: true, + document: true*/ + } } }, concat: { js: { files: [{ - src: ['<%= source_folder %>tablefilter_all.js'], + src: ['<%= meta.src %>'], dest: '<%= dist_folder %>tablefilter_all.js' }] }, @@ -39,7 +54,7 @@ module.exports = function (grunt) { options: { banner: '/*------------------------------------------------------------------------ \n' + - '\t- TableFilter <%= version %> by Max Guglielmi \n' + + '\t- TableFilter v<%= version %> by Max Guglielmi \n' + '\t- build date: <%= grunt.template.today() %> \n' + '\t- http://tablefilter.free.fr \n' + '\t- Copyright (c) 2014, Licensed under the MIT License \n' + @@ -70,9 +85,9 @@ module.exports = function (grunt) { copy: { main: { files: [ - { src: ['<%= source_folder %>tablefilter_all.js'], dest: '<%= dist_folder %>tablefilter_all-uncompressed.js' }, - { src: ['<%= source_folder %>tablefilter.js'], dest: '<%= dist_folder %>tablefilter-uncompressed.js' }, - { src: ['<%= source_folder %>filtergrid.css'], dest: '<%= dist_folder %>filtergrid-uncompressed.css' }, + //{ src: ['<%= source_folder %>tablefilter_all.js'], dest: '<%= dist_folder %>tablefilter_all-uncompressed.js' }, + //{ src: ['<%= source_folder %>tablefilter.js'], dest: '<%= dist_folder %>tablefilter-uncompressed.js' }, + //{ src: ['<%= source_folder %>filtergrid.css'], dest: '<%= dist_folder %>filtergrid-uncompressed.css' }, { src: ['**'], cwd: '<%= source_folder %>TF_Modules/', dest: '<%= dist_folder %>TF_Modules/', expand: true }, { src: ['**'], cwd: '<%= source_folder %>TF_Themes/', dest: '<%= dist_folder %>TF_Themes/', expand: true } ] diff --git a/dist/filtergrid-uncompressed.css b/dist/filtergrid-uncompressed.css deleted file mode 100644 index c0a8d3c1..00000000 --- a/dist/filtergrid-uncompressed.css +++ /dev/null @@ -1,328 +0,0 @@ -/*==================================================== - - HTML Table Filter Generator stylesheet - - do not hesitate to edit classes below to - change filter grid appearance -=====================================================*/ - -/* TABLE LAYOUT -=====================================================*/ -table.TF{ - font:normal 12px arial, tahoma, helvetica, sans-serif; - border-top:1px solid #D0D0D0; border-left:1px solid #D0D0D0; - border-bottom:1px solid #ccc; border-right:1px solid #ccc; -} -table.TF th{ - background-color:#EBECEE; - border-bottom:1px solid #D0D0D0; border-right:1px solid #D0D0D0; - border-left:1px solid #fff; border-top:1px solid #fff; - padding:5px 5px 5px 5px; color:#333; -} - -table.TF td{ padding:5px 5px 5px 5px; border-bottom:1px solid #D0D0D0; border-right:1px solid #D0D0D0; } - -/* FILTERS BAR -=====================================================*/ -.fltrow{ /* filter grid row appearance */ - height:20px; - background-color:#f4f4f4; -} -.fltrow td, .fltrow th{ padding:2px !important; } -.btnflt{ /* button appearance */ - font-size:11px; vertical-align:middle; - margin:0 2px 0 2px; padding:0 1px 0 1px; -} -.btnflt_icon{ /* button appearance when displayIcons is true */ - width:19px; height:19px; cursor:pointer !important; - border:0 !important; vertical-align:middle; - background:transparent url(TF_Themes/btn_filter.png) center center no-repeat !important; -} -.flt{ /* filter (input) appearance */ - background-color:#fff; font-size:10px; - border:1px solid #ccc; - margin:0; width:97%; vertical-align:middle; -} -select.flt{ /* select filter */ - background-color:#fff; border:1px solid #ccc; - margin:0 1px 1px 0; width:99%; font-size:9px; vertical-align:middle; -} -select.flt_multi{ /* multiple select filter */ - background-color:#fff; border:1px solid #ccc; - margin:0 1px 1px 0; width:99%; height:100px; - font-size:9px; vertical-align:middle; -} -.flt_s{ /* small filter (input) appearance */ - background-color:#fff; font-size:10px; - border:1px solid #ccc; - margin:0; width:80%; vertical-align:middle; -} -.single_flt{ /* single filter appearance (input) */ - background-color:#fff; font-size:11px; - border-left:1px solid #999; border-right:1px solid #ccc; - border-top:1px solid #ccc; border-bottom:1px solid #999; - margin:0; width:120px; vertical-align:middle; -} -.fltWatermark{ /* watermark input */ - color:#999; -} -.div_checklist{ /* div containing checklist */ - width:100%; height:100px; - border:1px solid #ccc; - overflow:auto; text-align:left; - background-color:#fff; - color:#333 !important; -} - -.div_checklist ul.flt_checklist{ padding:0 !important; margin:0 !important; list-style: none !important; } -.div_checklist li.flt_checklist_item{ /*check list item*/ - padding:1px !important; margin:0 !important; font-size:10px !important; - border-bottom:1px solid #ccc !important; -} -.div_checklist li.flt_checklist_item:hover{ - background-color:#335EA8 !important; - color:#fff !important; -} -.flt_checklist_item_disabled{ background-color:#E5E5E5; } -.flt_checklist_slc_item{ /*selected check list item*/ - background-color:#335EA8 !important; - color:#fff !important; -} -.div_checklist label{ display:block !important; } -.div_checklist input{ vertical-align:middle !important; margin:2px 5px 2px 1px !important; } - -/* RESET BUTTON -=====================================================*/ -/* Reset button */ -input.reset{ - width:19px; height:19px; cursor:pointer !important; - border:0 !important; vertical-align:middle; - background:transparent url(TF_Themes/btn_clear_filters.png) center center no-repeat !important; -} -input.reset:hover{ background:#CAD1D6 url(TF_Themes/btn_clear_filters.png) center center no-repeat !important; } - -/* PAGING ELEMENTS -=====================================================*/ -.inf{ /* div containing left, middle and right divs */ - clear:both; width:auto; height:25px; - background:#f4f4f4; font-size:12px; - margin:0; padding:1px 3px 1px 3px; - border:1px solid #ccc; overflow:hidden; -} -.ldiv{ /* left div */ - float:left; width:30%; position:inherit; -} -.mdiv{ /* middle div */ - float:left; width:38%; position:inherit; text-align:center; - padding:1px 0; -} -.rdiv{ /* right div */ - float:right; width:30%; position:inherit; text-align:right; -} -select.pgSlc{ height:20px; vertical-align:middle; font-size:10px; }/*paging drop-down list*/ -input.pgNbInp{/*paging text-box*/ - width:25px; height:16px; margin:1px; - font-size:11px; vertical-align:middle; -} -input.pgInp{ /*paging buttons (Next/Previous)*/ - vertical-align: middle; - width:19px; height:19px; cursor:pointer !important; - border:0 !important; font-weight:bold; font-size:11px; -} -.nextPage{ background:transparent url(TF_Themes/btn_next_page.gif) center center no-repeat !important; } -.previousPage{ background:transparent url(TF_Themes/btn_previous_page.gif) center center no-repeat !important; } -.firstPage{ background:transparent url(TF_Themes/btn_first_page.gif) center center no-repeat !important; } -.lastPage{ background:transparent url(TF_Themes/btn_last_page.gif) center center no-repeat !important; } -.nextPage:hover, .previousPage:hover, .firstPage:hover, .lastPage:hover{ background-color:#CAD1D6 !important; } - -span.nbpg{ padding:0 5px 0 0; }/*paging nb pages*/ -div.inf a{ color:#333; text-decoration:none; font-weight:bold; }/*link appearence in .inf div*/ -div.inf a:hover{ text-decoration:underline; }/*link appearence in .inf div*/ -div.tot{ /* rows counter appearance */ - float:left; overflow:hidden; - width:150px; height:15px; - border-right:1px solid #ccc; - margin:0 5px 0 2px; - padding:0 2px 0 2px; -} -div.tot span{ font-weight:bold; font-size:11px; } -select.rspg{ width:50px; margin:1px 5px 0 5px; vertical-align:middle; }/*results per page select*/ -span.rspgSpan{ font-size:11px; } /*results per page select label*/ - - -/* BEHAVIOURS -=====================================================*/ -span.keyword{ background-color: #ffcc00;}/*highlighted word*/ - -.even{ background-color:#fff; }/*row bg alternating color*/ -.odd{ background-color:#E5E5E5; }/*row bg alternating color*/ - -.loader{ /* loader appearance */ - position:absolute; padding: 5px 10px 5px 10px; - margin:20px 0 0 20px; width:auto; - z-index:1000; font-size:12px; font-weight:bold; - border:1px solid #666; background:#f4f4f4; - vertical-align:middle; -} - -div.status{ /* status bar appearance */ - float:left; overflow:hidden; - width:150px; height:15px; - border-right:1px solid #ccc; - margin:0 5px 0 2px; - padding:0 2px 0 2px; -} -div.status span{ font-weight:bold; font-size:11px; } - -div.cont{ /*table container div*/ - height:200px; overflow: auto; -} -div.head{ width:auto; overflow:hidden; } - -/* Help elements */ -.helpBtn{ margin:0 5px 0 5px; padding: 2px 4px 2px 4px; border-left:1px solid #ccc; border-right:1px solid #ccc; } /* help button */ -div.helpCont{ /* help container */ - position:absolute; display:none; - max-width:300px; overflow:auto; - padding:7px 7px 7px 7px; margin:15px 0; - border:1px solid #CCC; line-height:19px; - font-size:12px; color:#333; - background:#fff; text-align:left; - border-radius:4px; - -moz-border-radius:4px; - -webkit-border-radius:4px; - box-shadow:3px 3px 2px #888; - -moz-box-shadow:3px 3px 2px #888; - -webkit-box-shadow:3px 3px 2px #888; -} -div.helpCont a{ color:#cc0000; text-decoration:underline; font-weight:normal; } -div.helpCont a:hover{ text-decoration:none; } -div.helpCont hr{ border:1px solid #ccc; } -div.helpFooter{ margin:10px 0 0 0; } -div.helpFooter h4{ margin:2px 2px 2px 2px; font-size:13px; color:#333; } - -/* Pop-up filters elements */ -div.popUpFilter{ - position:absolute; display:none; width:100px; - background:#C8E0FB; border:1px solid #e4e4e4; - padding:1px 3px 1px 1px; - margin:20px auto 0 0px; -} - -/* Active column header */ -.activeHeader{ background:#004080 !important; color:#fff !important; } - -/* GRID LAYOUT -=====================================================*/ -div.grd_Cont{ /*Main container*/ - width:800px; height:auto; - overflow:hidden; - padding:3px 3px 3px 3px; - background:#C8E0FB; - border:1px solid #99BBE8; -} -div.grd_tblCont{ /*Content table container*/ - height:400px; width:800px; - background:#fff; - overflow-x:auto; - overflow-y:scroll; -} -div.grd_headTblCont{ /*headers' table container*/ - height:auto; width:800px; overflow:hidden; - border-bottom:1px solid #99BBE8; - background-color:#C8E0FB; -} - -div.grd_tblCont table, div.grd_headTblCont table{ /*Tables*/ - font-size:12px; border-collapse:collapse; - table-layout:fixed; -} -div.grd_tblCont table{ border-right:1px solid #99BBE8; } - -/* Filters */ -div.grd_Cont .fltrow{ background-color:transparent; } /*Filters' row*/ -div.grd_Cont .flt{ border:1px solid #99BBE8; width:97%; } -div.grd_Cont .flt:focus{ border:1px solid #558DD9; } - -/* Headers */ -div.grd_tblCont table th, div.grd_headTblCont table th, div.grd_headTblCont table td{ - background:#C8E0FB; - padding:2px 2px 2px 2px !important; color:#333; - border-right:1px solid #99BBE8 !important; - overflow:hidden; - /*white-space:nowrap;*/ - text-overflow:ellipsis; -} -div.grd_tblCont table td{ - padding:2px 2px 2px 2px !important; - border-bottom:1px solid #ccc !important; - overflow:hidden; - /*white-space:nowrap;*/ - text-overflow:ellipsis; -} - -.grd_inf{ /* div containing left, middle and right divs */ - clear:both; width:auto; height:25px; - background:#C8E0FB; font-size:11px; - margin:0; padding:1px 3px 1px 3px; - border-top:1px solid #99BBE8; -} - -div.grd_Cont .even{ background-color:#fff; }/*row bg alternating color*/ -div.grd_Cont .odd{ background-color:#DFE8F6; }/*row bg alternating color*/ - -/* ezEditTable -=====================================================*/ - -/* Selection */ -.ezActiveRow{ background-color:#2852A8 !important; color:#fff; } -.ezSelectedRow{ background-color:#316AC5; color:#fff; } -.ezActiveCell{ - background-color:#D9E8FB !important; - color:#000 !important; font-weight:bold; -} -.ezETSelectedCell{ background-color:#FFDC61 !important; font-weight:bold; color:rgb(0,0,0)!important; } -.ezUnselectable{ - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - user-select: none; -} - -/* Cell editors */ -.ezInputEditor{ width:95%; height:auto; font-size:inherit; border:1px solid #AACCF6; } -.ezTextareaEditor{ width:95%; height:35px; font-size:inherit; border:1px solid #AACCF6; } -.ezSelectEditor{ width:100%; font-size:inherit; border:1px solid #AACCF6; } -.ezModifiedCell{ background:transparent url(themes/bg_mod_cell.png) 0 0 no-repeat; } -select[multiple="multiple"].ezSelectEditor{ height:35px; } -/* Command type editor */ -.ezCommandEditor{ margin:2px; } -.ezCommandEditor button, .ezCommandEditor input[type="button"] { - font-size:11px; min-height:22px; - margin:1px; padding:3px; - border:1px solid #ccc; background:#fff; - border-radius:4px 4px 4px 4px; - -moz-border-radius:4px 4px 4px 4px; -} -.ezCommandEditor button:hover, .ezCommandEditor input[type="button"]:hover { border:1px solid #999; } -.ezCommandEditor img{ border:0; vertical-align:middle; margin:2px; } - -/* Utils */ -.ezOpacity{ - filter:alpha(opacity=60); /* for IE */ - opacity:0.6; /* CSS3 standard */ -} -.alignLeft{ text-align:left; } -.alignCenter{ text-align:center; } -.alignRight{ text-align:right; } - -/* WEB FX Sortable table -/* Change images paths if you don't use same folder -/* Remove safely if not used -=====================================================*/ -.sort-arrow { - width:11px; height:11px; margin:0 2px; - background-position:center center; - background-repeat:no-repeat; -} -.sort-arrow.descending{ background-image:url("TF_Themes/downsimple.png"); } -.sort-arrow.ascending{ background-image:url("TF_Themes/upsimple.png"); } \ No newline at end of file diff --git a/dist/filtergrid.css b/dist/filtergrid.css index dbbae7f8..93c950cd 100644 --- a/dist/filtergrid.css +++ b/dist/filtergrid.css @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------ - TableFilter stylesheet by Max Guglielmi - - (build date: Mon Oct 06 2014 22:02:07) + - (build date: Sat Oct 11 2014 00:26:58) - Edit below for your projects' needs ------------------------------------------------------------------------*/ diff --git a/dist/tablefilter-uncompressed.js b/dist/tablefilter-uncompressed.js deleted file mode 100644 index b1acb3a9..00000000 --- a/dist/tablefilter-uncompressed.js +++ /dev/null @@ -1,2739 +0,0 @@ -/*------------------------------------------------------------------------ - - HTML Table Filter Generator v2.5 - - By Max Guglielmi (tablefilter.free.fr) - - Licensed under the MIT License --------------------------------------------------------------------------- -Copyright (c) 2009-2012 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, Piepiax, Manuel Kern, Baladhandayutham for active contribution - and/or inspiration -------------------------------------------------------------------------*/ - -var TF = function(id) -/*==================================================== - - TF object constructor - - Params: - - id: table id (string) - - refRow (optional): row index (number) - - config (optional): configuration - object (literal object) -=====================================================*/ -{ - if(arguments.length === 0){ return; } - this.id = id; - this.version = '2.5'; - this.year = (new Date()).getFullYear(); - this.tbl = tf_Id(id); - this.startRow = undefined; - this.refRow = null; - this.headersRow = null; - this.fObj = null; - this.nbFilterableRows = null; - this.nbRows = null; - this.nbCells = null; - this.hasGrid = false; - this.enableModules = true; - - if(this.tbl != null && this.tbl.nodeName.tf_LCase() == 'table' && this.GetRowsNb()) - { - if(arguments.length>1) - { - for(var i=0; i1) this.filtersRowIndex = this.headersRow+1; - else{ this.filtersRowIndex = 1; this.headersRow = 0; } - } - this.fltCellTag = 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.fltElms = []; //stores filters DOM elements - 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.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.left_div_css_class!=undefined //defines css class for left div - ? f.left_div_css_class : 'ldiv'; - this.rDivCssClass = f.right_div_css_class!=undefined //defines css class for right div - ? f.right_div_css_class : 'rdiv'; - this.mDivCssClass = f.middle_div_css_class!=undefined //defines css class for mid div - ? f.middle_div_css_class : 'mdiv'; - this.contDivCssClass = f.content_div_css_class!=undefined - ? f.content_div_css_class : 'cont'; //table container div css class - - /*** filters' grid appearance ***/ - this.stylesheet = f.stylesheet!=undefined ? f.stylesheet : this.basePath+'filtergrid.css'; //stylesheet file - this.stylesheetId = this.id + '_style'; - this.fltsRowCssClass = f.flts_row_css_class!=undefined //defines css class for filters row - ? f.flts_row_css_class : 'fltrow'; - this.enableIcons = f.enable_icons!=undefined ? f.enable_icons : true; //enables/disables icons (paging, reset button) - this.alternateBgs = f.alternate_rows ? true : false; //enables/disbles rows alternating bg colors - this.hasColWidth = f.col_width ? true : false; //defines widths of columns - this.colWidth = this.hasColWidth ? f.col_width : null; - this.fixedHeaders = f.fixed_headers ? true : false; //enables/disables fixed headers - this.tBodyH = f.tbody_height ? f.tbody_height : 200; //tbody height if fixed headers enabled - this.fltCssClass = f.flt_css_class!=undefined //defines css class for filters - ? f.flt_css_class : 'flt'; - this.fltMultiCssClass = f.flt_multi_css_class!=undefined //defines css class for multiple selects filters - ? f.flt_multi_css_class : 'flt_multi'; - this.fltSmallCssClass = f.flt_small_css_class!=undefined //defines css class for filters - ? f.flt_small_css_class : 'flt_s'; - this.singleFltCssClass = 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.even_row_css_class!=undefined //defines css class for even rows - ? f.even_row_css_class :'even'; - this.rowBgOddCssClass = f.odd_row_css_class!=undefined //defines css class for odd rows - ? f.odd_row_css_class :'odd'; - - /*** filters' grid behaviours ***/ - this.enterKey = f.enter_key==false ? false : true; //enables/disables enter key - this.isModFilterFn = 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 = tf_IsFn(f.on_before_filter) //calls function before filtering starts - ? f.on_before_filter : null; - this.onAfterFilter = tf_IsFn(f.on_after_filter) //calls function after filtering - ? f.on_after_filter : null; - this.matchCase = f.match_case ? true : false; //enables/disables case sensitivity - this.exactMatch = f.exact_match ? true : false; //enables/disbles exact match for search - this.refreshFilters = f.refresh_filters ? true : false; //refreshes drop-down lists upon validation - this.disableExcludedOptions = f.disable_excluded_options!=undefined ? f.disable_excluded_options : false; //wheter excluded options are disabled - this.activeFlt = null; //stores active filter element - this.activeFilterId = null; //id of active filter - this.hasColOperation = f.col_operation ? true : false; //enables/disbles column operation(sum,mean) - this.colOperation = null; - this.hasVisibleRows = 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.search_type!=undefined //defines search type: include or exclude - ? f.search_type : 'include'; - this.isExternalFlt = f.external_flt_grid ? true : false; //enables/disables external filters generation - this.externalFltTgtIds = 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.exec_delay ? parseInt(f.exec_delay) : 100; //delays filtering process if loader true - this.status = f.status ? true : false; //enables/disables status messages - this.onFiltersLoaded = tf_IsFn(f.on_filters_loaded) //calls function when filters grid loaded - ? f.on_filters_loaded : null; - this.singleSearchFlt = f.single_search_filter ? true : false; //enables/disables single filter search - this.onRowValidated = tf_IsFn(f.on_row_validated) //calls function after row is validated - ? f.on_row_validated : null; - this.customCellDataCols = f.custom_cell_data_cols ? f.custom_cell_data_cols : []; //array defining columns for customCellData event - this.customCellData = tf_IsFn(f.custom_cell_data) //calls custom function for retrieving cell data - ? f.custom_cell_data : null; - this.inpWatermark = f.input_watermark!=undefined ? f.input_watermark : ''; //input watermark text array - this.inpWatermarkCssClass = f.input_watermark_css_class!=undefined //defines css class for input watermark - ? f.input_watermark_css_class : 'fltWatermark'; - this.isInpWatermarkArray = f.input_watermark!=undefined - ? (tf_IsArray(f.input_watermark) ? true : false) : false; - this.toolBarTgtId = f.toolbar_target_id!=undefined //id of toolbar container element - ? f.toolbar_target_id : null; - this.helpInstructions = (f.help_instructions!=undefined) ? f.help_instructions : null; //enables/disables help div - this.popUpFilters = f.popup_filters!=undefined ? f.popup_filters : false; //popup filters - this.markActiveColumns = f.mark_active_columns!=undefined ? f.mark_active_columns : false; //active columns color - this.activeColumnsCssClass = f.active_columns_css_class!=undefined //defines css class for active column header - ? f.active_columns_css_class : 'activeHeader'; - this.onBeforeActiveColumn = tf_IsFn(f.on_before_active_column) //calls function before active column header is marked - ? f.on_before_active_column : null; - this.onAfterActiveColumn = tf_IsFn(f.on_after_active_column) //calls function after active column header is marked - ? f.on_after_active_column : null; - - /*** selects customisation and behaviours ***/ - this.displayAllText = f.display_all_text!=undefined ? f.display_all_text : ''; //defines 1st option text - this.enableSlcResetFilter = f.enable_slc_reset_filter!=undefined ? f.enable_slc_reset_filter : true; - this.enableEmptyOption = f.enable_empty_option ? true : false; //enables/disables empty option in combo-box filters - this.emptyText = f.empty_text!=undefined ? f.empty_text : '(Empty)'; //defines empty option text - this.enableNonEmptyOption = f.enable_non_empty_option ? true : false; //enables/disables non empty option in combo-box filters - this.nonEmptyText = f.non_empty_text!=undefined ? f.non_empty_text : '(Non empty)'; //defines empty option text - this.onSlcChange = f.on_change==false ? false : true; //enables/disables onChange event on combo-box - this.sortSlc = f.sort_select==false ? false : true; //enables/disables select options sorting - this.isSortNumAsc = f.sort_num_asc ? true : false; //enables/disables ascending numeric options sorting - this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : null; - this.isSortNumDesc = f.sort_num_desc ? true : false; //enables/disables descending numeric options sorting - this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : null; - this.slcFillingMethod = f.slc_filling_method!=undefined //sets select filling method: 'innerHTML' or - ? f.slc_filling_method : 'createElement'; //'createElement' - this.fillSlcOnDemand = f.fill_slc_on_demand ? true : false; //enabled selects are populated on demand - this.activateSlcTooltip = 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.multiple_slc_tooltip!=undefined //tooltip text appearing on multiple select - ? f.multiple_slc_tooltip : 'Use Ctrl key for multiple selections'; - this.hasCustomSlcOptions = f.custom_slc_options && tf_IsObj(f.custom_slc_options) - ? true : false; - this.customSlcOptions = f.custom_slc_options!=undefined - ? f.custom_slc_options : null; - this.onBeforeOperation = tf_IsFn(f.on_before_operation) //calls function before col operation - ? f.on_before_operation : null; - this.onAfterOperation = 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.div_checklist_css_class!=undefined - ? f.div_checklist_css_class : 'div_checklist'; //defines css class for div containing checklist filter - this.checkListCssClass = f.checklist_css_class!=undefined //defines css class for checklist filters - ? f.checklist_css_class : 'flt_checklist'; - this.checkListItemCssClass = f.checklist_item_css_class!=undefined //defines css class for checklist item (li) - ? f.checklist_item_css_class : 'flt_checklist_item'; - this.checkListSlcItemCssClass = 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.activate_checklist_text!=undefined //Load on demand text - ? f.activate_checklist_text : 'Click to load data'; - this.checkListItemDisabledCssClass = f.checklist_item_disabled_css_class!=undefined //defines css class for checklist filters - ? f.checklist_item_disabled_css_class : 'flt_checklist_item_disabled'; - this.enableCheckListResetFilter = f.enable_checklist_reset_filter!=undefined ? f.enable_checklist_reset_filter : true; - - /*** Filter operators ***/ - this.rgxOperator = f.regexp_operator!=undefined ? f.regexp_operator : 'rgx:'; - this.emOperator = f.empty_operator!=undefined ? f.empty_operator : '[empty]'; - this.nmOperator = f.nonempty_operator!=undefined ? f.nonempty_operator : '[nonempty]'; - this.orOperator = f.or_operator!=undefined ? f.or_operator : '||'; - this.anOperator = f.and_operator!=undefined ? f.and_operator : '&&'; - this.grOperator = f.greater_operator!=undefined ? f.greater_operator : '>'; - this.lwOperator = f.lower_operator!=undefined ? f.lower_operator : '<'; - this.leOperator = f.lower_equal_operator!=undefined ? f.lower_equal_operator : '<='; - this.geOperator = f.greater_equal_operator!=undefined ? f.greater_equal_operator : '>='; - this.dfOperator = f.different_operator!=undefined ? f.different_operator : '!'; - this.lkOperator = f.like_operator!=undefined ? f.like_operator : '*'; - this.eqOperator = f.equal_operator!=undefined ? f.equal_operator : '='; - this.stOperator = f.start_with_operator!=undefined ? f.start_with_operator : '{'; - this.enOperator = f.end_with_operator!=undefined ? f.end_with_operator : '}'; - this.curExp = f.cur_exp!=undefined ? f.cur_exp : '^[¥£€$]'; - this.separator = f.separator!=undefined ? f.separator : ','; - - /*** rows counter ***/ - this.rowsCounter = f.rows_counter ? true : false; //show/hides rows counter - - /*** status bar ***/ - this.statusBar = f.status_bar ? f.status_bar : false; //show/hides status bar - - /*** loader ***/ - this.loader = f.loader ? true : false; //enables/disables loader - - /*** validation - reset buttons/links ***/ - this.displayBtn = f.btn ? true : false; //show/hides filter's validation button - this.btnText = f.btn_text!=undefined ? f.btn_text : (!this.enableIcons ? 'Go' : ''); //defines validation button text - this.btnCssClass = f.btn_css_class!=undefined ? f.btn_css_class : (!this.enableIcons ? 'btnflt' : 'btnflt_icon'); //defines css class for validation button - this.btnReset = f.btn_reset ? true : false; //show/hides reset link - this.btnResetCssClass = f.btn_reset_css_class!=undefined //defines css class for reset button - ? f.btn_reset_css_class :'reset'; - this.onBeforeReset = tf_IsFn(f.on_before_reset) ? f.on_before_reset : null; //callback function before filters are cleared - this.onAfterReset = tf_IsFn(f.on_after_reset) ? f.on_after_reset : null; //callback function after filters are cleared - - /*** paging ***/ - this.paging = f.paging ? true : false; //enables/disables table paging - this.hasResultsPerPage = f.results_per_page ? true : false; //enables/disables results per page drop-down - this.btnPageCssClass = f.paging_btn_css_class!=undefined - ? f.paging_btn_css_class :'pgInp'; //css class for paging buttons (previous,next,etc.) - this.pagingSlc = null; //stores paging select element - this.resultsPerPage = null; //stores results per page text and values - this.resultsPerPageSlc = null; //results per page select element - this.isPagingRemoved = false; //indicates if paging elements were previously removed - 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 - - /*** webfx sort adapter ***/ - this.sort = 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.sort_config!=undefined ? f.sort_config : {}; - this.sortConfig.name = this.sortConfig['name']!=undefined ? f.sort_config.name : 'sortabletable'; - this.sortConfig.src = this.sortConfig['src']!=undefined ? f.sort_config.src : this.basePath+'sortabletable.js'; - this.sortConfig.adapterSrc = this.sortConfig['adapter_src']!=undefined ? f.sort_config.adapter_src : this.basePath+'tfAdapter.sortabletable.js'; - this.sortConfig.initialize =this.sortConfig['initialize']!=undefined ? f.sort_config.initialize : function(o){ if(o.SetSortTable) o.SetSortTable(); }; - this.sortConfig.sortTypes = this.sortConfig['sort_types']!=undefined ? f.sort_config.sort_types : []; - this.sortConfig.sortCol = this.sortConfig['sort_col']!=undefined ? f.sort_config.sort_col : null; - this.sortConfig.asyncSort = this.sortConfig['async_sort']!=undefined ? true : false; - this.sortConfig.triggerIds = this.sortConfig['sort_trigger_ids']!=undefined ? f.sort_config.sort_trigger_ids : []; - - /*** ezEditTable extension ***/ - this.selectable = f.selectable!=undefined ? f.selectable : false; //enables/disables table selection feature - this.editable = f.editable!=undefined ? f.editable : false; //enables/disables editable table feature - - /*** onkeyup event ***/ - this.onKeyUp = f.on_keyup ? true : false; //enables/disables onkeyup event, table is filtered when user stops typing - this.onKeyUpDelay = 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.highlight_keywords ? true : false; //enables/disables keyword highlighting - this.highlightCssClass = f.highlight_css_class!=undefined ? f.highlight_css_class : 'keyword'; //defines css class for highlighting - this.highlightedNodes = []; - - /*** data types ***/ - this.defaultDateType = f.default_date_type!=undefined //defines default date type (european DMY) - ? f.default_date_type : 'DMY'; - this.thousandsSeparator = f.thousands_separator!=undefined //defines default thousands separator - ? f.thousands_separator : ','; //US = ',' EU = '.' - this.decimalSeparator = f.decimal_separator!=undefined //defines default decimal separator - ? f.decimal_separator : '.'; //US & javascript = '.' EU = ',' - this.hasColNbFormat = f.col_number_format ? true : false; //enables number format per column - this.colNbFormat = this.hasColNbFormat ? f.col_number_format : null; //array containing columns nb formats - this.hasColDateType = f.col_date_type ? true : false; //enables date type per column - this.colDateType = this.hasColDateType ? f.col_date_type : null; //array containing columns date type - - /*** status messages ***/ - this.msgFilter = f.msg_filter!=undefined //filtering - ? f.msg_filter : 'Filtering data...'; - this.msgPopulate = f.msg_populate!=undefined //populating drop-downs - ? f.msg_populate : 'Populating filter...'; - this.msgPopulateCheckList = f.msg_populate_checklist!=undefined //populating drop-downs - ? f.msg_populate_checklist : 'Populating list...'; - this.msgChangePage = f.msg_change_page!=undefined //changing paging page - ? f.msg_change_page : 'Collecting paging data...'; - this.msgClear = f.msg_clear!=undefined //clearing filters - ? f.msg_clear : 'Clearing filters...'; - this.msgChangeResults = f.msg_change_results!=undefined //changing nb results/page - ? f.msg_change_results : 'Changing results per page...'; - this.msgResetValues = f.msg_reset_grid_values!=undefined //re-setting grid values - ? f.msg_reset_grid_values : 'Re-setting filters values...'; - this.msgResetPage = f.msg_reset_page!=undefined //re-setting page - ? f.msg_reset_page : 'Re-setting page...'; - this.msgResetPageLength = f.msg_reset_page_length!=undefined //re-setting page length - ? f.msg_reset_page_length : 'Re-setting page length...'; - this.msgSort = f.msg_sort!=undefined //table sorting - ? f.msg_sort : 'Sorting data...'; - this.msgLoadExtensions = f.msg_load_extensions!=undefined //extensions loading - ? f.msg_load_extensions : 'Loading extensions...'; - this.msgLoadThemes = f.msg_load_themes!=undefined //themes loading - ? f.msg_load_themes : 'Loading theme(s)...'; - - /*** ids prefixes ***/ - this.prfxTf = 'TF'; //css class name added to table - 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 - this.prfxHelpSpan = 'helpSpan_'; //id prefix for help elements - this.prfxHelpDiv = 'helpDiv_'; //id prefix for help elements - this.prfxPopUpSpan = 'popUpSpan_'; //id prefix for pop-up filter span - this.prfxPopUpDiv = 'popUpDiv_'; //id prefix for pop-up div containing filter - - /*** cookies ***/ - this.hasStoredValues = false; - this.rememberGridValues = 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.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.remember_page_length - ? true : false; //remembers page length on page load - this.pgLenCookie = this.prfxCookiePageLen + this.id; //cookie storing page length - this.cookieDuration = f.set_cookie_duration - ? parseInt(f.set_cookie_duration) :100000; //cookie duration - - /*** extensions ***/ - this.hasExtensions = f.extensions ? true : false; //imports external script - this.extensions = (this.hasExtensions) ? f.extensions : null; - - /*** themes ***/ - this.enableDefaultTheme = f.enable_default_theme ? true : false; - this.hasThemes = (f.enable_default_theme - || (f.themes && tf_IsObj(f.themes))) ? true : false; //imports themes - this.themes = (this.hasThemes) ? f.themes : null; - this.themesPath = f.themes_path!=undefined ? f.themes_path : this.basePath+'TF_Themes/'; //themes path - - /***(deprecated: backward compatibility) ***/ - this.hasBindScript = 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', - loadthemes: 'LoadThemes' - }, - _DetectKey: function(e) - /*==================================================== - - common fn that detects return key for a given - element (onkeypress for inputs) - =====================================================*/ - { - if(!o.enterKey) return; - var evt = e || window.event; - if(evt) - { - var key=(evt.charCode)?evt.charCode: - ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0)); - if(key=='13') - { - o.Filter(); - tf_CancelEvent(evt); - tf_StopEvent(evt); - } 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 || window.event; - 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){ - o.isUserTyping = false; - window.clearInterval(o.onKeyUpTimer); - } - //Watermark - if(this.value == '' && o.inpWatermark != ''){ - this.value = (o.isInpWatermarkArray) - ? o.inpWatermark[this.getAttribute('ct')] : o.inpWatermark; - tf_AddClass(this, o.inpWatermarkCssClass); - } - if(o.ezEditTable){ - if(o.editable) o.ezEditTable.Editable.Set(); - if(o.selectable) o.ezEditTable.Selection.Set(); - } - }, - _OnInpFocus: function(e) - /*==================================================== - - onfocus event for input filters - =====================================================*/ - { - var evt = e || window.event; - o.activeFilterId = this.getAttribute('id'); - o.activeFlt = tf_Id(o.activeFilterId); - //Watermark - if(!o.isInpWatermarkArray){ - if(this.value == o.inpWatermark && o.inpWatermark != ''){ - this.value = ''; - tf_RemoveClass(this, o.inpWatermarkCssClass); - } - } else { - var inpWatermark = o.inpWatermark[this.getAttribute('ct')]; - if(this.value == inpWatermark && inpWatermark != ''){ - this.value = ''; - tf_RemoveClass(this, o.inpWatermarkCssClass); - } - } - if(o.popUpFilters){ - tf_CancelEvent(evt); - tf_StopEvent(evt); - } - if(o.ezEditTable){ - if(o.editable) o.ezEditTable.Editable.Remove(); - if(o.selectable) o.ezEditTable.Selection.Remove(); - } - }, - _OnSlcFocus: function(e) - /*==================================================== - - onfocus event for select filters - =====================================================*/ - { - var evt = e || window.event; - 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'); - } - if(o.popUpFilters){ - tf_CancelEvent(evt); - tf_StopEvent(evt); - } - }, - _OnSlcChange: function(e) - /*==================================================== - - onchange event for select filters - =====================================================*/ - { - var evt = e || window.event; - if(o.popUpFilters) tf_StopEvent(evt); - if(o.onSlcChange) o.Filter(); - }, - _OnSlcBlur: function() - /*==================================================== - - onblur event for select filters - =====================================================*/ - { - }, - _OnCheckListChange: function(e) - /*==================================================== - - onchange event for checklist filters - =====================================================*/ - { - //Checks caller is not null - if(!o.Evt._OnCheckListChange.caller) return; - o.Evt._OnSlcChange(e); - }, - _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(); - }, - _OnSlcPagesChangeEvt: null, //used by sort adapter - _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(); - }, - _OnHelpBtnClick: function() - /*==================================================== - - Help button onclick event - =====================================================*/ - { - o._ToggleHelp(); - }, - _Paging: { //used by sort adapter - nextEvt: null, - prevEvt: null, - lastEvt: null, - firstEvt: null - } - }; - - if(this.enableModules){ - //Register modules to be imported - var m = this.module, rm = this.registeredModules; - if(this.loader || this.statusBar || this.status || this.hasThemes /*|| this.publicMethods*/) - rm.push(m.loader.name); - if(this.hasThemes /*|| this.publicMethods*/) rm.push(m.themes.name); - if(this.paging /*|| this.publicMethods*/) rm.push(m.paging.name); - if(this.gridLayout/* || this.publicMethods*/) rm.push(m.gridLayout.name); - if(this.sort || this.gridLayout /*|| this.publicMethods*/) rm.push(m.sort.name); - if(this.popUpFilters /*|| this.publicMethods*/) rm.push(m.popUpFilters.name); - if(this.rowsCounter /*|| this.publicMethods*/) rm.push(m.rowsCounter.name); - if(this.fixedHeaders /*|| this.publicMethods*/) rm.push(m.fixedHeaders.name); - if(this.rememberGridValues || this.rememberPageLen || this.rememberPageNb /*|| this.publicMethods*/) - rm.push(m.cookies.name); - if(this.statusBar|| this.status || this.loader || this.hasThemes /*|| this.publicMethods*/) rm.push(m.statusBar.name); - if(this.btnReset /*|| this.publicMethods*/) rm.push(m.resetBtn.name); - if((this.helpInstructions || this.helpInstructions==null)/*|| this.publicMethods*/) rm.push(m.helpInstructions.name); - if(this.alternateBgs /*|| this.publicMethods*/) rm.push(m.alternateRows.name); - if(this.highlightKeywords /*|| this.publicMethods*/) rm.push(m.highlightKeywords.name); - if(this.refreshFilters /*|| this.publicMethods*/) rm.push(m.refreshFilters.name); - if(this.hasColOperation /*|| this.publicMethods*/) rm.push(m.colOps.name); - if(this.selectable || this.editable) rm.push(m.ezEditTable.name); - if(this.hasExtensions || this.gridLayout /*|| this.publicMethods*/){ - rm.push(m.extensions.name); - if(!rm.tf_Has(m.populateCheckList.name, true)) rm.push(m.populateCheckList.name); - } - if(this.inpWatermark != '') rm.push(m.watermark.name); - if(this.publicMethods || this.hasExtensions || this.refreshFilters || - this.popUpFilters || this.markActiveColumns) rm.push(m.publicMethods.name); - - //Import modules - for(var i=0; i0) - fltrow = thead[0].insertRow(this.filtersRowIndex); - else - fltrow = this.tbl.insertRow(this.filtersRowIndex); - - if(this.headersRow>1 && this.filtersRowIndex <= this.headersRow && !this.popUpFilters) this.headersRow++; - if(this.popUpFilters) this.headersRow++; - - if(this.fixedHeaders) this.SetFixedHeaders(); - - fltrow.className = this.fltsRowCssClass; - //Disable for grid_layout - if(this.isExternalFlt && (!this.gridLayout || this.popUpFilters)) fltrow.style.display = 'none'; - } - - this.nbFilterableRows = this.GetRowsNb(); - this.nbVisibleRows = this.nbFilterableRows; - this.nbRows = this.tbl.rows.length; - - for(var i=0; i