From 45a3b0b7ffc339afddb6a6c7740ce0e65cdbebec Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Sat, 4 Apr 2015 19:10:09 +1100 Subject: [PATCH] Finalise sorting tests --- Gruntfile.js | 179 +- dist/TF_Modules/tfAdapter.sortabletable.js | 321 -- dist/TF_Modules/tf_alternateRows.js | 71 - dist/TF_Modules/tf_colOps.js | 271 - dist/TF_Modules/tf_cookies.js | 163 - dist/TF_Modules/tf_extensions.js | 53 - dist/TF_Modules/tf_ezEditTable.js | 253 - dist/TF_Modules/tf_fixedHeaders.js | 95 - dist/TF_Modules/tf_gridLayout.js | 307 -- dist/TF_Modules/tf_highlightKeywords.js | 97 - dist/TF_Modules/tf_loader.js | 72 - dist/TF_Modules/tf_paging.js | 598 --- dist/TF_Modules/tf_populateCheckList.js | 325 -- dist/TF_Modules/tf_populateSelect.js | 276 - dist/TF_Modules/tf_popupFilters.js | 161 - dist/TF_Modules/tf_publicMethods.js | 230 - dist/TF_Modules/tf_refreshFilters.js | 51 - dist/TF_Modules/tf_resetBtn.js | 174 - dist/TF_Modules/tf_rowsCounter.js | 100 - dist/TF_Modules/tf_sort.js | 58 - dist/TF_Modules/tf_statusBar.js | 110 - dist/TF_Modules/tf_themes.js | 81 - dist/TF_Modules/tf_watermark.js | 27 - dist/_core_.js | 3590 ------------- dist/build.txt | 56 - .../sortabletable/adapterSortabletable.js | 1491 ------ dist/filtergrid.css | 2 +- dist/index.html | 133 - dist/require.js | 2076 ------- dist/tablefilter.js | 4759 ++++++++++++++++- example/index.html | 16 +- .../sortabletable/adapterSortabletable.js | 148 +- src-es6/helpers.js | 4 +- src-es6/tablefilter.js | 38 +- .../sortabletable/adapterSortabletable.js | 208 +- src/helpers.js | 6 +- src/index.html | 14 +- src/tablefilter.js | 3831 ++++++++++++- test/test-sort-custom-sorter.html | 248 + test/test-sort-custom-sorter.js | 84 + test/test-sort-key.html | 248 + test/test-sort-key.js | 74 + test/test-sort.html | 63 + test/test-sort.js | 99 +- 44 files changed, 9731 insertions(+), 11530 deletions(-) delete mode 100644 dist/TF_Modules/tfAdapter.sortabletable.js delete mode 100644 dist/TF_Modules/tf_alternateRows.js delete mode 100644 dist/TF_Modules/tf_colOps.js delete mode 100644 dist/TF_Modules/tf_cookies.js delete mode 100644 dist/TF_Modules/tf_extensions.js delete mode 100644 dist/TF_Modules/tf_ezEditTable.js delete mode 100644 dist/TF_Modules/tf_fixedHeaders.js delete mode 100644 dist/TF_Modules/tf_gridLayout.js delete mode 100644 dist/TF_Modules/tf_highlightKeywords.js delete mode 100644 dist/TF_Modules/tf_loader.js delete mode 100644 dist/TF_Modules/tf_paging.js delete mode 100644 dist/TF_Modules/tf_populateCheckList.js delete mode 100644 dist/TF_Modules/tf_populateSelect.js delete mode 100644 dist/TF_Modules/tf_popupFilters.js delete mode 100644 dist/TF_Modules/tf_publicMethods.js delete mode 100644 dist/TF_Modules/tf_refreshFilters.js delete mode 100644 dist/TF_Modules/tf_resetBtn.js delete mode 100644 dist/TF_Modules/tf_rowsCounter.js delete mode 100644 dist/TF_Modules/tf_sort.js delete mode 100644 dist/TF_Modules/tf_statusBar.js delete mode 100644 dist/TF_Modules/tf_themes.js delete mode 100644 dist/TF_Modules/tf_watermark.js delete mode 100644 dist/_core_.js delete mode 100644 dist/build.txt delete mode 100644 dist/extensions/sortabletable/adapterSortabletable.js delete mode 100644 dist/index.html delete mode 100644 dist/require.js create mode 100644 test/test-sort-custom-sorter.html create mode 100644 test/test-sort-custom-sorter.js create mode 100644 test/test-sort-key.html create mode 100644 test/test-sort-key.js diff --git a/Gruntfile.js b/Gruntfile.js index 874f454a..170f94a5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -35,97 +35,119 @@ module.exports = function (grunt) { files: ['test/**/*.html'] }, - requirejs: { + requirejs:{ 'compile-main': { options: { - // appDir: "<%= dist_folder %>", baseUrl: '<%= source_folder %>', - paths: { - almond: '../libs/almond/almond', - sortabletable: 'extensions/sortabletable/sortabletable', - adapterSortabletable: 'extensions/sortabletable/adapterSortabletable' - }, - // include: ['../libs/almond/almond', 'tablefilter'], + include: ['../libs/almond/almond', 'tablefilter'], // exclude: [ // 'extensions/sortabletable/sortabletable', // 'extensions/sortabletable/adapterSortabletable' // ], - // name: 'tablefilter', - // out: '<%= dist_folder %>tablefilter.js', - dir: '<%= dist_folder %>', + shim: { + 'extensions/sortabletable/sortabletable': { + exports: 'SortableTable' + } + }, wrap: { startFile: "<%= frags_folder %>start.frag", endFile: "<%= frags_folder %>end.frag" }, - // insertRequire: ['tablefilter'], - shim: { - 'sortabletable': { - exports: 'SortableTable' - } - }, - modules:[ - { - name: 'extensions/sortabletable/adapterSortabletable', - include: [ - 'extensions/sortabletable/adapterSortabletable', - 'extensions/sortabletable/sortabletable' - ], - wrap: { - start: "(function() {", - end: "}());" - } - }, - { - name: 'tablefilter', - create: true, - include: [ - 'almond', - 'tablefilter' - ], - exclude: ['require'], - excludeShallow: [ - 'adapterSortabletable' - ] - } - ], - removeCombined: true, - findNestedDependencies: false, - optimize: 'none'/*'uglify2', - preserveLicenseComments: false, - generateSourceMaps: true*/ + name: 'tablefilter', + out: '<%= dist_folder %>tablefilter.js', + optimize: 'none' } } - // , - // 'compile-extensions': { - // options:{ - // baseUrl: '<%= source_folder %>extensions', - // dir: '<%= dist_folder %>/extensions', - // // paths: { - // // sortabletable: 'sortabletable/sortabletable', - // // adapterSortabletable: 'sortabletable/adapterSortabletable' - // // }, - // wrap: { - // startFile: "<%= frags_folder %>start.sort.frag", - // endFile: "<%= frags_folder %>end.sort.frag" - // }, - // modules:[ - // { - // name: 'sortabletable/adapterSortabletable', - // include: [ - // 'sortabletable/adapterSortabletable', - // 'sortabletable/sortabletable' - // ] - // } - // ], - // removeCombined: true, - // findNestedDependencies: false, - // optimize: 'none'/*'uglify2', - // preserveLicenseComments: false, - // generateSourceMaps: true*/ - // } - // } }, + // requirejs: { + // 'compile-main': { + // options: { + // // appDir: "<%= dist_folder %>", + // baseUrl: '<%= source_folder %>', + // paths: { + // almond: '../libs/almond/almond', + // sortabletable: 'extensions/sortabletable/sortabletable', + // adapterSortabletable: 'extensions/sortabletable/adapterSortabletable' + // }, + // // include: ['../libs/almond/almond', 'tablefilter'], + // // exclude: [ + // // 'extensions/sortabletable/sortabletable', + // // 'extensions/sortabletable/adapterSortabletable' + // // ], + // // name: 'tablefilter', + // // out: '<%= dist_folder %>tablefilter.js', + // dir: '<%= dist_folder %>', + // wrap: { + // startFile: "<%= frags_folder %>start.frag", + // endFile: "<%= frags_folder %>end.frag" + // }, + // // insertRequire: ['tablefilter'], + // shim: { + // 'sortabletable': { + // exports: 'SortableTable' + // } + // }, + // modules:[ + // { + // name: 'extensions/sortabletable/adapterSortabletable', + // include: [ + // 'extensions/sortabletable/adapterSortabletable', + // 'extensions/sortabletable/sortabletable' + // ] + // }, + // { + // name: 'tablefilter', + // create: true, + // include: [ + // 'almond', + // 'tablefilter' + // ], + // exclude: ['require'], + // excludeShallow: [ + // 'adapterSortabletable' + // ] + // } + // ], + // removeCombined: true, + // findNestedDependencies: false, + // optimize: 'none'/*'uglify2'*/, + // generateSourceMaps: false/*, + // preserveLicenseComments: false, + // generateSourceMaps: true*/ + // } + // } + // // , + // // 'compile-extensions': { + // // options:{ + // // baseUrl: '<%= source_folder %>extensions', + // // dir: '<%= dist_folder %>/extensions', + // // // paths: { + // // // sortabletable: 'sortabletable/sortabletable', + // // // adapterSortabletable: 'sortabletable/adapterSortabletable' + // // // }, + // // wrap: { + // // startFile: "<%= frags_folder %>start.sort.frag", + // // endFile: "<%= frags_folder %>end.sort.frag" + // // }, + // // modules:[ + // // { + // // name: 'sortabletable/adapterSortabletable', + // // include: [ + // // 'sortabletable/adapterSortabletable', + // // 'sortabletable/sortabletable' + // // ] + // // } + // // ], + // // removeCombined: true, + // // findNestedDependencies: false, + // // optimize: 'none'/*'uglify2', + // // preserveLicenseComments: false, + // // generateSourceMaps: true*/ + // // } + // // } + // }, + concat: { /*js: { files: [{ @@ -180,7 +202,7 @@ module.exports = function (grunt) { tablefilter: { files: [ { src: 'libs/sortabletable.js', dest: '<%= source_folder %>extensions/sortabletable/sortabletable.js' }, - { src: 'libs/requirejs/require.js', dest: '<%= dist_folder %>require.js' }, + // { src: 'libs/requirejs/require.js', dest: '<%= dist_folder %>require.js' }, // { 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 } ] @@ -191,7 +213,8 @@ module.exports = function (grunt) { 'build-main': { options: { sourceMap: true, - modules: 'amd' + modules: 'amd', + compact: false }, files: [{ expand: true, diff --git a/dist/TF_Modules/tfAdapter.sortabletable.js b/dist/TF_Modules/tfAdapter.sortabletable.js deleted file mode 100644 index 55eea305..00000000 --- a/dist/TF_Modules/tfAdapter.sortabletable.js +++ /dev/null @@ -1,321 +0,0 @@ -/*------------------------------------------------------------------------ - - HTML Table Filter Generator Sorting Feature - - TF Adapter v2.1 for WebFX Sortable Table 1.12 (Erik Arvidsson) - - 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. ------------------------------------------------------------------------- - - Changelog: - 1.1 [30-09-09] - When table is paged now the whole table is sorted and not - only the current page - 1.2 [05-12-09] - Added on_before_sort and on_after_sort callback functions - 1.3 [06-09-10] - Added IP adresses sort - 1.4 [22-01-11] - Added DDMMMYYYY date format support - 1.5 [20-02-11] - Image folder and sort icon can now be set in configuration - object - 1.6 [06-08-11] - Added on_sort_loaded callback function - 1.7 [20-08-11] - Added sort arrow css classes properties - Added sort custom key property allowing custom sorts - Added AddSortType public method - 1.8 [25-09-11] - Bug fix: sort did not take into account results per page changes - 1.9 [03-03-12] - Bug fix: custom value attribute value was read only by Firefox - 2.0 [08-04-12] - Bug fix: zebra rows background are no longer inverted after sort - 2.1 [25-08-12] - Bug fix: IE9 did not sort columns correctly -------------------------------------------------------------------------*/ - -TF.prototype.SetSortTable = function(){ - var o = this; //TF object - var f = o.fObj; //TF config object - var isTFPaged = false; - - //edit .sort-arrow.descending / .sort-arrow.ascending in filtergrid.css to reflect any path change - o.sortImgPath = f.sort_images_path != undefined ? f.sort_images_path : o.themesPath; - o.sortImgBlank = f.sort_image_blank != undefined ? f.sort_image_blank : 'blank.png'; - o.sortImgClassName = f.sort_image_class_name != undefined ? f.sort_image_class_name : 'sort-arrow'; - o.sortImgAscClassName = f.sort_image_asc_class_name != undefined ? f.sort_image_asc_class_name : 'ascending'; - o.sortImgDescClassName = f.sort_image_desc_class_name != undefined ? f.sort_image_desc_class_name : 'descending'; - o.sortCustomKey = f.sort_custom_key != undefined ? f.sort_custom_key : '_sortKey'; //cell attribute storing custom key - - /*** TF additional events ***/ - //additional paging events for alternating bg issue - o.Evt._Paging.nextEvt = function(){ if(o.sorted && o.alternateBgs) o.Filter(); } - o.Evt._Paging.prevEvt = o.Evt._Paging.nextEvt; - o.Evt._Paging.firstEvt = o.Evt._Paging.nextEvt; - o.Evt._Paging.lastEvt = o.Evt._Paging.nextEvt; - o.Evt._OnSlcPagesChangeEvt = o.Evt._Paging.nextEvt; - /*** ***/ - - /*** Extension events ***/ - //callback invoked after sort is loaded and instanciated - o.onSortLoaded = tf_IsFn(f.on_sort_loaded) ? f.on_sort_loaded : null; - //callback invoked before table is sorted - o.onBeforeSort = tf_IsFn(f.on_before_sort) ? f.on_before_sort : null; - //callback invoked after table is sorted - o.onAfterSort = tf_IsFn(f.on_after_sort) ? f.on_after_sort : null; - - /*** SortableTable ***/ - //in case SortableTable class is missing (sortabletable.js) - if((typeof SortableTable)=='undefined'){ return; } - - //overrides headerOnclick method in order to handle th - SortableTable.prototype.headerOnclick = function (e) { - if(!o.sort) return; // TF adaptation - var el = e.target || e.srcElement; // find Header element - - while (el.tagName != 'TD' && el.tagName != 'TH') // TF adaptation - el = el.parentNode; - - this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex); - }; - - //overrides getCellIndex IE returns wrong cellIndex when columns are hidden - SortableTable.getCellIndex = function (oTd) { - var cells = oTd.parentNode.cells, - l = cells.length, i; - for (i = 0; cells[i] != oTd && i < l; i++) - ; - return i; - }; - - //overrides initHeader in order to handle filters row position - SortableTable.prototype.initHeader = function (oSortTypes) { - if (!this.tHead) return; - this.headersRow = o.headersRow; // TF adaptation - var cells = this.tHead.rows[this.headersRow].cells; // TF adaptation - var doc = this.tHead.ownerDocument || this.tHead.document; - this.sortTypes = oSortTypes || []; - var l = cells.length; - var img, c; - for (var i = 0; i < l; i++) { - c = cells[i]; - if (this.sortTypes[i] != null && this.sortTypes[i] != 'None') { - c.style.cursor = 'pointer'; - img = tf_CreateElm('img',['src', o.sortImgPath + o.sortImgBlank]); - c.appendChild(img); - if (this.sortTypes[i] != null) - c.setAttribute( '_sortType', this.sortTypes[i]); - tf_AddEvent(c, 'click', this._headerOnclick); - } else { - c.setAttribute( '_sortType', oSortTypes[i] ); - c._sortType = 'None'; - } - } - this.updateHeaderArrows(); - }; - - //overrides updateHeaderArrows in order to handle arrows - SortableTable.prototype.updateHeaderArrows = function () { - var cells, l, img; - if(o.sortConfig.asyncSort && o.sortConfig.triggerIds!=null){//external headers - var triggers = o.sortConfig.triggerIds; - cells = [], l = triggers.length; - for(var j=0; j val.length) val = '0'+val; - vals[x] = val; - } - val = vals.join('.'); - return val; -} - -function sortIP(a,b){ - var aa = ipAddress(a.value.tf_LCase()); - var bb = ipAddress(b.value.tf_LCase()); - if (aa==bb) return 0; - else if (aamaxValue? parseFloat( cvalue ): maxValue;} - } - } - }//for j - if (meanFlag==1) meanValue = sumValue/nbvalues; - if (medFlag==1) - { - var aux = 0; - if(nbvalues%2 == 1) - { - aux = Math.floor(nbvalues/2); - medValue = theList[aux]; - } - else medValue = (theList[nbvalues/2]+theList[((nbvalues/2)-1)])/2; - } - if (q1Flag==1) - { - var posa=0.0; - posa = Math.floor(nbvalues/4); - if (4*posa == nbvalues) {q1Value = (theList[posa-1] + theList[posa])/2;} - else {q1Value = theList[posa];} - } - if (q3Flag==1) - { - var posa=0.0; - var posb=0.0; - posa = Math.floor(nbvalues/4); - if (4*posa == nbvalues) - { - posb = 3*posa; - q3Value = (theList[posb] + theList[posb-1])/2; - } - else - q3Value = theList[nbvalues-posa-1]; - } - - for(var i=0; i<=mThisCol; i++ ) - { - switch( opsThisCol[i] ) - { - case 'mean': - result=meanValue; - break; - case 'sum': - result=sumValue; - break; - case 'min': - result=minValue; - break; - case 'max': - result=maxValue; - break; - case 'median': - result=medValue; - break; - case 'q1': - result=q1Value; - break; - case 'q3': - result=q3Value; - break; - } - - var precision = decThisCol[i]!=undefined && !isNaN( decThisCol[i] ) - ? decThisCol[i] : 2; - - if(oTypeThisCol!=null && result) - {//if outputType is defined - result = result.toFixed( precision ); - if( tf_Id( labThisCol[i] )!=undefined ) - { - switch( oTypeThisCol.tf_LCase() ) - { - case 'innerhtml': - if (isNaN(result) || !isFinite(result) || (nbvalues==0)) - tf_Id( labThisCol[i] ).innerHTML = '.'; - else - tf_Id( labThisCol[i] ).innerHTML = result; - break; - case 'setvalue': - tf_Id( labThisCol[i] ).value = result; - break; - case 'createtextnode': - var oldnode = tf_Id( labThisCol[i] ).firstChild; - var txtnode = tf_CreateText( result ); - tf_Id( labThisCol[i] ).replaceChild( txtnode,oldnode ); - break; - }//switch - } - } else { - try - { - if (isNaN(result) || !isFinite(result) || (nbvalues==0)) - tf_Id( labThisCol[i] ).innerHTML = '.'; - else - tf_Id( labThisCol[i] ).innerHTML = result.toFixed( precision ); - } catch(e){ }//catch - }//else - }//for i - //eventual row(s) with result are always visible - if(totRowIndex!=undefined && row[totRowIndex[ucol]]) - row[totRowIndex[ucol]].style.display = ''; - }//for ucol - }//if typeof - - if(this.onAfterOperation) this.onAfterOperation.call(null,this); -} - diff --git a/dist/TF_Modules/tf_cookies.js b/dist/TF_Modules/tf_cookies.js deleted file mode 100644 index 25891993..00000000 --- a/dist/TF_Modules/tf_cookies.js +++ /dev/null @@ -1,163 +0,0 @@ -/*------------------------------------------------------------------------ - - HTML Table Filter Generator - - Remember values features (cookies) v1.1 - - By Max Guglielmi (tablefilter.free.fr) - - Licensed under the MIT License --------------------------------------------------------------------------*/ - -TF.prototype.RememberFiltersValue = function( name ) -/*============================================== - - stores filters' values in a cookie - when Filter() method is called - - Params: - - name: cookie name (string) - - credits to Florent Hirchy -===============================================*/ -{ - var flt_values = []; - for(var i=0; i 0 && !o.ezEditTableConfig.startRow) startRow = undefined; - //otherwise startRow config property if any or TableFilter refRow - else startRow = o.ezEditTableConfig.startRow || o.refRow; - - //Enables scroll into view feature if not defined - o.ezEditTableConfig.scroll_into_view = o.ezEditTableConfig.scroll_into_view!=undefined ? o.ezEditTableConfig.scroll_into_view : true; - o.ezEditTableConfig.base_path = o.ezEditTableConfig.base_path!=undefined ? o.ezEditTableConfig.base_path : o.basePath + 'ezEditTable/'; - o.ezEditTableConfig.editable = o.editable; - o.ezEditTableConfig.selection = o.selectable; - if(o.selectable) - o.ezEditTableConfig.default_selection = o.ezEditTableConfig.default_selection!=undefined ? o.ezEditTableConfig.default_selection : 'row'; - //CSS Styles - o.ezEditTableConfig.active_cell_css = o.ezEditTableConfig.active_cell_css!=undefined ? o.ezEditTableConfig.active_cell_css : 'ezETSelectedCell'; - - o._lastValidRowIndex = 0; - o._lastRowIndex = 0; - - if(o.selectable){ - //Row navigation needs to be calculated according to TableFilter's validRowsIndex array - function onAfterSelection(et, selecteElm, e){ - if(!o.validRowsIndex) return; //table is not filtered - var row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm; - var cell = selecteElm.nodeName=='TD' ? selecteElm : null; //cell for default_selection = 'both' or 'cell' - var keyCode = e != undefined ? et.Event.GetKey(e) : 0; - var isRowValid = o.validRowsIndex.tf_Has(row.rowIndex); - var nextRowIndex; - var d = (keyCode == 34 || keyCode == 33 ? (o.pagingLength || et.nbRowsPerPage) : 1); //pgup/pgdown keys - - //If next row is not valid, next valid filtered row needs to be calculated - if(!isRowValid){ - //Selection direction up/down - if(row.rowIndex>o._lastRowIndex){ - if(row.rowIndex >= o.validRowsIndex[o.validRowsIndex.length-1]) //last row - nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; - else{ - var calcRowIndex = (o._lastValidRowIndex + d); - if(calcRowIndex > (o.validRowsIndex.length-1)) - nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; - else nextRowIndex = o.validRowsIndex[calcRowIndex]; - } - } else{ - if(row.rowIndex < o.validRowsIndex[0]) nextRowIndex = o.validRowsIndex[0];//first row - else{ - var v = o.validRowsIndex[o._lastValidRowIndex - d]; - nextRowIndex = v ? v : o.validRowsIndex[0]; - } - } - o._lastRowIndex = row.rowIndex; - DoSelection(nextRowIndex); - } else{ - //If filtered row is valid, special calculation for pgup/pgdown keys - if(keyCode!=34 && keyCode!=33){ - o._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(row.rowIndex); - o._lastRowIndex = row.rowIndex; - } else { - if(keyCode == 34){ //pgdown - if((o._lastValidRowIndex + d) <= (o.validRowsIndex.length-1)) //last row - nextRowIndex = o.validRowsIndex[o._lastValidRowIndex + d]; - else nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; - } else { //pgup - if((o._lastValidRowIndex - d) < (o.validRowsIndex[0])) //first row - nextRowIndex = o.validRowsIndex[0]; - else nextRowIndex = o.validRowsIndex[o._lastValidRowIndex - d]; - } - o._lastRowIndex = nextRowIndex; - o._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(nextRowIndex); - DoSelection(nextRowIndex); - } - } - - //Next valid filtered row needs to be selected - function DoSelection(nextRowIndex){ - if(et.defaultSelection == 'row'){ - et.Selection.SelectRowByIndex(nextRowIndex); - } else { - et.ClearSelections(); - var cellIndex = selecteElm.cellIndex; - var row = o.tbl.rows[nextRowIndex]; - if(et.defaultSelection == 'both') et.Selection.SelectRowByIndex(nextRowIndex); - if(row) et.Selection.SelectCell(row.cells[cellIndex]); - } - //Table is filtered - if(o.validRowsIndex.length != o.GetRowsNb()){ - var row = o.tbl.rows[nextRowIndex]; - if(row) row.scrollIntoView(false); - if(cell){ - if(cell.cellIndex==(o.GetCellsNb()-1) && o.gridLayout) o.tblCont.scrollLeft = 100000000; - else if(cell.cellIndex==0 && o.gridLayout) o.tblCont.scrollLeft = 0; - else cell.scrollIntoView(false); - } - } - } - } - - //Page navigation has to be enforced whenever selected row is out of the current page range - function onBeforeSelection(et, selecteElm, e){ - var row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm; - if(o.paging){ - if(o.nbPages>1){ - et.nbRowsPerPage = o.pagingLength; //page length is re-assigned in case it has changed - var pagingEndRow = parseInt(o.startPagingRow) + parseInt(o.pagingLength); - var rowIndex = row.rowIndex; - if((rowIndex == o.validRowsIndex[o.validRowsIndex.length-1]) && o.currentPageNb!=o.nbPages) o.SetPage('last'); - else if((rowIndex == o.validRowsIndex[0]) && o.currentPageNb!=1) o.SetPage('first'); - else if(rowIndex > o.validRowsIndex[pagingEndRow-1] && rowIndex < o.validRowsIndex[o.validRowsIndex.length-1]) o.SetPage('next'); - else if(rowIndex < o.validRowsIndex[o.startPagingRow] && rowIndex > o.validRowsIndex[0]) o.SetPage('previous'); - } - } - } - - //Selected row needs to be visible when paging is activated - if(o.paging){ - o.onAfterChangePage = function(tf, i){ - var row = tf.ezEditTable.Selection.GetActiveRow(); - if(row) row.scrollIntoView(false); - var cell = tf.ezEditTable.Selection.GetActiveCell(); - if(cell) cell.scrollIntoView(false); - } - } - - //Rows navigation when rows are filtered is performed with the EditTable row selection callback events - if(o.ezEditTableConfig.default_selection=='row'){ - var fnB = o.ezEditTableConfig.on_before_selected_row; - o.ezEditTableConfig.on_before_selected_row = function(){ - onBeforeSelection(arguments[0], arguments[1], arguments[2]); - if(fnB) fnB.call(null, arguments[0], arguments[1], arguments[2]); - }; - var fnA = o.ezEditTableConfig.on_after_selected_row; - o.ezEditTableConfig.on_after_selected_row = function(){ - onAfterSelection(arguments[0], arguments[1], arguments[2]); - if(fnA) fnA.call(null, arguments[0], arguments[1], arguments[2]); - }; - } else { - var fnB = o.ezEditTableConfig.on_before_selected_cell; - o.ezEditTableConfig.on_before_selected_cell = function(){ - onBeforeSelection(arguments[0], arguments[1], arguments[2]); - if(fnB) fnB.call(null, arguments[0], arguments[1], arguments[2]); - }; - var fnA = o.ezEditTableConfig.on_after_selected_cell; - o.ezEditTableConfig.on_after_selected_cell = function(){ - onAfterSelection(arguments[0], arguments[1], arguments[2]); - if(fnA) fnA.call(null, arguments[0], arguments[1], arguments[2]); - }; - } - } - if(o.editable){ - //Added or removed rows, TF rows number needs to be re-calculated - var fnC = o.ezEditTableConfig.on_added_dom_row; - o.ezEditTableConfig.on_added_dom_row = function(){ - o.nbFilterableRows++; - if(!o.paging){ o.RefreshNbRows(); } - else { - o.nbRows++; o.nbVisibleRows++; o.nbFilterableRows++; - o.paging=false; o.RemovePaging(); o.AddPaging(false); - } - if(o.alternateBgs) o.SetAlternateRows(); - if(fnC) fnC.call(null, arguments[0], arguments[1], arguments[2]); - }; - if(o.ezEditTableConfig.actions && o.ezEditTableConfig.actions['delete']){ - var fnD = o.ezEditTableConfig.actions['delete'].on_after_submit; - o.ezEditTableConfig.actions['delete'].on_after_submit = function(){ - o.nbFilterableRows--; - if(!o.paging){ o.RefreshNbRows(); } - else { - o.nbRows--; o.nbVisibleRows--; o.nbFilterableRows--; - o.paging=false; o.RemovePaging(); o.AddPaging(false); - } - if(o.alternateBgs) o.SetAlternateRows(); - if(fnD) fnD.call(null, arguments[0], arguments[1]); - } - } - } - - try{ - o.ezEditTable = new EditTable(o.id, o.ezEditTableConfig, startRow); - o.ezEditTable.Init(); - } catch(e) { alert(o.ezEditTableConfig.err); } -} \ No newline at end of file diff --git a/dist/TF_Modules/tf_fixedHeaders.js b/dist/TF_Modules/tf_fixedHeaders.js deleted file mode 100644 index 2ab4659d..00000000 --- a/dist/TF_Modules/tf_fixedHeaders.js +++ /dev/null @@ -1,95 +0,0 @@ -/*------------------------------------------------------------------------ - - HTML Table Filter Generator - - Fixed headers feature v1.0 - Deprecated! - - By Max Guglielmi (tablefilter.free.fr) - - Licensed under the MIT License --------------------------------------------------------------------------*/ - -TF.prototype.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);'; - } -} - -TF.prototype.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; 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_'+this.id], - src:[this.gridColResizerPath], - description:['Columns Resizing'], - initialize:[function(o){ o.SetColsResizer('ColumnsResizer_'+o.id); }] - } - this.hasExtensions = true; - } else { - if(!this.__containsStr('colsresizer',this.extensions.src.toString().tf_LCase())){ - this.extensions.name.push('ColumnsResizer_'+this.id); - this.extensions.src.push(this.gridColResizerPath); - this.extensions.description.push('Columns Resizing'); - this.extensions.initialize.push(function(o){o.SetColsResizer('ColumnsResizer_'+o.id);}); - } - } - } - - //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'; - -} - -TF.prototype.RemoveGridLayout = function() -/*==================================================== - - removes the grid layout -=====================================================*/ -{ - 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; - - this.tbl.outerHTML = this.sourceTblHtml; - this.tbl = tf_Id(this.id); //needed to keep reference -} \ No newline at end of file diff --git a/dist/TF_Modules/tf_highlightKeywords.js b/dist/TF_Modules/tf_highlightKeywords.js deleted file mode 100644 index 4d59c6ac..00000000 --- a/dist/TF_Modules/tf_highlightKeywords.js +++ /dev/null @@ -1,97 +0,0 @@ -/*------------------------------------------------------------------------ - - HTML Table Filter Generator - - Highlight keywords feature v1.2 - - By Max Guglielmi (tablefilter.free.fr) - - Licensed under the MIT License --------------------------------------------------------------------------*/ - -TF.prototype.UnhighlightAll = function() -/*==================================================== - - removes keyword highlighting -=====================================================*/ -{ - if( this.highlightKeywords && this.searchArgs!=null ){ - for(var y=0; y'; //defines next page button text - this.btnPrevPageText = f.btn_prev_page_text!=undefined - ? f.btn_prev_page_text : '<'; //defines previous page button text - this.btnLastPageText = f.btn_last_page_text!=undefined - ? f.btn_last_page_text : '>|'; //defines last page button text - this.btnFirstPageText = f.btn_first_page_text!=undefined - ? f.btn_first_page_text : '|<' ; //defines first page button text - this.btnNextPageHtml = f.btn_next_page_html!=undefined //defines next page button html - ? f.btn_next_page_html : (!this.enableIcons ? null : - ''); - this.btnPrevPageHtml = f.btn_prev_page_html!=undefined //defines previous page button html - ? f.btn_prev_page_html : (!this.enableIcons ? null : - ''); - this.btnFirstPageHtml = f.btn_first_page_html!=undefined //defines last page button html - ? f.btn_first_page_html : (!this.enableIcons ? null : - ''); - this.btnLastPageHtml = f.btn_last_page_html!=undefined //defines previous page button html - ? f.btn_last_page_html : (!this.enableIcons ? null : - ''); - this.pageText = f.page_text!=undefined ? f.page_text : ' Page '; //defines text preceeding page selector drop-down - this.ofText = f.of_text!=undefined ? f.of_text : ' of '; //defines text after page selector drop-down - this.nbPgSpanCssClass = f.nb_pages_css_class!=undefined ? f.nb_pages_css_class :'nbpg'; //css class for span containing tot nb of pages - this.hasPagingBtns = f.paging_btns==false ? false : true; //enables/disables paging buttons - this.pagingBtnEvents = null; //stores paging buttons events - this.pageSelectorType = f.page_selector_type!=undefined - ? f.page_selector_type : this.fltTypeSlc; //defines previous page button html - this.onBeforeChangePage = tf_IsFn(f.on_before_change_page) ? f.on_before_change_page : null; //calls function before page is changed - this.onAfterChangePage = tf_IsFn(f.on_after_change_page) ? f.on_after_change_page : null; //calls function before page is changed - - var start_row = this.refRow; - var nrows = this.nbRows; - this.nbPages = Math.ceil( (nrows-start_row)/this.pagingLength );//calculates page nb - - //Paging elements events - if(!this.Evt._Paging.next) - { - var o = this; - this.Evt._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); - }, - last: function(){ - if(o.Evt._Paging.lastEvt) o.Evt._Paging.lastEvt(); - o.ChangePage(o.Evt._Paging.nbOpts()); - }, - first: function(){ - if(o.Evt._Paging.firstEvt) o.Evt._Paging.firstEvt(); - o.ChangePage(0); - }, - _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 - }, - nextEvt: null, - prevEvt: null, - lastEvt: null, - firstEvt: null - } - } - - if(!this.Evt._OnSlcPagesChange) - { - this.Evt._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(); - } - } - - // Paging drop-down list selector - if(this.pageSelectorType == this.fltTypeSlc) - { - var slcPages = tf_CreateElm( this.fltTypeSlc, ['id',this.prfxSlcPages+this.id] ); - slcPages.className = this.pgSlcCssClass; - slcPages.onchange = this.Evt._OnSlcPagesChange; - } - // Paging input selector - if(this.pageSelectorType == this.fltTypeInp) - { - var slcPages = tf_CreateElm( - this.fltTypeInp, - ['id',this.prfxSlcPages+this.id], - ['value',this.currentPageNb] - ); - slcPages.className = this.pgInpCssClass; - slcPages.onkeypress = this.Evt._Paging._detectKey; - } - - var btnNextSpan, btnPrevSpan, btnLastSpan, btnFirstSpan;// btns containers - btnNextSpan = tf_CreateElm('span',['id',this.prfxBtnNextSpan+this.id]); - btnPrevSpan = tf_CreateElm('span',['id',this.prfxBtnPrevSpan+this.id]); - btnLastSpan = tf_CreateElm('span',['id',this.prfxBtnLastSpan+this.id]); - btnFirstSpan = tf_CreateElm('span',['id',this.prfxBtnFirstSpan+this.id]); - - if(this.hasPagingBtns) - { - if(this.btnNextPageHtml==null) - {// Next button - var btn_next = tf_CreateElm( this.fltTypeInp,['id',this.prfxBtnNext+this.id], - ['type','button'],['value',this.btnNextPageText],['title','Next'] ); - btn_next.className = this.btnPageCssClass; - btn_next.onclick = this.Evt._Paging.next; - btnNextSpan.appendChild(btn_next); - } else { - btnNextSpan.innerHTML = this.btnNextPageHtml; - btnNextSpan.onclick = this.Evt._Paging.next; - } - - if(this.btnPrevPageHtml==null) - {// Previous button - var btn_prev = tf_CreateElm( this.fltTypeInp,['id',this.prfxBtnPrev+this.id], - ['type','button'],['value',this.btnPrevPageText],['title','Previous'] ); - btn_prev.className = this.btnPageCssClass; - btn_prev.onclick = this.Evt._Paging.prev; - btnPrevSpan.appendChild(btn_prev); - } else { - btnPrevSpan.innerHTML = this.btnPrevPageHtml; - btnPrevSpan.onclick = this.Evt._Paging.prev; - } - - if(this.btnLastPageHtml==null) - {// Last button - var btn_last = tf_CreateElm( this.fltTypeInp,['id',this.prfxBtnLast+this.id], - ['type','button'],['value',this.btnLastPageText],['title','Last'] ); - btn_last.className = this.btnPageCssClass; - btn_last.onclick = this.Evt._Paging.last; - btnLastSpan.appendChild(btn_last); - } else { - btnLastSpan.innerHTML = this.btnLastPageHtml; - btnLastSpan.onclick = this.Evt._Paging.last; - } - - if(this.btnFirstPageHtml==null) - {// First button - var btn_first = tf_CreateElm( this.fltTypeInp,['id',this.prfxBtnFirst+this.id], - ['type','button'],['value',this.btnFirstPageText],['title','First'] ); - btn_first.className = this.btnPageCssClass; - btn_first.onclick = this.Evt._Paging.first; - btnFirstSpan.appendChild(btn_first); - } else { - btnFirstSpan.innerHTML = this.btnFirstPageHtml; - btnFirstSpan.onclick = this.Evt._Paging.first; - } - }//if this.hasPagingBtns - - // paging elements (buttons+drop-down list) are added to defined element - if(this.pagingTgtId==null) this.SetTopDiv(); - var targetEl = ( this.pagingTgtId==null ) ? this.mDiv : tf_Id( this.pagingTgtId ); - - /*** if paging previously removed this prevents IE memory leak with removeChild - used in RemovePaging method. For more info refer to - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2840253&SiteID=1 ***/ - if ( targetEl.innerHTML!='' ) targetEl.innerHTML = ''; - /*** ***/ - - targetEl.appendChild(btnFirstSpan); - targetEl.appendChild(btnPrevSpan); - - var pgBeforeSpan = tf_CreateElm( 'span',['id',this.prfxPgBeforeSpan+this.id] ); - pgBeforeSpan.appendChild( tf_CreateText(this.pageText) ); - pgBeforeSpan.className = this.nbPgSpanCssClass; - targetEl.appendChild(pgBeforeSpan); - targetEl.appendChild(slcPages); - var pgAfterSpan = tf_CreateElm( 'span',['id',this.prfxPgAfterSpan+this.id] ); - pgAfterSpan.appendChild( tf_CreateText(this.ofText) ); - pgAfterSpan.className = this.nbPgSpanCssClass; - targetEl.appendChild(pgAfterSpan) - var pgspan = tf_CreateElm( 'span',['id',this.prfxPgSpan+this.id] ); - pgspan.className = this.nbPgSpanCssClass; - pgspan.appendChild( tf_CreateText(' '+this.nbPages+' ') ); - targetEl.appendChild(pgspan); - targetEl.appendChild(btnNextSpan); - targetEl.appendChild(btnLastSpan); - this.pagingSlc = tf_Id(this.prfxSlcPages+this.id); //to be easily re-used - - // if this.rememberGridValues==true this.SetPagingInfo() is called - // in ResetGridValues() method - if( !this.rememberGridValues || this.isPagingRemoved ) - this.SetPagingInfo(); - if( !this.fltGrid ) - { - this.ValidateAllRows(); - this.SetPagingInfo(this.validRowsIndex); - } - - this.pagingBtnEvents = this.Evt._Paging; - this.isPagingRemoved = false; -} - -TF.prototype.RemovePaging = function() -/*==================================================== - - Removes paging elements -=====================================================*/ -{ - if(!this.hasGrid) return; - if( this.pagingSlc==null ) return; - var btnNextSpan, btnPrevSpan, btnLastSpan, btnFirstSpan;// btns containers - var pgBeforeSpan, pgAfterSpan, pgspan; - btnNextSpan = tf_Id(this.prfxBtnNextSpan+this.id); - btnPrevSpan = tf_Id(this.prfxBtnPrevSpan+this.id); - btnLastSpan = tf_Id(this.prfxBtnLastSpan+this.id); - btnFirstSpan = tf_Id(this.prfxBtnFirstSpan+this.id); - pgBeforeSpan = tf_Id(this.prfxPgBeforeSpan+this.id);//span containing 'Page' text - pgAfterSpan = tf_Id(this.prfxPgAfterSpan+this.id);//span containing 'of' text - pgspan = tf_Id(this.prfxPgSpan+this.id);//span containing nb of pages - - this.pagingSlc.parentNode.removeChild(this.pagingSlc); - - if( btnNextSpan!=null ) - btnNextSpan.parentNode.removeChild( btnNextSpan ); - - if( btnPrevSpan!=null ) - btnPrevSpan.parentNode.removeChild( btnPrevSpan ); - - if( btnLastSpan!=null ) - btnLastSpan.parentNode.removeChild( btnLastSpan ); - - if( btnFirstSpan!=null ) - btnFirstSpan.parentNode.removeChild( btnFirstSpan ); - - if( pgBeforeSpan!=null ) - pgBeforeSpan.parentNode.removeChild( pgBeforeSpan ); - - if( pgAfterSpan!=null ) - pgAfterSpan.parentNode.removeChild( pgAfterSpan ); - - if( pgspan!=null ) - pgspan.parentNode.removeChild( pgspan ); - - this.pagingBtnEvents = null; - this.pagingSlc = null; - this.isPagingRemoved = true; -} - -TF.prototype.SetPagingInfo = function( validRows ) -/*==================================================== - - calculates page # according to valid rows - - refreshes paging select according to page # - - Calls GroupByPage method -=====================================================*/ -{ - var row = this.tbl.rows; - var mdiv = ( this.pagingTgtId==null ) ? this.mDiv : tf_Id( this.pagingTgtId ); - var pgspan = tf_Id(this.prfxPgSpan+this.id); - - if( validRows!=undefined ) this.validRowsIndex = validRows;//stores valid rows index - else - { - this.validRowsIndex = [];//re-sets valid rows index - - for(var j=this.refRow; j0 ) - { - mdiv.style.visibility = 'visible'; - if(this.pageSelectorType==this.fltTypeSlc) - for(var z=0; z