mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-04-25 11:40:47 +02:00
Continued TableFilter
This commit is contained in:
parent
34cc60ace9
commit
ed2f638bf2
4
dist/starter.html
vendored
4
dist/starter.html
vendored
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>tablefilter v0.2.53 - Starter</title>
|
||||
<title>tablefilter v0.2.54 - Starter</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>tablefilter v0.2.53</h1>
|
||||
<h1>tablefilter v0.2.54</h1>
|
||||
|
||||
|
||||
|
||||
|
|
4
dist/tablefilter/style/colsVisibility.css
vendored
4
dist/tablefilter/style/colsVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
span.colVisSpan{text-align:left;}span.colVisSpan a.colVis{display:inline-block;padding:7px 5px 0;font-size:inherit;font-weight:inherit;vertical-align:top}div.colVisCont{position:relative;background:#fff;-webkit-box-shadow:3px 3px 2px #888;-moz-box-shadow:3px 3px 2px #888;box-shadow:3px 3px 2px #888;position:absolute;display:none;border:1px solid #ccc;height:auto;width:250px;background-color:#fff;margin:35px 0 0 -100px;z-index:10000;padding:10px 10px 10px 10px;text-align:left;font-size:12px;}div.colVisCont:after,div.colVisCont:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.colVisCont:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:10px;margin-left:-10px}div.colVisCont:before{border-color:rgba(255,255,255,0);border-bottom-color:#ccc;border-width:12px;margin-left:-12px}div.colVisCont p{margin:6px auto 6px auto}div.colVisCont a.colVis{display:initial;font-weight:inherit}ul.cols_checklist{padding:0;margin:0;list-style:none;}ul.cols_checklist label{display:block}ul.cols_checklist input{vertical-align:middle;margin:2px 5px 2px 1px}li.cols_checklist_item{padding:4px;margin:0;}li.cols_checklist_item:hover{background-color:#335ea8;color:#fff}.cols_checklist_slc_item{background-color:#335ea8;color:#fff}
|
4
dist/tablefilter/style/filtersVisibility.css
vendored
4
dist/tablefilter/style/filtersVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
span.expClpFlt a.btnExpClpFlt{width:35px;height:35px;display:inline-block;}span.expClpFlt a.btnExpClpFlt:hover{background-color:#f4f4f4}span.expClpFlt img{padding:8px 11px 11px 11px}
|
4
dist/tablefilter/style/tablefilter.css
vendored
4
dist/tablefilter/style/tablefilter.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
.activeHeader{background-color:#66afe9 !important;color:#fff !important}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important}
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important}
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.269Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.085Z
|
||||
* MIT License
|
||||
*/
|
||||
table.TF{padding:0;color:#000;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-left:1px solid #a4bed4;border-bottom:0;}table.TF th{margin:0;color:inherit;background:#d1e5fe url("images/bg_skyblue.gif") 0 0 repeat-x;border-color:#fdfdfd #a4bed4 #a4bed4 #fdfdfd;border-width:1px;border-style:solid}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid #a4bed4;border-left:0;border-top:0;border-right:0}.fltrow{background-color:#d1e5fe !important;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4 !important}input.flt{width:99% !important}.inf{background-color:#e3efff !important;border:1px solid #a4bed4;height:$min-height;color:#004a6f}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#ffe4ab url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#ffe4ab url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#ffe4ab url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#ffe4ab url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.activeHeader{background:#ffe4ab !important;border:1px solid #ffb552 !important;color:inherit !important}div.grd_Cont{background-color:#d9eaed !important;border:1px solid #9cc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#e3efff}div.grd_headTblCont{background-color:#d9eaed !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#d9eaed url("images/bg_skyblue.gif") left top repeat-x;border-bottom:1px solid #a4bed4;border-right:1px solid #a4bed4 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #a4bed4 !important;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:#cce2fe;color:#004a6f;border-top:1px solid #9cc !important;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#2d8eef;border:1px solid #cce2fe;border-radius:5px}.even{background-color:#fff}.odd{background-color:#e3efff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ffdc61 !important;color:inherit}.ezSelectedRow{background-color:#ffe4ab !important;color:inherit}.ezActiveCell{background-color:#fff !important;color:#000 !important;font-weight:bold}.ezETSelectedCell{background-color:#fff !important;font-weight:bold;color:#000 !important}
|
12
dist/tablefilter/tablefilter.js
vendored
12
dist/tablefilter/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
4
dist/tablefilter/tf-1.js
vendored
4
dist/tablefilter/tf-1.js
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.53 by Max Guglielmi
|
||||
* build date: 2016-08-11T07:19:55.181Z
|
||||
* tablefilter v0.2.54 by Max Guglielmi
|
||||
* build date: 2016-08-14T04:09:44.069Z
|
||||
* MIT License
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tablefilter",
|
||||
"version": "0.2.53",
|
||||
"version": "0.2.54",
|
||||
"description": "A Javascript library making HTML tables filterable and a bit more",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
|
|
|
@ -162,7 +162,6 @@ export class CheckList extends Feature {
|
|||
//filter is appended in desired element
|
||||
if (externalFltTgtId) {
|
||||
elm(externalFltTgtId).appendChild(divCont);
|
||||
tf.externalFltEls.push(divCont);
|
||||
} else {
|
||||
container.appendChild(divCont);
|
||||
}
|
||||
|
|
|
@ -119,7 +119,6 @@ export class Dropdown extends Feature {
|
|||
//filter is appended in container element
|
||||
if (externalFltTgtId) {
|
||||
elm(externalFltTgtId).appendChild(slc);
|
||||
tf.externalFltEls.push(slc);
|
||||
} else {
|
||||
container.appendChild(slc);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, removeElm, elm, tag} from '../dom';
|
||||
import {isNull} from '../types';
|
||||
import {addEvt, targetEvt} from '../event';
|
||||
import {contains} from '../string';
|
||||
import {NONE} from '../const';
|
||||
|
@ -310,7 +309,7 @@ export class GridLayout extends Feature {
|
|||
*/
|
||||
setOverrides() {
|
||||
let tf = this.tf;
|
||||
tf.refRow = isNull(tf.startRow) ? 0 : tf.startRow;
|
||||
tf.refRow = 0;
|
||||
tf.headersRow = 0;
|
||||
tf.filtersRowIndex = 1;
|
||||
tf.isExternalFlt = true;
|
||||
|
|
|
@ -78,14 +78,6 @@ export class TableFilter {
|
|||
*/
|
||||
this.tbl = null;
|
||||
|
||||
/**
|
||||
* Index of the row from which starts filtering as per constructor's'
|
||||
* parameter
|
||||
* @type {Number}
|
||||
* @private
|
||||
*/
|
||||
this.startRow = null;
|
||||
|
||||
/**
|
||||
* Calculated row's index from which starts filtering once filters
|
||||
* are generated
|
||||
|
@ -121,6 +113,8 @@ export class TableFilter {
|
|||
*/
|
||||
this.nbCells = null;
|
||||
|
||||
let startRow;
|
||||
|
||||
// TODO: use for-of
|
||||
args.forEach((arg) => {
|
||||
if (typeof arg === 'object' && arg.nodeName === 'TABLE') {
|
||||
|
@ -130,7 +124,7 @@ export class TableFilter {
|
|||
this.id = arg;
|
||||
this.tbl = elm(arg);
|
||||
} else if (isNumber(arg)) {
|
||||
this.startRow = arg;
|
||||
startRow = arg;
|
||||
} else if (isObj(arg)) {
|
||||
this.cfg = arg;
|
||||
}
|
||||
|
@ -152,7 +146,7 @@ export class TableFilter {
|
|||
this.emitter = new Emitter();
|
||||
|
||||
//Start row et cols nb
|
||||
this.refRow = this.startRow === null ? 2 : (this.startRow + 1);
|
||||
this.refRow = isUndef(startRow) ? 2 : (startRow + 1);
|
||||
try { this.nbCells = this.getCellsNb(this.refRow); }
|
||||
catch (e) { this.nbCells = this.getCellsNb(0); }
|
||||
|
||||
|
@ -163,117 +157,322 @@ export class TableFilter {
|
|||
this.basePath = f.base_path || 'tablefilter/';
|
||||
|
||||
/*** filters' grid properties ***/
|
||||
//enables/disables filter grid
|
||||
|
||||
/**
|
||||
* Enable/disable filters
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.fltGrid = f.grid === false ? false : true;
|
||||
|
||||
//enables/disables grid layout (fixed headers)
|
||||
/**
|
||||
* Enable/disable grid layout (fixed headers)
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.gridLayout = Boolean(f.grid_layout);
|
||||
|
||||
/**
|
||||
* Filters row index
|
||||
* @type {Number}
|
||||
*/
|
||||
this.filtersRowIndex = isNaN(f.filters_row_index) ?
|
||||
0 : f.filters_row_index;
|
||||
|
||||
/**
|
||||
* Headers row index
|
||||
* @type {Number}
|
||||
*/
|
||||
this.headersRow = isNaN(f.headers_row_index) ?
|
||||
(this.filtersRowIndex === 0 ? 1 : 0) : f.headers_row_index;
|
||||
|
||||
//defines tag of the cells containing filters (td/th)
|
||||
/**
|
||||
* Define the type of cell containing a filter (td/th)
|
||||
* @type {String}
|
||||
*/
|
||||
this.fltCellTag = isString(f.filters_cell_tag) ?
|
||||
f.filters_cell_tag : CELL_TAG;
|
||||
|
||||
//stores filters ids
|
||||
/**
|
||||
* List of filters IDs
|
||||
* @type {Array}
|
||||
* @private
|
||||
*/
|
||||
this.fltIds = [];
|
||||
//stores valid rows indexes (rows visible upon filtering)
|
||||
|
||||
/**
|
||||
* List of valid rows indexes (rows visible upon filtering)
|
||||
* @type {Array}
|
||||
* @private
|
||||
*/
|
||||
this.validRowsIndex = [];
|
||||
//container div for paging elements, reset btn etc.
|
||||
|
||||
/**
|
||||
* Toolbar's container DOM element
|
||||
* @type {DOMElement}
|
||||
* @private
|
||||
*/
|
||||
this.infDiv = null;
|
||||
//div for rows counter
|
||||
|
||||
/**
|
||||
* Left-side inner container DOM element (rows counter in toolbar)
|
||||
* @type {DOMElement}
|
||||
* @private
|
||||
*/
|
||||
this.lDiv = null;
|
||||
//div for reset button and results per page select
|
||||
|
||||
/**
|
||||
* Right-side inner container DOM element (reset button,
|
||||
* page length selector in toolbar)
|
||||
* @type {DOMElement}
|
||||
* @private
|
||||
*/
|
||||
this.rDiv = null;
|
||||
//div for paging elements
|
||||
|
||||
/**
|
||||
* Middle inner container DOM element (paging elements in toolbar)
|
||||
* @type {DOMElement}
|
||||
* @private
|
||||
*/
|
||||
this.mDiv = null;
|
||||
|
||||
//defines css class for div containing paging elements, rows counter etc
|
||||
/**
|
||||
* Css class for toolbar's container DOM element
|
||||
* @type {String}
|
||||
*/
|
||||
this.infDivCssClass = f.inf_div_css_class || 'inf';
|
||||
//defines css class for left div
|
||||
|
||||
/**
|
||||
* Css class for left-side inner container DOM element
|
||||
* @type {String}
|
||||
*/
|
||||
this.lDivCssClass = f.left_div_css_class || 'ldiv';
|
||||
//defines css class for right div
|
||||
|
||||
/**
|
||||
* Css class for right-side inner container DOM element
|
||||
* @type {String}
|
||||
*/
|
||||
this.rDivCssClass = f.right_div_css_class || 'rdiv';
|
||||
//defines css class for mid div
|
||||
|
||||
/**
|
||||
* Css class for middle inner container DOM element
|
||||
* @type {String}
|
||||
*/
|
||||
this.mDivCssClass = f.middle_div_css_class || 'mdiv';
|
||||
//table container div css class
|
||||
this.contDivCssClass = f.content_div_css_class || 'cont';
|
||||
|
||||
/*** filters' grid appearance ***/
|
||||
//stylesheet file
|
||||
/**
|
||||
* Path for stylesheets
|
||||
* @type {String}
|
||||
*/
|
||||
this.stylePath = f.style_path || this.basePath + 'style/';
|
||||
|
||||
/**
|
||||
* Main stylesheet path
|
||||
* @type {String}
|
||||
*/
|
||||
this.stylesheet = f.stylesheet || this.stylePath + 'tablefilter.css';
|
||||
|
||||
/**
|
||||
* Main stylesheet ID
|
||||
* @type {String}
|
||||
* @private
|
||||
*/
|
||||
this.stylesheetId = this.id + '_style';
|
||||
//defines css class for filters row
|
||||
|
||||
/**
|
||||
* Css class for the filters row
|
||||
* @type {String}
|
||||
*/
|
||||
this.fltsRowCssClass = f.flts_row_css_class || 'fltrow';
|
||||
//enables/disables icons (paging, reset button)
|
||||
|
||||
/**
|
||||
* Enable/disable icons (paging, reset button)
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.enableIcons = f.enable_icons === false ? false : true;
|
||||
//enables/disbles rows alternating bg colors
|
||||
|
||||
/**
|
||||
* Enable/disable alternating rows
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.alternateRows = Boolean(f.alternate_rows);
|
||||
//defines widths of columns
|
||||
|
||||
/**
|
||||
* Indicate whether columns widths are set
|
||||
* @type {Boolean}
|
||||
* @private
|
||||
*/
|
||||
this.hasColWidths = isArray(f.col_widths);
|
||||
|
||||
/**
|
||||
* Columns widths array
|
||||
* @type {Array}
|
||||
*/
|
||||
this.colWidths = this.hasColWidths ? f.col_widths : [];
|
||||
//defines css class for filters
|
||||
|
||||
/**
|
||||
* Css class for a filter element
|
||||
* @type {String}
|
||||
*/
|
||||
this.fltCssClass = f.flt_css_class || 'flt';
|
||||
//defines css class for multiple selects filters
|
||||
|
||||
/**
|
||||
* Css class for multiple select filters
|
||||
* @type {String}
|
||||
*/
|
||||
this.fltMultiCssClass = f.flt_multi_css_class || 'flt_multi';
|
||||
//defines css class for filters
|
||||
|
||||
/**
|
||||
* Css class for small filter (when submit button is active)
|
||||
* @type {String}
|
||||
*/
|
||||
this.fltSmallCssClass = f.flt_small_css_class || 'flt_s';
|
||||
//defines css class for single-filter
|
||||
|
||||
/**
|
||||
* Css class for single filter type
|
||||
* @type {String}
|
||||
*/
|
||||
this.singleFltCssClass = f.single_flt_css_class || 'single_flt';
|
||||
|
||||
/*** filters' grid behaviours ***/
|
||||
//enables/disables enter key
|
||||
|
||||
/**
|
||||
* Enable/disable enter key for input type filters
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.enterKey = f.enter_key === false ? false : true;
|
||||
//calls function before filtering starts
|
||||
|
||||
/**
|
||||
* Callback fired before filtering process starts
|
||||
* @type {Function}
|
||||
*/
|
||||
this.onBeforeFilter = isFn(f.on_before_filter) ?
|
||||
f.on_before_filter : null;
|
||||
//calls function after filtering
|
||||
|
||||
/**
|
||||
* Callback fired after filtering process is completed
|
||||
* @type {Function}
|
||||
*/
|
||||
this.onAfterFilter = isFn(f.on_after_filter) ? f.on_after_filter : null;
|
||||
//enables/disables case sensitivity
|
||||
|
||||
/**
|
||||
* Enable/disable case sensitivity filtering
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.caseSensitive = Boolean(f.case_sensitive);
|
||||
//has exact match per column
|
||||
|
||||
/**
|
||||
* Indicate whether exact match filtering is enabled on a per column
|
||||
* basis
|
||||
* @type {Boolean}
|
||||
* @private
|
||||
*/
|
||||
this.hasExactMatchByCol = isArray(f.columns_exact_match);
|
||||
|
||||
/**
|
||||
* Exact match filtering per column array
|
||||
* @type {Array}
|
||||
*/
|
||||
this.exactMatchByCol = this.hasExactMatchByCol ?
|
||||
f.columns_exact_match : [];
|
||||
//enables/disbles exact match for search
|
||||
|
||||
/**
|
||||
* Globally enable/disable exact match filtering
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.exactMatch = Boolean(f.exact_match);
|
||||
//refreshes drop-down lists upon validation
|
||||
|
||||
/**
|
||||
* Enable/disable linked filters filtering mode
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.linkedFilters = Boolean(f.linked_filters);
|
||||
//wheter excluded options are disabled
|
||||
|
||||
/**
|
||||
* Enable/disable readonly state for excluded options when
|
||||
* linked filters filtering mode is on
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.disableExcludedOptions = Boolean(f.disable_excluded_options);
|
||||
//id of active filter
|
||||
|
||||
/**
|
||||
* Active filter ID
|
||||
* @type {String}
|
||||
* @private
|
||||
*/
|
||||
this.activeFilterId = null;
|
||||
//enables always visible rows
|
||||
|
||||
/**
|
||||
* Enable/disable always visible rows, excluded from filtering
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.hasVisibleRows = Boolean(f.rows_always_visible);
|
||||
//array containing always visible rows
|
||||
|
||||
/**
|
||||
* List of row indexes to be excluded from filtering
|
||||
* @type {Array}
|
||||
*/
|
||||
this.visibleRows = this.hasVisibleRows ? f.rows_always_visible : [];
|
||||
//enables/disables external filters generation
|
||||
|
||||
/**
|
||||
* Enable/disable external filters generation
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.isExternalFlt = Boolean(f.external_flt_grid);
|
||||
//array containing ids of external elements containing filters
|
||||
|
||||
/**
|
||||
* List of containers IDs where external filters will be generated
|
||||
* @type {Array}
|
||||
*/
|
||||
this.externalFltTgtIds = f.external_flt_grid_ids || [];
|
||||
//stores filters elements if isExternalFlt is true
|
||||
this.externalFltEls = [];
|
||||
//calls function when filters grid loaded
|
||||
|
||||
/**
|
||||
* Callback fired after filters are generated
|
||||
* @type {Function}
|
||||
*/
|
||||
this.onFiltersLoaded = isFn(f.on_filters_loaded) ?
|
||||
f.on_filters_loaded : null;
|
||||
//enables/disables single filter search
|
||||
|
||||
/**
|
||||
* Enable/disable single filter filtering all columns
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.singleSearchFlt = Boolean(f.single_filter);
|
||||
//calls function after row is validated
|
||||
|
||||
/**
|
||||
* Callback fired after a row is validated during filtering
|
||||
* @type {Function}
|
||||
*/
|
||||
this.onRowValidated = isFn(f.on_row_validated) ?
|
||||
f.on_row_validated : null;
|
||||
//array defining columns for customCellData event
|
||||
|
||||
/**
|
||||
* List of columns implementing custom filtering
|
||||
* @type {Array}
|
||||
*/
|
||||
this.customCellDataCols = f.custom_cell_data_cols ?
|
||||
f.custom_cell_data_cols : [];
|
||||
//calls custom function for retrieving cell data
|
||||
|
||||
/**
|
||||
* Delegate function for retrieving cell data with custom logic
|
||||
* @type {Function}
|
||||
*/
|
||||
this.customCellData = isFn(f.custom_cell_data) ?
|
||||
f.custom_cell_data : null;
|
||||
//input watermark text array
|
||||
|
||||
/**
|
||||
* Global watermark text for input filter type or watermark for each
|
||||
* filter if an array is supplied
|
||||
* @type {String|Array}
|
||||
*/
|
||||
this.watermark = f.watermark || '';
|
||||
|
||||
/**
|
||||
* Indicate whether watermark is on a per column basis
|
||||
* @type {Boolean}
|
||||
* @private
|
||||
*/
|
||||
this.isWatermarkArray = isArray(this.watermark);
|
||||
|
||||
//id of toolbar container element
|
||||
this.toolBarTgtId = f.toolbar_target_id || null;
|
||||
//enables/disables help div
|
||||
|
@ -790,7 +989,6 @@ export class TableFilter {
|
|||
//filter is appended in custom element
|
||||
if (externalFltTgtId) {
|
||||
elm(externalFltTgtId).appendChild(inp);
|
||||
this.externalFltEls.push(inp);
|
||||
} else {
|
||||
container.appendChild(inp);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ test('GridLayout component', function() {
|
|||
notEqual(gridLayout.headTblCont, null,
|
||||
'GridLayout headers container element');
|
||||
notEqual(gridLayout.headTbl, null, 'GridLayout headers HTML table');
|
||||
deepEqual(tf.startRow, null, 'Optional startRow row index');
|
||||
deepEqual(tf.refRow, 0, 'Reference row index');
|
||||
deepEqual(tf.headersRow, 0, 'Headers row index');
|
||||
deepEqual(tf.filtersRowIndex, 1, 'Filters row index');
|
||||
|
|
Loading…
Reference in a new issue