mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-13 20:06:59 +02:00
Refactored dom module
This commit is contained in:
parent
9fec6eb6ef
commit
7d84c7d09e
4
dist/starter.html
vendored
4
dist/starter.html
vendored
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>tablefilter v0.2.30 - Starter</title>
|
||||
<title>tablefilter v0.2.31 - Starter</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>tablefilter v0.2.30</h1>
|
||||
<h1>tablefilter v0.2.31</h1>
|
||||
|
||||
|
||||
|
||||
|
|
2
dist/tablefilter/style/colsVisibility.css
vendored
2
dist/tablefilter/style/colsVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* 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}
|
2
dist/tablefilter/style/filtersVisibility.css
vendored
2
dist/tablefilter/style/filtersVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* 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}
|
2
dist/tablefilter/style/tablefilter.css
vendored
2
dist/tablefilter/style/tablefilter.css
vendored
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* MIT License
|
||||
*/
|
||||
.activeHeader{background-color:#66afe9 !important;color:#fff !important}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* tablefilter v0.2.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* 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.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* 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.31 by Max Guglielmi
|
||||
* build date: 2016-05-24T08:24:39.404Z
|
||||
* build date: 2016-05-25T07:15:37.876Z
|
||||
* 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}
|
8136
dist/tablefilter/tablefilter.js
vendored
8136
dist/tablefilter/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
2351
dist/tablefilter/tf-1.js
vendored
2351
dist/tablefilter/tf-1.js
vendored
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,13 @@
|
|||
|
||||
import {matchCase} from './string';
|
||||
|
||||
/**
|
||||
* Checks if given item can be found in the passed collection
|
||||
* @param {Array} arr collection
|
||||
* @param {Any} val item to search
|
||||
* @param {Boolean} caseSensitive respects case if true
|
||||
* @return {Boolean}
|
||||
*/
|
||||
export const has = (arr, val, caseSensitive) => {
|
||||
let sCase = Boolean(caseSensitive);
|
||||
for (var i = 0, l = arr.length; i < l; i++) {
|
||||
|
|
12
src/date.js
12
src/date.js
|
@ -2,6 +2,12 @@
|
|||
* Date utilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* Verifies passed formatted date string is valid
|
||||
* @param {String} dateStr Formatted date string
|
||||
* @param {String} format accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'
|
||||
* @return {Boolean}
|
||||
*/
|
||||
export const isValidDate = (dateStr, format) => {
|
||||
if (!format) {
|
||||
format = 'DMY';
|
||||
|
@ -79,6 +85,12 @@ export const isValidDate = (dateStr, format) => {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts formatted date into a Date object
|
||||
* @param {String} dateStr Formatted date string
|
||||
* @param {String} format accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'
|
||||
* @return {Object} date object
|
||||
*/
|
||||
export const formatDate = (dateStr, formatStr) => {
|
||||
if (!formatStr) {
|
||||
formatStr = 'DMY';
|
||||
|
|
76
src/dom.js
76
src/dom.js
|
@ -1,11 +1,12 @@
|
|||
import {isUndef} from './types';
|
||||
import {root} from './root';
|
||||
import {isArray, isString, isUndef} from './types';
|
||||
import {trim} from './string';
|
||||
|
||||
/**
|
||||
* DOM utilities
|
||||
*/
|
||||
|
||||
// export default {
|
||||
const doc = root.document;
|
||||
|
||||
/**
|
||||
* Returns text + text of children of given node
|
||||
|
@ -40,22 +41,21 @@ export const getFirstTextNode = node => {
|
|||
* items, the attribute name and its value ['id','myId']
|
||||
* @return {Object} created element
|
||||
*/
|
||||
export const createElm = tag => {
|
||||
if (isUndef(tag)) {
|
||||
return;
|
||||
export const createElm = (...args) => {
|
||||
let tag = args[0];
|
||||
if (!isString(tag)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let el = document.createElement(tag),
|
||||
args = arguments;
|
||||
let el = doc.createElement(tag);
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
let arg = args[i];
|
||||
|
||||
if (args.length > 1) {
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
let argtype = typeof args[i];
|
||||
if (argtype === 'object' && args[i].length === 2) {
|
||||
el.setAttribute(args[i][0], args[i][1]);
|
||||
}
|
||||
if (isArray(arg) && arg.length === 2) {
|
||||
el.setAttribute(arg[0], arg[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
|
@ -71,10 +71,18 @@ export const removeElm = node => node.parentNode.removeChild(node);
|
|||
* @param {String} txt
|
||||
* @return {Object}
|
||||
*/
|
||||
export const createText = txt => document.createTextNode(txt);
|
||||
export const createText = txt => doc.createTextNode(txt);
|
||||
|
||||
/**
|
||||
* Determine whether the passed elements is assigned the given class
|
||||
* @param {DOMElement} ele DOM element
|
||||
* @param {String} cls CSS class name
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
export const hasClass = (ele, cls) => {
|
||||
if (!ele) { return false; }
|
||||
if (isUndef(ele)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (supportsClassList()) {
|
||||
return ele.classList.contains(cls);
|
||||
|
@ -82,8 +90,15 @@ export const hasClass = (ele, cls) => {
|
|||
return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified class to the passed element
|
||||
* @param {DOMElement} ele DOM element
|
||||
* @param {String} cls CSS class name
|
||||
*/
|
||||
export const addClass = (ele, cls) => {
|
||||
if (!ele) { return; }
|
||||
if (isUndef(ele)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (supportsClassList()) {
|
||||
ele.classList.add(cls);
|
||||
|
@ -98,8 +113,15 @@ export const addClass = (ele, cls) => {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified class to the passed element
|
||||
* @param {DOMElement} ele DOM element
|
||||
* @param {String} cls CSS class name
|
||||
*/
|
||||
export const removeClass = (ele, cls) => {
|
||||
if (!ele) { return; }
|
||||
if (isUndef(ele)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (supportsClassList()) {
|
||||
ele.classList.remove(cls);
|
||||
|
@ -117,8 +139,8 @@ export const removeClass = (ele, cls) => {
|
|||
* @return {Object} option element
|
||||
*/
|
||||
export const createOpt = (text, value, isSel) => {
|
||||
let isSelected = isSel ? true : false,
|
||||
opt = isSelected ?
|
||||
let isSelected = isSel ? true : false;
|
||||
let opt = isSelected ?
|
||||
createElm('option', ['value', value], ['selected', 'true']) :
|
||||
createElm('option', ['value', value]);
|
||||
opt.appendChild(createText(text));
|
||||
|
@ -149,13 +171,21 @@ export const createCheckItem = (chkIndex, chkValue, labelText) => {
|
|||
return li;
|
||||
}
|
||||
|
||||
export const byId = key => document.getElementById(key);
|
||||
/**
|
||||
* Returns the element matching the supplied Id
|
||||
* @param {String} id Element identifier
|
||||
* @return {DOMElement}
|
||||
*/
|
||||
export const elm = id => doc.getElementById(id);
|
||||
|
||||
/**
|
||||
* Returns list of element matching the supplied tag name
|
||||
* @param {String} tagname Tag name
|
||||
* @return {NodeList}
|
||||
*/
|
||||
export const tag = (o, tagname) => o.getElementsByTagName(tagname);
|
||||
|
||||
// };
|
||||
|
||||
// HTML5 classList API
|
||||
function supportsClassList() {
|
||||
return document.documentElement.classList;
|
||||
return doc.documentElement.classList;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../../feature';
|
||||
import {createText, byId} from '../../dom';
|
||||
import {createText, elm} from '../../dom';
|
||||
import {isArray, isFn, isUndef} from '../../types';
|
||||
|
||||
export default class ColOps extends Feature {
|
||||
|
@ -268,24 +268,24 @@ export default class ColOps extends Feature {
|
|||
if (oTypeThisCol && result) {
|
||||
result = result.toFixed(precision);
|
||||
|
||||
if (byId(labThisCol[i])) {
|
||||
if (elm(labThisCol[i])) {
|
||||
switch (oTypeThisCol.toLowerCase()) {
|
||||
case 'innerhtml':
|
||||
if (isNaN(result) || !isFinite(result) ||
|
||||
nbvalues === 0) {
|
||||
byId(labThisCol[i]).innerHTML = '.';
|
||||
elm(labThisCol[i]).innerHTML = '.';
|
||||
} else {
|
||||
byId(labThisCol[i]).innerHTML = result;
|
||||
elm(labThisCol[i]).innerHTML = result;
|
||||
}
|
||||
break;
|
||||
case 'setvalue':
|
||||
byId(labThisCol[i]).value = result;
|
||||
elm(labThisCol[i]).value = result;
|
||||
break;
|
||||
case 'createtextnode':
|
||||
var oldnode =
|
||||
byId(labThisCol[i]).firstChild;
|
||||
elm(labThisCol[i]).firstChild;
|
||||
var txtnode = createText(result);
|
||||
byId(labThisCol[i])
|
||||
elm(labThisCol[i])
|
||||
.replaceChild(txtnode, oldnode);
|
||||
break;
|
||||
}//switch
|
||||
|
@ -294,9 +294,9 @@ export default class ColOps extends Feature {
|
|||
try {
|
||||
if (isNaN(result) || !isFinite(result) ||
|
||||
nbvalues === 0) {
|
||||
byId(labThisCol[i]).innerHTML = '.';
|
||||
elm(labThisCol[i]).innerHTML = '.';
|
||||
} else {
|
||||
byId(labThisCol[i]).innerHTML =
|
||||
elm(labThisCol[i]).innerHTML =
|
||||
result.toFixed(precision);
|
||||
}
|
||||
} catch (e) { }//catch
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import {Feature} from '../../feature';
|
||||
import {addClass, removeClass, createElm, byId, removeElm, getText, tag}
|
||||
from '../../dom';
|
||||
import {
|
||||
addClass, removeClass, createCheckItem, createElm, elm, removeElm,
|
||||
getText, tag
|
||||
} from '../../dom';
|
||||
import {isFn} from '../../types';
|
||||
import Event from '../../event';
|
||||
|
||||
|
@ -202,7 +204,7 @@ export default class ColsVisibility extends Feature {
|
|||
if (!this.btnTgtId) {
|
||||
tf.setToolbar();
|
||||
}
|
||||
let targetEl = !this.btnTgtId ? tf.rDiv : byId(this.btnTgtId);
|
||||
let targetEl = !this.btnTgtId ? tf.rDiv : elm(this.btnTgtId);
|
||||
|
||||
if (!this.btnTgtId) {
|
||||
let firstChild = targetEl.firstChild;
|
||||
|
@ -249,7 +251,7 @@ export default class ColsVisibility extends Feature {
|
|||
|
||||
let container = !this.contElTgtId ?
|
||||
createElm('div', ['id', this.prfxCont + tf.id]) :
|
||||
byId(this.contElTgtId);
|
||||
elm(this.contElTgtId);
|
||||
container.className = this.contCssClass;
|
||||
|
||||
//Extension description
|
||||
|
@ -276,7 +278,7 @@ export default class ColsVisibility extends Feature {
|
|||
|
||||
Event.add(li.check, 'click', () => {
|
||||
for (let h = 0; h < headerRow.cells.length; h++) {
|
||||
let itm = byId('col_' + h + '_' + tf.id);
|
||||
let itm = elm('col_' + h + '_' + tf.id);
|
||||
if (itm && li.check.checked !== itm.checked) {
|
||||
itm.click();
|
||||
itm.checked = li.check.checked;
|
||||
|
@ -420,7 +422,7 @@ export default class ColsVisibility extends Feature {
|
|||
return;
|
||||
}
|
||||
if (this.manager && this.contEl) {
|
||||
let itm = byId('col_' + colIndex + '_' + this.tf.id);
|
||||
let itm = elm('col_' + colIndex + '_' + this.tf.id);
|
||||
if (itm) {
|
||||
itm.click();
|
||||
}
|
||||
|
@ -438,7 +440,7 @@ export default class ColsVisibility extends Feature {
|
|||
return;
|
||||
}
|
||||
if (this.manager && this.contEl) {
|
||||
let itm = byId('col_' + colIndex + '_' + this.tf.id);
|
||||
let itm = elm('col_' + colIndex + '_' + this.tf.id);
|
||||
if (itm) {
|
||||
itm.click();
|
||||
}
|
||||
|
@ -485,8 +487,8 @@ export default class ColsVisibility extends Feature {
|
|||
if (!this.initialized) {
|
||||
return;
|
||||
}
|
||||
if (byId(this.contElTgtId)) {
|
||||
byId(this.contElTgtId).innerHTML = '';
|
||||
if (elm(this.contElTgtId)) {
|
||||
elm(this.contElTgtId).innerHTML = '';
|
||||
} else {
|
||||
this.contEl.innerHTML = '';
|
||||
removeElm(this.contEl);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../../feature';
|
||||
import {createElm, removeElm, byId} from '../../dom';
|
||||
import {createElm, removeElm, elm} from '../../dom';
|
||||
import {isFn, isUndef} from '../../types';
|
||||
import Event from '../../event';
|
||||
|
||||
|
@ -103,7 +103,7 @@ export default class FiltersVisibility extends Feature {
|
|||
if (!this.targetId) {
|
||||
tf.setToolbar();
|
||||
}
|
||||
let targetEl = !this.targetId ? tf.rDiv : byId(this.targetId);
|
||||
let targetEl = !this.targetId ? tf.rDiv : elm(this.targetId);
|
||||
|
||||
if (!this.targetId) {
|
||||
let firstChild = targetEl.firstChild;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Feature} from '../../feature';
|
||||
import {isArray, isFn, isUndef} from '../../types';
|
||||
import {createElm, byId, getText, tag} from '../../dom';
|
||||
import {createElm, elm, getText, tag} from '../../dom';
|
||||
import Event from '../../event';
|
||||
import {formatDate} from '../../date';
|
||||
import {removeNbFormat} from '../../helpers';
|
||||
|
@ -214,7 +214,7 @@ export default class AdapterSortableTable extends Feature {
|
|||
cells = [];
|
||||
l = triggers.length;
|
||||
for (let j = 0; j < triggers.length; j++) {
|
||||
cells.push(byId(triggers[j]));
|
||||
cells.push(elm(triggers[j]));
|
||||
}
|
||||
} else {
|
||||
if (!this.tHead) {
|
||||
|
@ -335,7 +335,7 @@ export default class AdapterSortableTable extends Feature {
|
|||
if (triggers[j] === null) {
|
||||
continue;
|
||||
}
|
||||
let trigger = byId(triggers[j]);
|
||||
let trigger = elm(triggers[j]);
|
||||
if (trigger) {
|
||||
trigger.style.cursor = 'pointer';
|
||||
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
* Misc helpers
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a unformatted number
|
||||
* @param {String} Formatted number
|
||||
* @param {String} Format type, currently 'us' or 'eu'
|
||||
* @return {String} Unformatted number
|
||||
*/
|
||||
export const removeNbFormat = (data, format) => {
|
||||
if (!data) {
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {Feature} from '../feature';
|
||||
import {
|
||||
addClass, createCheckItem, createText, createElm, byId, removeClass, tag
|
||||
addClass, createCheckItem, createText, createElm, elm, getText,
|
||||
removeClass, tag
|
||||
} from '../dom';
|
||||
import {has} from '../array';
|
||||
import {matchCase, trim, rgxEsc} from '../string';
|
||||
|
@ -94,7 +95,7 @@ export class CheckList extends Feature {
|
|||
|
||||
//filter is appended in desired element
|
||||
if (externalFltTgtId) {
|
||||
byId(externalFltTgtId).appendChild(divCont);
|
||||
elm(externalFltTgtId).appendChild(divCont);
|
||||
tf.externalFltEls.push(divCont);
|
||||
} else {
|
||||
container.appendChild(divCont);
|
||||
|
@ -373,7 +374,7 @@ export class CheckList extends Feature {
|
|||
//checked items loop
|
||||
for (let u = 0; u < indSplit.length; u++) {
|
||||
//checked item
|
||||
let cChk = byId(tf.fltIds[colIndex] + '_' +
|
||||
let cChk = elm(tf.fltIds[colIndex] + '_' +
|
||||
indSplit[u]);
|
||||
if (cChk) {
|
||||
cChk.checked = false;
|
||||
|
@ -393,8 +394,8 @@ export class CheckList extends Feature {
|
|||
n.setAttribute('value', chkValue);
|
||||
n.setAttribute('indexes', chkIndex);
|
||||
//1st option unchecked
|
||||
if (byId(tf.fltIds[colIndex] + '_0')) {
|
||||
byId(tf.fltIds[colIndex] + '_0').checked = false;
|
||||
if (elm(tf.fltIds[colIndex] + '_0')) {
|
||||
elm(tf.fltIds[colIndex] + '_0').checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createText, elm, removeElm} from '../dom';
|
||||
import Event from '../event';
|
||||
|
||||
export class ClearButton extends Feature {
|
||||
|
@ -54,11 +54,11 @@ export class ClearButton extends Feature {
|
|||
if (!this.btnResetTgtId) {
|
||||
tf.setToolbar();
|
||||
}
|
||||
let targetEl = !this.btnResetTgtId ? tf.rDiv : id(this.btnResetTgtId);
|
||||
let targetEl = !this.btnResetTgtId ? tf.rDiv : elm(this.btnResetTgtId);
|
||||
targetEl.appendChild(resetspan);
|
||||
|
||||
if (!this.btnResetHtml) {
|
||||
let fltreset = createElm('a', ['href', 'javascript:void(0);']);
|
||||
let fltreset = createElm('a', ['href', 'javascript:voelm(0);']);
|
||||
fltreset.className = tf.btnResetCssClass;
|
||||
fltreset.appendChild(createText(this.btnResetText));
|
||||
resetspan.appendChild(fltreset);
|
||||
|
@ -83,7 +83,7 @@ export class ClearButton extends Feature {
|
|||
return;
|
||||
}
|
||||
|
||||
let resetspan = id(this.prfxResetSpan + tf.id);
|
||||
let resetspan = elm(this.prfxResetSpan + tf.id);
|
||||
if (resetspan) {
|
||||
removeElm(resetspan);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createOpt, id} from '../dom';
|
||||
import {createElm, createOpt, elm} from '../dom';
|
||||
import {has} from '../array';
|
||||
import {matchCase} from '../string';
|
||||
import {ignoreCase, numSortAsc, numSortDesc} from '../sort';
|
||||
|
@ -81,7 +81,7 @@ export class Dropdown extends Feature {
|
|||
|
||||
//filter is appended in container element
|
||||
if (externalFltTgtId) {
|
||||
id(externalFltTgtId).appendChild(slc);
|
||||
elm(externalFltTgtId).appendChild(slc);
|
||||
tf.externalFltEls.push(slc);
|
||||
} else {
|
||||
container.appendChild(slc);
|
||||
|
@ -129,7 +129,7 @@ export class Dropdown extends Feature {
|
|||
this.slcInnerHtml = '';
|
||||
|
||||
let slcId = tf.fltIds[colIndex];
|
||||
let slc = id(slcId);
|
||||
let slc = elm(slcId);
|
||||
let rows = tf.tbl.rows;
|
||||
let nbRows = tf.getRowsNb(true);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, removeElm, id, tag} from '../dom';
|
||||
import {createElm, removeElm, elm, tag} from '../dom';
|
||||
import {isFn, isNull, isUndef} from '../types';
|
||||
import Event from '../event';
|
||||
import {contains} from '../string';
|
||||
|
@ -343,7 +343,7 @@ export class GridLayout extends Feature {
|
|||
|
||||
tbl.outerHTML = this.sourceTblHtml;
|
||||
//needed to keep reference of table element for future usage
|
||||
this.tf.tbl = id(tf.id);
|
||||
this.tf.tbl = elm(tf.id);
|
||||
|
||||
this.initialized = false;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createText, elm, removeElm} from '../dom';
|
||||
import Event from '../event';
|
||||
import {NONE} from '../const';
|
||||
|
||||
|
@ -77,10 +77,10 @@ export class Help extends Feature{
|
|||
if(!this.tgtId){
|
||||
tf.setToolbar();
|
||||
}
|
||||
var targetEl = !this.tgtId ? tf.rDiv : id(this.tgtId);
|
||||
var targetEl = !this.tgtId ? tf.rDiv : elm(this.tgtId);
|
||||
targetEl.appendChild(helpspan);
|
||||
|
||||
var divContainer = !this.contTgtId ? helpspan : id(this.contTgtId);
|
||||
var divContainer = !this.contTgtId ? helpspan : elm(this.contTgtId);
|
||||
|
||||
if(!this.btnHtml){
|
||||
divContainer.appendChild(helpdiv);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createText, elm, removeElm} from '../dom';
|
||||
import {isFn} from '../types';
|
||||
import {root} from '../root';
|
||||
import {NONE} from '../const';
|
||||
|
@ -48,7 +48,7 @@ export class Loader extends Feature {
|
|||
containerDiv.className = this.loaderCssClass;
|
||||
|
||||
let targetEl = !this.loaderTgtId ?
|
||||
tf.tbl.parentNode : id(this.loaderTgtId);
|
||||
tf.tbl.parentNode : elm(this.loaderTgtId);
|
||||
if (!this.loaderTgtId) {
|
||||
targetEl.insertBefore(containerDiv, tf.tbl);
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, id, removeElm} from '../dom';
|
||||
import {createElm, elm, removeElm} from '../dom';
|
||||
import {isEmpty, isFn} from '../types';
|
||||
import {NONE} from '../const';
|
||||
|
||||
|
@ -45,7 +45,7 @@ export class NoResults extends Feature {
|
|||
return;
|
||||
}
|
||||
let tf = this.tf;
|
||||
let target = this.customContainer || id(this.customContainerId) ||
|
||||
let target = this.customContainer || elm(this.customContainerId) ||
|
||||
tf.tbl;
|
||||
|
||||
//container
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createOpt, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createOpt, createText, elm, removeElm} from '../dom';
|
||||
import {isArray, isFn, isNull} from '../types';
|
||||
import Event from '../event';
|
||||
import {INPUT, SELECT, NONE, ENTER_KEY} from '../const';
|
||||
|
@ -297,7 +297,7 @@ export class Paging extends Feature {
|
|||
if (!this.pagingTgtId) {
|
||||
tf.setToolbar();
|
||||
}
|
||||
var targetEl = !this.pagingTgtId ? tf.mDiv : id(this.pagingTgtId);
|
||||
var targetEl = !this.pagingTgtId ? tf.mDiv : elm(this.pagingTgtId);
|
||||
targetEl.appendChild(btnFirstSpan);
|
||||
targetEl.appendChild(btnPrevSpan);
|
||||
|
||||
|
@ -318,7 +318,7 @@ export class Paging extends Feature {
|
|||
targetEl.appendChild(pgspan);
|
||||
targetEl.appendChild(btnNextSpan);
|
||||
targetEl.appendChild(btnLastSpan);
|
||||
this.pagingSlc = id(this.prfxSlcPages + tf.id);
|
||||
this.pagingSlc = elm(this.prfxSlcPages + tf.id);
|
||||
|
||||
this.setPagingInfo();
|
||||
|
||||
|
@ -369,8 +369,8 @@ export class Paging extends Feature {
|
|||
*/
|
||||
setPagingInfo(validRows) {
|
||||
var tf = this.tf;
|
||||
var mdiv = !this.pagingTgtId ? tf.mDiv : id(this.pagingTgtId);
|
||||
var pgspan = id(this.prfxPgSpan + tf.id);
|
||||
var mdiv = !this.pagingTgtId ? tf.mDiv : elm(this.pagingTgtId);
|
||||
var pgspan = elm(this.prfxPgSpan + tf.id);
|
||||
|
||||
//store valid rows indexes
|
||||
tf.validRowsIndex = validRows || tf.getValidRows(true);
|
||||
|
@ -515,7 +515,7 @@ export class Paging extends Feature {
|
|||
tf.setToolbar();
|
||||
}
|
||||
var targetEl = !this.resultsPerPageTgtId ?
|
||||
tf.rDiv : id(this.resultsPerPageTgtId);
|
||||
tf.rDiv : elm(this.resultsPerPageTgtId);
|
||||
slcRSpan.appendChild(createText(slcRText));
|
||||
|
||||
var help = tf.feature('help');
|
||||
|
@ -544,7 +544,7 @@ export class Paging extends Feature {
|
|||
return;
|
||||
}
|
||||
var slcR = this.resultsPerPageSlc,
|
||||
slcRSpan = id(this.prfxSlcResultsTxt + tf.id);
|
||||
slcRSpan = elm(this.prfxSlcResultsTxt + tf.id);
|
||||
if (slcR) {
|
||||
removeElm(slcR);
|
||||
}
|
||||
|
@ -685,16 +685,16 @@ export class Paging extends Feature {
|
|||
return;
|
||||
}
|
||||
// btns containers
|
||||
var btnNextSpan = id(this.prfxBtnNextSpan + tf.id);
|
||||
var btnPrevSpan = id(this.prfxBtnPrevSpan + tf.id);
|
||||
var btnLastSpan = id(this.prfxBtnLastSpan + tf.id);
|
||||
var btnFirstSpan = id(this.prfxBtnFirstSpan + tf.id);
|
||||
var btnNextSpan = elm(this.prfxBtnNextSpan + tf.id);
|
||||
var btnPrevSpan = elm(this.prfxBtnPrevSpan + tf.id);
|
||||
var btnLastSpan = elm(this.prfxBtnLastSpan + tf.id);
|
||||
var btnFirstSpan = elm(this.prfxBtnFirstSpan + tf.id);
|
||||
//span containing 'Page' text
|
||||
var pgBeforeSpan = id(this.prfxPgBeforeSpan + tf.id);
|
||||
var pgBeforeSpan = elm(this.prfxPgBeforeSpan + tf.id);
|
||||
//span containing 'of' text
|
||||
var pgAfterSpan = id(this.prfxPgAfterSpan + tf.id);
|
||||
var pgAfterSpan = elm(this.prfxPgAfterSpan + tf.id);
|
||||
//span containing nb of pages
|
||||
var pgspan = id(this.prfxPgSpan + tf.id);
|
||||
var pgspan = elm(this.prfxPgSpan + tf.id);
|
||||
|
||||
var evt = this.evt;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Feature} from '../feature';
|
||||
import {createElm, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createText, elm, removeElm} from '../dom';
|
||||
import {isFn} from '../types';
|
||||
|
||||
export class RowsCounter extends Feature {
|
||||
|
@ -60,7 +60,7 @@ export class RowsCounter extends Feature {
|
|||
tf.setToolbar();
|
||||
}
|
||||
var targetEl = !this.rowsCounterTgtId ?
|
||||
tf.lDiv : id(this.rowsCounterTgtId);
|
||||
tf.lDiv : elm(this.rowsCounterTgtId);
|
||||
|
||||
//default container: 'lDiv'
|
||||
if (!this.rowsCounterTgtId) {
|
||||
|
@ -134,7 +134,7 @@ export class RowsCounter extends Feature {
|
|||
if (!this.rowsCounterTgtId && this.rowsCounterDiv) {
|
||||
removeElm(this.rowsCounterDiv);
|
||||
} else {
|
||||
id(this.rowsCounterTgtId).innerHTML = '';
|
||||
elm(this.rowsCounterTgtId).innerHTML = '';
|
||||
}
|
||||
this.rowsCounterSpan = null;
|
||||
this.rowsCounterDiv = null;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Feature} from '../feature';
|
||||
import {root} from '../root';
|
||||
import {createElm, createText, id, removeElm} from '../dom';
|
||||
import {createElm, createText, elm, removeElm} from '../dom';
|
||||
import {isFn} from '../types';
|
||||
|
||||
export class StatusBar extends Feature {
|
||||
|
@ -96,7 +96,7 @@ export class StatusBar extends Feature {
|
|||
tf.setToolbar();
|
||||
}
|
||||
let targetEl = (!this.statusBarTgtId) ?
|
||||
tf.lDiv : id(this.statusBarTgtId);
|
||||
tf.lDiv : elm(this.statusBarTgtId);
|
||||
|
||||
//default container: 'lDiv'
|
||||
if (!this.statusBarTgtId) {
|
||||
|
|
20
src/sort.js
20
src/sort.js
|
@ -2,12 +2,32 @@
|
|||
* Sorting utilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* Case insensitive compare function for passed strings
|
||||
* @param {String} First string
|
||||
* @param {String} Second string
|
||||
* @return {Number} -1 if first string lower than second one
|
||||
* 0 if first string same order as second one
|
||||
* 1 if first string greater than second one
|
||||
*/
|
||||
export const ignoreCase = (a, b) => {
|
||||
let x = a.toLowerCase();
|
||||
let y = b.toLowerCase();
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts passed numbers in a ascending manner
|
||||
* @param {Number} First number
|
||||
* @param {Number} Second number
|
||||
* @param {Number} Negative, zero or positive number
|
||||
*/
|
||||
export const numSortAsc = (a, b) => (a - b);
|
||||
|
||||
/**
|
||||
* Sorts passed numbers in a descending manner
|
||||
* @param {Number} First number
|
||||
* @param {Number} Second number
|
||||
* @param {Number} Negative, zero or positive number
|
||||
*/
|
||||
export const numSortDesc = (a, b) => (b - a);
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
* String utilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* Removes whitespace from both sides of passed string
|
||||
* @param {String} text
|
||||
* @return {String}
|
||||
*/
|
||||
export const trim = text => {
|
||||
if (text.trim) {
|
||||
return text.trim();
|
||||
|
@ -9,14 +14,30 @@ export const trim = text => {
|
|||
return text.replace(/^\s*|\s*$/g, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if passed string is empty
|
||||
* @param {String} text
|
||||
* @return {Boolean}
|
||||
*/
|
||||
export const isEmpty = (text) => trim(text) === '';
|
||||
|
||||
/**
|
||||
* Makes regex safe string by escaping special characters from passed string
|
||||
* @param {String} text
|
||||
* @return {String} escaped string
|
||||
*/
|
||||
export const rgxEsc = text => {
|
||||
let chars = /[-\/\\^$*+?.()|[\]{}]/g;
|
||||
let escMatch = '\\$&';
|
||||
return String(text).replace(chars, escMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns passed string as lowercase if caseSensitive flag set false. By
|
||||
* default it returns the string with no casing changes.
|
||||
* @param {String} text
|
||||
* @return {String} string
|
||||
*/
|
||||
export const matchCase = (text, caseSensitive) => {
|
||||
if (!caseSensitive) {
|
||||
return text.toLowerCase();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Event from './event';
|
||||
import {
|
||||
addClass, createElm, createOpt, getText, getFirstTextNode, byId, tag,
|
||||
removeClass, removeElm
|
||||
addClass, createElm, createOpt, elm, getText, getFirstTextNode, hasClass,
|
||||
removeClass, removeElm, tag
|
||||
} from './dom';
|
||||
import {contains, matchCase, rgxEsc, trim} from './string';
|
||||
import {isEmpty as isEmptyString} from './string';
|
||||
|
@ -65,7 +65,7 @@ export class TableFilter {
|
|||
this.id = arg.id || `tf_${new Date().getTime()}_`;
|
||||
} else if (isString(arg)) {
|
||||
this.id = arg;
|
||||
this.tbl = byId(arg);
|
||||
this.tbl = elm(arg);
|
||||
} else if (isNumber(arg)) {
|
||||
this.startRow = arg;
|
||||
} else if (isObj(arg)) {
|
||||
|
@ -731,7 +731,7 @@ export class TableFilter {
|
|||
|
||||
//filter is appended in custom element
|
||||
if (externalFltTgtId) {
|
||||
byId(externalFltTgtId).appendChild(inp);
|
||||
elm(externalFltTgtId).appendChild(inp);
|
||||
this.externalFltEls.push(inp);
|
||||
} else {
|
||||
container.appendChild(inp);
|
||||
|
@ -760,7 +760,7 @@ export class TableFilter {
|
|||
|
||||
//filter is appended in custom element
|
||||
if (externalFltTgtId) {
|
||||
byId(externalFltTgtId).appendChild(btn);
|
||||
elm(externalFltTgtId).appendChild(btn);
|
||||
} else {
|
||||
container.appendChild(btn);
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ export class TableFilter {
|
|||
* @return {DOMElement} stylesheet element
|
||||
*/
|
||||
getStylesheet(name = 'default') {
|
||||
return byId(this.prfxTf + name);
|
||||
return elm(this.prfxTf + name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1002,7 +1002,7 @@ export class TableFilter {
|
|||
|
||||
//custom container
|
||||
if (this.toolBarTgtId) {
|
||||
byId(this.toolBarTgtId).appendChild(infdiv);
|
||||
elm(this.toolBarTgtId).appendChild(infdiv);
|
||||
}
|
||||
//grid-layout
|
||||
else if (this.gridLayout) {
|
||||
|
@ -1016,26 +1016,26 @@ export class TableFilter {
|
|||
cont.appendChild(infdiv);
|
||||
this.tbl.insertBefore(cont, this.tbl.firstChild);
|
||||
}
|
||||
this.infDiv = byId(this.prfxInfDiv + this.id);
|
||||
this.infDiv = elm(this.prfxInfDiv + this.id);
|
||||
|
||||
/*** left div containing rows # displayer ***/
|
||||
let ldiv = createElm('div', ['id', this.prfxLDiv + this.id]);
|
||||
ldiv.className = this.lDivCssClass;
|
||||
infdiv.appendChild(ldiv);
|
||||
this.lDiv = byId(this.prfxLDiv + this.id);
|
||||
this.lDiv = elm(this.prfxLDiv + this.id);
|
||||
|
||||
/*** right div containing reset button
|
||||
+ nb results per page select ***/
|
||||
let rdiv = createElm('div', ['id', this.prfxRDiv + this.id]);
|
||||
rdiv.className = this.rDivCssClass;
|
||||
infdiv.appendChild(rdiv);
|
||||
this.rDiv = byId(this.prfxRDiv + this.id);
|
||||
this.rDiv = elm(this.prfxRDiv + this.id);
|
||||
|
||||
/*** mid div containing paging elements ***/
|
||||
let mdiv = createElm('div', ['id', this.prfxMDiv + this.id]);
|
||||
mdiv.className = this.mDivCssClass;
|
||||
infdiv.appendChild(mdiv);
|
||||
this.mDiv = byId(this.prfxMDiv + this.id);
|
||||
this.mDiv = elm(this.prfxMDiv + this.id);
|
||||
|
||||
// emit help initialisation only if undefined
|
||||
if (isUndef(this.help)) {
|
||||
|
@ -1074,7 +1074,7 @@ export class TableFilter {
|
|||
len = ids.length;
|
||||
for (let ct = 0; ct < len; ct++) {
|
||||
let externalFltTgtId = ids[ct],
|
||||
externalFlt = byId(externalFltTgtId);
|
||||
externalFlt = elm(externalFltTgtId);
|
||||
if (externalFlt) {
|
||||
externalFlt.innerHTML = '';
|
||||
}
|
||||
|
@ -1631,7 +1631,7 @@ export class TableFilter {
|
|||
*/
|
||||
getFilterElement(index) {
|
||||
let fltId = this.fltIds[index];
|
||||
return byId(fltId);
|
||||
return elm(fltId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2047,7 +2047,7 @@ export class TableFilter {
|
|||
let activeIdx = this.getColumnIndexFromFilterId(this.activeFilterId);
|
||||
|
||||
for (let i = 0, len = slcIndex.length; i < len; i++) {
|
||||
let curSlc = byId(this.fltIds[slcIndex[i]]);
|
||||
let curSlc = elm(this.fltIds[slcIndex[i]]);
|
||||
let slcSelectedValue = this.getFilterValue(slcIndex[i]);
|
||||
|
||||
// Welcome to cyclomatic complexity hell :)
|
||||
|
|
Loading…
Reference in a new issue