mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-16 12:45:49 +02:00
Removed watermark feature, replaced by native HTML5 input placeholder attribute
This commit is contained in:
parent
2b4880e8e8
commit
8bd151baef
2
dist/filtergrid.css
vendored
2
dist/filtergrid.css
vendored
|
@ -1,6 +1,6 @@
|
||||||
/*------------------------------------------------------------------------
|
/*------------------------------------------------------------------------
|
||||||
- TableFilter stylesheet by Max Guglielmi
|
- TableFilter stylesheet by Max Guglielmi
|
||||||
- (build date: Sat Feb 21 2015 00:45:41)
|
- (build date: Sat Feb 21 2015 14:36:33)
|
||||||
- Edit below for your projects' needs
|
- Edit below for your projects' needs
|
||||||
------------------------------------------------------------------------*/
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
8
dist/tablefilter.js
vendored
8
dist/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@ export class AlternateRows{
|
||||||
* @param {Object} tf TableFilter instance
|
* @param {Object} tf TableFilter instance
|
||||||
*/
|
*/
|
||||||
constructor(tf) {
|
constructor(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//defines css class for even rows
|
//defines css class for even rows
|
||||||
this.evenCss = f.even_row_css_class || 'even';
|
this.evenCss = f.even_row_css_class || 'even';
|
||||||
//defines css class for odd rows
|
//defines css class for odd rows
|
||||||
|
@ -20,7 +20,7 @@ export class AlternateRows{
|
||||||
* Sets alternating rows color
|
* Sets alternating rows color
|
||||||
*/
|
*/
|
||||||
init() {
|
init() {
|
||||||
if(!this.tf.hasGrid && !this.tf.isFirstLoad){
|
if(!this.tf.hasGrid() && !this.tf.isFirstLoad){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var rows = this.tf.tbl.rows;
|
var rows = this.tf.tbl.rows;
|
||||||
|
@ -77,7 +77,7 @@ export class AlternateRows{
|
||||||
* Removes all row background color
|
* Removes all row background color
|
||||||
*/
|
*/
|
||||||
remove() {
|
remove() {
|
||||||
if(!this.tf.hasGrid){
|
if(!this.tf.hasGrid()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var row = this.tf.tbl.rows;
|
var row = this.tf.tbl.rows;
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class CheckList{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.checkListDiv = []; //checklist container div
|
this.checkListDiv = []; //checklist container div
|
||||||
//defines css class for div containing checklist filter
|
//defines css class for div containing checklist filter
|
||||||
|
@ -132,7 +132,7 @@ export class CheckList{
|
||||||
(tf.paging && ((!activeFlt || activeFlt===colIndex )||
|
(tf.paging && ((!activeFlt || activeFlt===colIndex )||
|
||||||
(activeFlt!=colIndex &&
|
(activeFlt!=colIndex &&
|
||||||
array.has(tf.validRowsIndex, k))) )))){
|
array.has(tf.validRowsIndex, k))) )))){
|
||||||
var cell_data = tf.GetCellData(j, cells[j]);
|
var cell_data = tf.getCellData(j, cells[j]);
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
var cell_string = Str.matchCase(
|
var cell_string = Str.matchCase(
|
||||||
cell_data, tf.matchCase);
|
cell_data, tf.matchCase);
|
||||||
|
|
|
@ -9,7 +9,7 @@ export class ClearButton{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//id of container element
|
//id of container element
|
||||||
this.btnResetTgtId = f.btn_reset_target_id || null;
|
this.btnResetTgtId = f.btn_reset_target_id || null;
|
||||||
|
@ -29,7 +29,7 @@ export class ClearButton{
|
||||||
}
|
}
|
||||||
|
|
||||||
onClick(){
|
onClick(){
|
||||||
this.tf.ClearFilters();
|
this.tf.clearFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +38,7 @@ export class ClearButton{
|
||||||
init(){
|
init(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if(!tf.hasGrid && !tf.isFirstLoad && tf.btnResetEl){
|
if(!tf.hasGrid() && !tf.isFirstLoad && tf.btnResetEl){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export class ClearButton{
|
||||||
|
|
||||||
// reset button is added to defined element
|
// reset button is added to defined element
|
||||||
if(!this.btnResetTgtId){
|
if(!this.btnResetTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.btnResetTgtId ?
|
var targetEl = !this.btnResetTgtId ?
|
||||||
tf.rDiv : Dom.id(this.btnResetTgtId);
|
tf.rDiv : Dom.id(this.btnResetTgtId);
|
||||||
|
@ -74,7 +74,7 @@ export class ClearButton{
|
||||||
destroy(){
|
destroy(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if(!tf.hasGrid || !this.btnResetEl){
|
if(!tf.hasGrid() || !this.btnResetEl){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ export class ColOps{
|
||||||
* @param {Object} tf TableFilter instance
|
* @param {Object} tf TableFilter instance
|
||||||
*/
|
*/
|
||||||
constructor(tf) {
|
constructor(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
this.colOperation = f.col_operation;
|
this.colOperation = f.col_operation;
|
||||||
|
|
||||||
//calls function before col operation
|
//calls function before col operation
|
||||||
|
@ -39,7 +39,7 @@ export class ColOps{
|
||||||
* (2) added calculations for the median, lower and upper quartile.
|
* (2) added calculations for the median, lower and upper quartile.
|
||||||
*/
|
*/
|
||||||
calc() {
|
calc() {
|
||||||
if(!this.tf.isFirstLoad && !this.tf.hasGrid){
|
if(!this.tf.isFirstLoad && !this.tf.hasGrid()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ export class ColOps{
|
||||||
//use ucolIndex because we only want to pass through this loop
|
//use ucolIndex because we only want to pass through this loop
|
||||||
//once for each column get the values in this unique column
|
//once for each column get the values in this unique column
|
||||||
colvalues.push(
|
colvalues.push(
|
||||||
this.tf.GetColValues(ucolIndex[ucol], true, excludeRow));
|
this.tf.getColValues(ucolIndex[ucol], true, excludeRow));
|
||||||
|
|
||||||
//next: calculate all operations for this column
|
//next: calculate all operations for this column
|
||||||
var result,
|
var result,
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class Dropdown{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.enableSlcResetFilter = f.enable_slc_reset_filter ? false : true;
|
this.enableSlcResetFilter = f.enable_slc_reset_filter ? false : true;
|
||||||
//defines empty option text
|
//defines empty option text
|
||||||
|
@ -138,7 +138,7 @@ export class Dropdown{
|
||||||
((activeFlt===undefined || activeFlt==colIndex) ||
|
((activeFlt===undefined || activeFlt==colIndex) ||
|
||||||
(activeFlt!=colIndex &&
|
(activeFlt!=colIndex &&
|
||||||
array.has(tf.validRowsIndex, k) ))) ))){
|
array.has(tf.validRowsIndex, k) ))) ))){
|
||||||
var cell_data = tf.GetCellData(j, cell[j]),
|
var cell_data = tf.getCellData(j, cell[j]),
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
cell_string = Str.matchCase(cell_data, matchCase);
|
cell_string = Str.matchCase(cell_data, matchCase);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ export class GridLayout{
|
||||||
* @param {Object} tf TableFilter instance
|
* @param {Object} tf TableFilter instance
|
||||||
*/
|
*/
|
||||||
constructor(tf) {
|
constructor(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//defines grid width
|
//defines grid width
|
||||||
this.gridWidth = f.grid_width || null;
|
this.gridWidth = f.grid_width || null;
|
||||||
|
@ -51,7 +51,7 @@ export class GridLayout{
|
||||||
*/
|
*/
|
||||||
init(){
|
init(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
var tbl = tf.tbl;
|
var tbl = tf.tbl;
|
||||||
|
|
||||||
if(!tf.gridLayout){
|
if(!tf.gridLayout){
|
||||||
|
@ -77,7 +77,7 @@ export class GridLayout{
|
||||||
}
|
}
|
||||||
tf.hasColWidth = true;
|
tf.hasColWidth = true;
|
||||||
}
|
}
|
||||||
tf.SetColWidths(this.gridHeadRowIndex);
|
tf.setColWidths(this.gridHeadRowIndex);
|
||||||
|
|
||||||
var tblW;//initial table width
|
var tblW;//initial table width
|
||||||
if(tbl.width !== ''){
|
if(tbl.width !== ''){
|
||||||
|
@ -112,7 +112,7 @@ export class GridLayout{
|
||||||
|
|
||||||
//In case table width is expressed in %
|
//In case table width is expressed in %
|
||||||
if(tbl.style.width === ''){
|
if(tbl.style.width === ''){
|
||||||
tbl.style.width = (tf.__containsStr('%', tblW) ?
|
tbl.style.width = (tf._containsStr('%', tblW) ?
|
||||||
tbl.clientWidth : tblW) + 'px';
|
tbl.clientWidth : tblW) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ export class GridLayout{
|
||||||
this.headTbl.cellSpacing = tbl.cellSpacing;
|
this.headTbl.cellSpacing = tbl.cellSpacing;
|
||||||
|
|
||||||
//content table without headers needs col widths to be reset
|
//content table without headers needs col widths to be reset
|
||||||
tf.SetColWidths();
|
tf.setColWidths();
|
||||||
|
|
||||||
//Headers container width
|
//Headers container width
|
||||||
this.headTblCont.style.width = this.tblCont.clientWidth+'px';
|
this.headTblCont.style.width = this.tblCont.clientWidth+'px';
|
||||||
|
@ -234,7 +234,7 @@ export class GridLayout{
|
||||||
};
|
};
|
||||||
tf.hasExtensions = true;
|
tf.hasExtensions = true;
|
||||||
} else {
|
} else {
|
||||||
if(!tf.__containsStr(
|
if(!tf._containsStr(
|
||||||
'colsresizer',
|
'colsresizer',
|
||||||
Str.lower(tf.extensions.src.toString())) ){
|
Str.lower(tf.extensions.src.toString())) ){
|
||||||
tf.extensions.name.push('ColumnsResizer_'+tf.id);
|
tf.extensions.name.push('ColumnsResizer_'+tf.id);
|
||||||
|
|
|
@ -9,7 +9,7 @@ export class Help{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj || {};
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element for instructions
|
//id of custom container element for instructions
|
||||||
this.helpInstrTgtId = f.help_instructions_target_id || null;
|
this.helpInstrTgtId = f.help_instructions_target_id || null;
|
||||||
|
@ -66,7 +66,7 @@ export class Help{
|
||||||
|
|
||||||
//help button is added to defined element
|
//help button is added to defined element
|
||||||
if(!this.helpInstrTgtId){
|
if(!this.helpInstrTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.helpInstrTgtId ?
|
var targetEl = !this.helpInstrTgtId ?
|
||||||
tf.rDiv : Dom.id(this.helpInstrTgtId);
|
tf.rDiv : Dom.id(this.helpInstrTgtId);
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class HighlightKeyword{
|
||||||
* @param {Object} tf TableFilter instance
|
* @param {Object} tf TableFilter instance
|
||||||
*/
|
*/
|
||||||
constructor(tf) {
|
constructor(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//defines css class for highlighting
|
//defines css class for highlighting
|
||||||
this.highlightCssClass = f.highlight_css_class || 'keyword';
|
this.highlightCssClass = f.highlight_css_class || 'keyword';
|
||||||
this.highlightedNodes = [];
|
this.highlightedNodes = [];
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class Loader{
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
|
|
||||||
// TableFilter configuration
|
// TableFilter configuration
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//id of container element
|
//id of container element
|
||||||
this.loaderTgtId = f.loader_target_id || null;
|
this.loaderTgtId = f.loader_target_id || null;
|
||||||
//div containing loader
|
//div containing loader
|
||||||
|
@ -80,8 +80,9 @@ export class Loader{
|
||||||
if(!this.loaderDiv){
|
if(!this.loaderDiv){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var targetEl = !this.loaderTgtId ?
|
var tf = this.tf,
|
||||||
(this.tf.gridLayout ? this.tf.tblCont : this.tf.tbl.parentNode):
|
targetEl = !this.loaderTgtId ?
|
||||||
|
(tf.gridLayout ? tf.Cpt.gridLayout.tblCont : tf.tbl.parentNode):
|
||||||
Dom.id(this.loaderTgtId);
|
Dom.id(this.loaderTgtId);
|
||||||
targetEl.removeChild(this.loaderDiv);
|
targetEl.removeChild(this.loaderDiv);
|
||||||
this.loaderDiv = null;
|
this.loaderDiv = null;
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class Paging{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//css class for paging buttons (previous,next,etc.)
|
//css class for paging buttons (previous,next,etc.)
|
||||||
this.btnPageCssClass = f.paging_btn_css_class || 'pgInp';
|
this.btnPageCssClass = f.paging_btn_css_class || 'pgInp';
|
||||||
|
@ -127,7 +127,7 @@ export class Paging{
|
||||||
var key = tf.Evt.getKeyCode(e);
|
var key = tf.Evt.getKeyCode(e);
|
||||||
if(key===13){
|
if(key===13){
|
||||||
if(tf.sorted){
|
if(tf.sorted){
|
||||||
tf.Filter();
|
tf.filter();
|
||||||
o.changePage(o.evt.slcIndex());
|
o.changePage(o.evt.slcIndex());
|
||||||
} else{
|
} else{
|
||||||
o.changePage();
|
o.changePage();
|
||||||
|
@ -273,7 +273,7 @@ export class Paging{
|
||||||
|
|
||||||
// paging elements (buttons+drop-down list) are added to defined element
|
// paging elements (buttons+drop-down list) are added to defined element
|
||||||
if(!this.pagingTgtId){
|
if(!this.pagingTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);
|
var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);
|
||||||
targetEl.appendChild(btnFirstSpan);
|
targetEl.appendChild(btnFirstSpan);
|
||||||
|
@ -317,15 +317,15 @@ export class Paging{
|
||||||
*/
|
*/
|
||||||
addPaging(filterTable=false){
|
addPaging(filterTable=false){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid || tf.paging){
|
if(!tf.hasGrid() || tf.paging){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tf.paging = true;
|
tf.paging = true;
|
||||||
this.isPagingRemoved = true;
|
this.isPagingRemoved = true;
|
||||||
this.init();
|
this.init();
|
||||||
tf.ResetValues();
|
tf.resetValues();
|
||||||
if(filterTable){
|
if(filterTable){
|
||||||
tf.Filter();
|
tf.filter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ export class Paging{
|
||||||
tf.nbVisibleRows = tf.validRowsIndex.length;
|
tf.nbVisibleRows = tf.validRowsIndex.length;
|
||||||
tf.isStartBgAlternate = false;
|
tf.isStartBgAlternate = false;
|
||||||
//re-applies filter behaviours after filtering process
|
//re-applies filter behaviours after filtering process
|
||||||
tf.ApplyGridProps();
|
tf.applyGridProps();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -439,7 +439,7 @@ export class Paging{
|
||||||
*/
|
*/
|
||||||
setPage(cmd){
|
setPage(cmd){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid || !this.paging){
|
if(!tf.hasGrid() || !this.paging){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var btnEvt = this.evt,
|
var btnEvt = this.evt,
|
||||||
|
@ -475,7 +475,7 @@ export class Paging{
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
var evt = this.evt;
|
var evt = this.evt;
|
||||||
|
|
||||||
if(!tf.hasGrid && !tf.isFirstLoad){
|
if(!tf.hasGrid() && !tf.isFirstLoad){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.resultsPerPageSlc || !this.resultsPerPage){
|
if(this.resultsPerPageSlc || !this.resultsPerPage){
|
||||||
|
@ -501,7 +501,7 @@ export class Paging{
|
||||||
|
|
||||||
// results per page select is added to external element
|
// results per page select is added to external element
|
||||||
if(!this.resultsPerPageTgtId){
|
if(!this.resultsPerPageTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.resultsPerPageTgtId ?
|
var targetEl = !this.resultsPerPageTgtId ?
|
||||||
tf.rDiv : Dom.id(this.resultsPerPageTgtId);
|
tf.rDiv : Dom.id(this.resultsPerPageTgtId);
|
||||||
|
@ -523,7 +523,7 @@ export class Paging{
|
||||||
*/
|
*/
|
||||||
removeResultsPerPage(){
|
removeResultsPerPage(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid || !this.resultsPerPageSlc || !this.resultsPerPage){
|
if(!tf.hasGrid() || !this.resultsPerPageSlc || !this.resultsPerPage){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var slcR = this.resultsPerPageSlc,
|
var slcR = this.resultsPerPageSlc,
|
||||||
|
@ -680,7 +680,7 @@ export class Paging{
|
||||||
destroy(){
|
destroy(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if(!tf.hasGrid){
|
if(!tf.hasGrid()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// btns containers
|
// btns containers
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class PopupFilter{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
// Enable external filters behaviour
|
// Enable external filters behaviour
|
||||||
tf.isExternalFlt = true;
|
tf.isExternalFlt = true;
|
||||||
|
@ -62,7 +62,7 @@ export class PopupFilter{
|
||||||
|
|
||||||
if(this.popUpFltAdjustToContainer){
|
if(this.popUpFltAdjustToContainer){
|
||||||
var popUpDiv = this.popUpFltElms[colIndex],
|
var popUpDiv = this.popUpFltElms[colIndex],
|
||||||
header = this.tf.GetHeaderElement(colIndex),
|
header = this.tf.getHeaderElement(colIndex),
|
||||||
headerWidth = header.clientWidth * 0.95;
|
headerWidth = header.clientWidth * 0.95;
|
||||||
if(Helpers.isIE()){
|
if(Helpers.isIE()){
|
||||||
var headerLeft = Dom.position(header).left;
|
var headerLeft = Dom.position(header).left;
|
||||||
|
@ -89,7 +89,7 @@ export class PopupFilter{
|
||||||
['ci', i]
|
['ci', i]
|
||||||
);
|
);
|
||||||
popUpSpan.innerHTML = this.popUpImgFltHtml;
|
popUpSpan.innerHTML = this.popUpImgFltHtml;
|
||||||
var header = tf.GetHeaderElement(i);
|
var header = tf.getHeaderElement(i);
|
||||||
header.appendChild(popUpSpan);
|
header.appendChild(popUpSpan);
|
||||||
Event.add(popUpSpan, 'click', (evt) => { this.onClick(evt); });
|
Event.add(popUpSpan, 'click', (evt) => { this.onClick(evt); });
|
||||||
this.popUpFltSpans[i] = popUpSpan;
|
this.popUpFltSpans[i] = popUpSpan;
|
||||||
|
@ -118,9 +118,8 @@ export class PopupFilter{
|
||||||
div;
|
div;
|
||||||
popUpDiv.className = this.popUpDivCssClass;
|
popUpDiv.className = this.popUpDivCssClass;
|
||||||
tf.externalFltTgtIds.push(popUpDiv.id);
|
tf.externalFltTgtIds.push(popUpDiv.id);
|
||||||
var header = tf.GetHeaderElement(colIndex);
|
var header = tf.getHeaderElement(colIndex);
|
||||||
header.insertBefore(popUpDiv, header.firstChild);
|
header.insertBefore(popUpDiv, header.firstChild);
|
||||||
//popUpDiv.onclick = function(e){ evt.stop(e || global.event); };
|
|
||||||
Event.add(popUpDiv, 'click', (evt) => { Event.stop(evt); });
|
Event.add(popUpDiv, 'click', (evt) => { Event.stop(evt); });
|
||||||
this.popUpFltElms[colIndex] = popUpDiv;
|
this.popUpFltElms[colIndex] = popUpDiv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export class RowsCounter{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// TableFilter configuration
|
// TableFilter configuration
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element
|
//id of custom container element
|
||||||
this.rowsCounterTgtId = f.rows_counter_target_id || null;
|
this.rowsCounterTgtId = f.rows_counter_target_id || null;
|
||||||
|
@ -37,7 +37,7 @@ export class RowsCounter{
|
||||||
init(){
|
init(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if((!tf.hasGrid && !tf.isFirstLoad) || this.rowsCounterSpan){
|
if((!tf.hasGrid() && !tf.isFirstLoad) || this.rowsCounterSpan){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ export class RowsCounter{
|
||||||
|
|
||||||
// counter is added to defined element
|
// counter is added to defined element
|
||||||
if(!this.rowsCounterTgtId){
|
if(!this.rowsCounterTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.rowsCounterTgtId ?
|
var targetEl = !this.rowsCounterTgtId ?
|
||||||
tf.lDiv : Dom.id( this.rowsCounterTgtId );
|
tf.lDiv : Dom.id( this.rowsCounterTgtId );
|
||||||
|
@ -119,7 +119,7 @@ export class RowsCounter{
|
||||||
|
|
||||||
destroy(){
|
destroy(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid){
|
if(!tf.hasGrid()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this.rowsCounterSpan){
|
if(!this.rowsCounterSpan){
|
||||||
|
|
|
@ -3,6 +3,8 @@ import {Event} from '../event';
|
||||||
import {Types} from '../types';
|
import {Types} from '../types';
|
||||||
import {Helpers} from '../helpers';
|
import {Helpers} from '../helpers';
|
||||||
|
|
||||||
|
var global = window;
|
||||||
|
|
||||||
export class StatusBar{
|
export class StatusBar{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +13,7 @@ export class StatusBar{
|
||||||
*/
|
*/
|
||||||
constructor(tf){
|
constructor(tf){
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj || {};
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element
|
//id of custom container element
|
||||||
this.statusBarTgtId = f.status_bar_target_id || null;
|
this.statusBarTgtId = f.status_bar_target_id || null;
|
||||||
|
@ -40,7 +42,7 @@ export class StatusBar{
|
||||||
|
|
||||||
init(){
|
init(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid && !tf.isFirstLoad){
|
if(!tf.hasGrid() && !tf.isFirstLoad){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +58,7 @@ export class StatusBar{
|
||||||
|
|
||||||
// target element container
|
// target element container
|
||||||
if(!this.statusBarTgtId){
|
if(!this.statusBarTgtId){
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = (!this.statusBarTgtId) ?
|
var targetEl = (!this.statusBarTgtId) ?
|
||||||
tf.lDiv : Dom.id(this.statusBarTgtId);
|
tf.lDiv : Dom.id(this.statusBarTgtId);
|
||||||
|
@ -93,7 +95,7 @@ export class StatusBar{
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = t==='' ? this.statusBarCloseDelay : 1;
|
var d = t==='' ? this.statusBarCloseDelay : 1;
|
||||||
window.setTimeout(() => {
|
global.setTimeout(() => {
|
||||||
this.statusBarSpan.innerHTML = t;
|
this.statusBarSpan.innerHTML = t;
|
||||||
if(this.onAfterShowMsg){
|
if(this.onAfterShowMsg){
|
||||||
this.onAfterShowMsg.call(null, this.tf, t);
|
this.onAfterShowMsg.call(null, this.tf, t);
|
||||||
|
@ -103,7 +105,7 @@ export class StatusBar{
|
||||||
|
|
||||||
destroy(){
|
destroy(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid || !this.statusBarDiv){
|
if(!tf.hasGrid() || !this.statusBarDiv){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class Store{
|
||||||
* @param {Object} tf TableFilter instance
|
* @param {Object} tf TableFilter instance
|
||||||
*/
|
*/
|
||||||
constructor(tf) {
|
constructor(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.duration = !isNaN(f.set_cookie_duration) ?
|
this.duration = !isNaN(f.set_cookie_duration) ?
|
||||||
parseInt(f.set_cookie_duration, 10) : 100000;
|
parseInt(f.set_cookie_duration, 10) : 100000;
|
||||||
|
@ -24,7 +24,7 @@ export class Store{
|
||||||
var fltValues = [];
|
var fltValues = [];
|
||||||
//store filters' values
|
//store filters' values
|
||||||
for(var i=0; i<tf.fltIds.length; i++){
|
for(var i=0; i<tf.fltIds.length; i++){
|
||||||
var value = tf.GetFilterValue(i);
|
var value = tf.getFilterValue(i);
|
||||||
if (value === ''){
|
if (value === ''){
|
||||||
value = ' ';
|
value = ' ';
|
||||||
}
|
}
|
||||||
|
|
519
src/core.js
519
src/core.js
File diff suppressed because it is too large
Load diff
|
@ -104,18 +104,19 @@
|
||||||
// remember_page_number: true,
|
// remember_page_number: true,
|
||||||
// remember_page_length: true,
|
// remember_page_length: true,
|
||||||
fill_slc_on_demand: false,
|
fill_slc_on_demand: false,
|
||||||
refresh_filters: false,
|
linked_filters: false,
|
||||||
popup_filters: false,
|
popup_filters: false,
|
||||||
alternate_rows: true,
|
alternate_rows: true,
|
||||||
highlight_keywords: true,
|
highlight_keywords: true,
|
||||||
match_case: false,
|
match_case: false,
|
||||||
btn_reset: true,
|
btn_reset: true,
|
||||||
status_bar: true,
|
status_bar: true,
|
||||||
// grid_layout: true,
|
watermark: [null, 'Filter column...', null, null, 'Helo'],
|
||||||
|
grid_layout: false,
|
||||||
// grid_width: '500px',
|
// grid_width: '500px',
|
||||||
// grid_height: '200px',
|
// grid_height: '200px',
|
||||||
on_before_show_msg: function(tf){
|
on_before_show_msg: function(tf){
|
||||||
console.log('on_before_show_msg');
|
// console.log('on_before_show_msg');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ define(["exports", "../dom"], function (exports, _dom) {
|
||||||
var Dom = _dom.Dom;
|
var Dom = _dom.Dom;
|
||||||
var AlternateRows = (function () {
|
var AlternateRows = (function () {
|
||||||
var AlternateRows = function AlternateRows(tf) {
|
var AlternateRows = function AlternateRows(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//defines css class for even rows
|
//defines css class for even rows
|
||||||
this.evenCss = f.even_row_css_class || "even";
|
this.evenCss = f.even_row_css_class || "even";
|
||||||
//defines css class for odd rows
|
//defines css class for odd rows
|
||||||
|
@ -22,7 +22,7 @@ define(["exports", "../dom"], function (exports, _dom) {
|
||||||
init: {
|
init: {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
if (!this.tf.hasGrid && !this.tf.isFirstLoad) {
|
if (!this.tf.hasGrid() && !this.tf.isFirstLoad) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var rows = this.tf.tbl.rows;
|
var rows = this.tf.tbl.rows;
|
||||||
|
@ -67,7 +67,7 @@ define(["exports", "../dom"], function (exports, _dom) {
|
||||||
remove: {
|
remove: {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
if (!this.tf.hasGrid) {
|
if (!this.tf.hasGrid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var row = this.tf.tbl.rows;
|
var row = this.tf.tbl.rows;
|
||||||
|
|
|
@ -14,7 +14,7 @@ define(["exports", "../dom", "../array", "../string", "../sort", "../event"], fu
|
||||||
var CheckList = (function () {
|
var CheckList = (function () {
|
||||||
var CheckList = function CheckList(tf) {
|
var CheckList = function CheckList(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.checkListDiv = []; //checklist container div
|
this.checkListDiv = []; //checklist container div
|
||||||
//defines css class for div containing checklist filter
|
//defines css class for div containing checklist filter
|
||||||
|
@ -115,7 +115,7 @@ define(["exports", "../dom", "../array", "../string", "../sort", "../event"], fu
|
||||||
// this loop retrieves cell data
|
// this loop retrieves cell data
|
||||||
for (var j = 0; j < ncells; j++) {
|
for (var j = 0; j < ncells; j++) {
|
||||||
if ((colIndex === j && (!tf.refreshFilters || (tf.refreshFilters && tf.disableExcludedOptions))) || (colIndex === j && tf.refreshFilters && ((rows[k].style.display === "" && !tf.paging) || (tf.paging && ((!activeFlt || activeFlt === colIndex) || (activeFlt != colIndex && array.has(tf.validRowsIndex, k))))))) {
|
if ((colIndex === j && (!tf.refreshFilters || (tf.refreshFilters && tf.disableExcludedOptions))) || (colIndex === j && tf.refreshFilters && ((rows[k].style.display === "" && !tf.paging) || (tf.paging && ((!activeFlt || activeFlt === colIndex) || (activeFlt != colIndex && array.has(tf.validRowsIndex, k))))))) {
|
||||||
var cell_data = tf.GetCellData(j, cells[j]);
|
var cell_data = tf.getCellData(j, cells[j]);
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
var cell_string = Str.matchCase(cell_data, tf.matchCase);
|
var cell_string = Str.matchCase(cell_data, tf.matchCase);
|
||||||
// checks if celldata is already in array
|
// checks if celldata is already in array
|
||||||
|
|
|
@ -11,7 +11,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
var ClearButton = (function () {
|
var ClearButton = (function () {
|
||||||
var ClearButton = function ClearButton(tf) {
|
var ClearButton = function ClearButton(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//id of container element
|
//id of container element
|
||||||
this.btnResetTgtId = f.btn_reset_target_id || null;
|
this.btnResetTgtId = f.btn_reset_target_id || null;
|
||||||
|
@ -31,7 +31,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
onClick: {
|
onClick: {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
this.tf.ClearFilters();
|
this.tf.clearFilters();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init: {
|
init: {
|
||||||
|
@ -40,7 +40,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if (!tf.hasGrid && !tf.isFirstLoad && tf.btnResetEl) {
|
if (!tf.hasGrid() && !tf.isFirstLoad && tf.btnResetEl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
|
|
||||||
// reset button is added to defined element
|
// reset button is added to defined element
|
||||||
if (!this.btnResetTgtId) {
|
if (!this.btnResetTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.btnResetTgtId ? tf.rDiv : Dom.id(this.btnResetTgtId);
|
var targetEl = !this.btnResetTgtId ? tf.rDiv : Dom.id(this.btnResetTgtId);
|
||||||
targetEl.appendChild(resetspan);
|
targetEl.appendChild(resetspan);
|
||||||
|
@ -78,7 +78,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if (!tf.hasGrid || !this.btnResetEl) {
|
if (!tf.hasGrid() || !this.btnResetEl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ define(["exports", "../dom", "../string", "../types"], function (exports, _dom,
|
||||||
var Types = _types.Types;
|
var Types = _types.Types;
|
||||||
var ColOps = (function () {
|
var ColOps = (function () {
|
||||||
var ColOps = function ColOps(tf) {
|
var ColOps = function ColOps(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
this.colOperation = f.col_operation;
|
this.colOperation = f.col_operation;
|
||||||
|
|
||||||
//calls function before col operation
|
//calls function before col operation
|
||||||
|
@ -26,7 +26,7 @@ define(["exports", "../dom", "../string", "../types"], function (exports, _dom,
|
||||||
calc: {
|
calc: {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
if (!this.tf.isFirstLoad && !this.tf.hasGrid) {
|
if (!this.tf.isFirstLoad && !this.tf.hasGrid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ define(["exports", "../dom", "../string", "../types"], function (exports, _dom,
|
||||||
//this retrieves col values
|
//this retrieves col values
|
||||||
//use ucolIndex because we only want to pass through this loop
|
//use ucolIndex because we only want to pass through this loop
|
||||||
//once for each column get the values in this unique column
|
//once for each column get the values in this unique column
|
||||||
colvalues.push(this.tf.GetColValues(ucolIndex[ucol], true, excludeRow));
|
colvalues.push(this.tf.getColValues(ucolIndex[ucol], true, excludeRow));
|
||||||
|
|
||||||
//next: calculate all operations for this column
|
//next: calculate all operations for this column
|
||||||
var result, nbvalues = 0, temp, meanValue = 0, sumValue = 0, minValue = null, maxValue = null, q1Value = null, medValue = null, q3Value = null, meanFlag = 0, sumFlag = 0, minFlag = 0, maxFlag = 0, q1Flag = 0, medFlag = 0, q3Flag = 0, theList = [], opsThisCol = [], decThisCol = [], labThisCol = [], oTypeThisCol = [], mThisCol = -1;
|
var result, nbvalues = 0, temp, meanValue = 0, sumValue = 0, minValue = null, maxValue = null, q1Value = null, medValue = null, q3Value = null, meanFlag = 0, sumFlag = 0, minFlag = 0, maxFlag = 0, q1Flag = 0, medFlag = 0, q3Flag = 0, theList = [], opsThisCol = [], decThisCol = [], labThisCol = [], oTypeThisCol = [], mThisCol = -1;
|
||||||
|
|
|
@ -13,7 +13,7 @@ define(["exports", "../dom", "../array", "../string", "../sort"], function (expo
|
||||||
var Dropdown = (function () {
|
var Dropdown = (function () {
|
||||||
var Dropdown = function Dropdown(tf) {
|
var Dropdown = function Dropdown(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.enableSlcResetFilter = f.enable_slc_reset_filter ? false : true;
|
this.enableSlcResetFilter = f.enable_slc_reset_filter ? false : true;
|
||||||
//defines empty option text
|
//defines empty option text
|
||||||
|
@ -111,7 +111,7 @@ define(["exports", "../dom", "../array", "../string", "../sort"], function (expo
|
||||||
// this loop retrieves cell data
|
// this loop retrieves cell data
|
||||||
for (var j = 0; j < nchilds; j++) {
|
for (var j = 0; j < nchilds; j++) {
|
||||||
if ((colIndex === j && (!isRefreshed || (isRefreshed && tf.disableExcludedOptions))) || (colIndex == j && isRefreshed && ((rows[k].style.display === "" && !tf.paging) || (tf.paging && (!tf.validRowsIndex || (tf.validRowsIndex && array.has(tf.validRowsIndex, k))) && ((activeFlt === undefined || activeFlt == colIndex) || (activeFlt != colIndex && array.has(tf.validRowsIndex, k))))))) {
|
if ((colIndex === j && (!isRefreshed || (isRefreshed && tf.disableExcludedOptions))) || (colIndex == j && isRefreshed && ((rows[k].style.display === "" && !tf.paging) || (tf.paging && (!tf.validRowsIndex || (tf.validRowsIndex && array.has(tf.validRowsIndex, k))) && ((activeFlt === undefined || activeFlt == colIndex) || (activeFlt != colIndex && array.has(tf.validRowsIndex, k))))))) {
|
||||||
var cell_data = tf.GetCellData(j, cell[j]),
|
var cell_data = tf.getCellData(j, cell[j]),
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
cell_string = Str.matchCase(cell_data, matchCase);
|
cell_string = Str.matchCase(cell_data, matchCase);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
var Event = _event.Event;
|
var Event = _event.Event;
|
||||||
var GridLayout = (function () {
|
var GridLayout = (function () {
|
||||||
var GridLayout = function GridLayout(tf) {
|
var GridLayout = function GridLayout(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//defines grid width
|
//defines grid width
|
||||||
this.gridWidth = f.grid_width || null;
|
this.gridWidth = f.grid_width || null;
|
||||||
|
@ -49,7 +49,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
var tbl = tf.tbl;
|
var tbl = tf.tbl;
|
||||||
|
|
||||||
if (!tf.gridLayout) {
|
if (!tf.gridLayout) {
|
||||||
|
@ -74,7 +74,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
}
|
}
|
||||||
tf.hasColWidth = true;
|
tf.hasColWidth = true;
|
||||||
}
|
}
|
||||||
tf.SetColWidths(this.gridHeadRowIndex);
|
tf.setColWidths(this.gridHeadRowIndex);
|
||||||
|
|
||||||
var tblW; //initial table width
|
var tblW; //initial table width
|
||||||
if (tbl.width !== "") {
|
if (tbl.width !== "") {
|
||||||
|
@ -108,7 +108,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
|
|
||||||
//In case table width is expressed in %
|
//In case table width is expressed in %
|
||||||
if (tbl.style.width === "") {
|
if (tbl.style.width === "") {
|
||||||
tbl.style.width = (tf.__containsStr("%", tblW) ? tbl.clientWidth : tblW) + "px";
|
tbl.style.width = (tf._containsStr("%", tblW) ? tbl.clientWidth : tblW) + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = this.tblCont.parentNode.removeChild(this.tblCont);
|
var d = this.tblCont.parentNode.removeChild(this.tblCont);
|
||||||
|
@ -179,7 +179,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
this.headTbl.cellSpacing = tbl.cellSpacing;
|
this.headTbl.cellSpacing = tbl.cellSpacing;
|
||||||
|
|
||||||
//content table without headers needs col widths to be reset
|
//content table without headers needs col widths to be reset
|
||||||
tf.SetColWidths();
|
tf.setColWidths();
|
||||||
|
|
||||||
//Headers container width
|
//Headers container width
|
||||||
this.headTblCont.style.width = this.tblCont.clientWidth + "px";
|
this.headTblCont.style.width = this.tblCont.clientWidth + "px";
|
||||||
|
@ -227,7 +227,7 @@ define(["exports", "../dom", "../types", "../helpers", "../event"], function (ex
|
||||||
};
|
};
|
||||||
tf.hasExtensions = true;
|
tf.hasExtensions = true;
|
||||||
} else {
|
} else {
|
||||||
if (!tf.__containsStr("colsresizer", Str.lower(tf.extensions.src.toString()))) {
|
if (!tf._containsStr("colsresizer", Str.lower(tf.extensions.src.toString()))) {
|
||||||
tf.extensions.name.push("ColumnsResizer_" + tf.id);
|
tf.extensions.name.push("ColumnsResizer_" + tf.id);
|
||||||
tf.extensions.src.push(tf.gridColResizerPath);
|
tf.extensions.src.push(tf.gridColResizerPath);
|
||||||
tf.extensions.description.push("Columns Resizing");
|
tf.extensions.description.push("Columns Resizing");
|
||||||
|
|
|
@ -11,7 +11,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
var Help = (function () {
|
var Help = (function () {
|
||||||
var Help = function Help(tf) {
|
var Help = function Help(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj || {};
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element for instructions
|
//id of custom container element for instructions
|
||||||
this.helpInstrTgtId = f.help_instructions_target_id || null;
|
this.helpInstrTgtId = f.help_instructions_target_id || null;
|
||||||
|
@ -54,7 +54,7 @@ define(["exports", "../dom", "../event"], function (exports, _dom, _event) {
|
||||||
|
|
||||||
//help button is added to defined element
|
//help button is added to defined element
|
||||||
if (!this.helpInstrTgtId) {
|
if (!this.helpInstrTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.helpInstrTgtId ? tf.rDiv : Dom.id(this.helpInstrTgtId);
|
var targetEl = !this.helpInstrTgtId ? tf.rDiv : Dom.id(this.helpInstrTgtId);
|
||||||
targetEl.appendChild(helpspan);
|
targetEl.appendChild(helpspan);
|
||||||
|
|
|
@ -10,7 +10,7 @@ define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
|
||||||
var Str = _string.Str;
|
var Str = _string.Str;
|
||||||
var HighlightKeyword = (function () {
|
var HighlightKeyword = (function () {
|
||||||
var HighlightKeyword = function HighlightKeyword(tf) {
|
var HighlightKeyword = function HighlightKeyword(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//defines css class for highlighting
|
//defines css class for highlighting
|
||||||
this.highlightCssClass = f.highlight_css_class || "keyword";
|
this.highlightCssClass = f.highlight_css_class || "keyword";
|
||||||
this.highlightedNodes = [];
|
this.highlightedNodes = [];
|
||||||
|
|
|
@ -15,7 +15,7 @@ define(["exports", "../dom", "../types"], function (exports, _dom, _types) {
|
||||||
var Loader = (function () {
|
var Loader = (function () {
|
||||||
var Loader = function Loader(tf) {
|
var Loader = function Loader(tf) {
|
||||||
// TableFilter configuration
|
// TableFilter configuration
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
//id of container element
|
//id of container element
|
||||||
this.loaderTgtId = f.loader_target_id || null;
|
this.loaderTgtId = f.loader_target_id || null;
|
||||||
//div containing loader
|
//div containing loader
|
||||||
|
@ -84,7 +84,7 @@ define(["exports", "../dom", "../types"], function (exports, _dom, _types) {
|
||||||
if (!this.loaderDiv) {
|
if (!this.loaderDiv) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var targetEl = !this.loaderTgtId ? (this.tf.gridLayout ? this.tf.tblCont : this.tf.tbl.parentNode) : Dom.id(this.loaderTgtId);
|
var tf = this.tf, targetEl = !this.loaderTgtId ? (tf.gridLayout ? tf.Cpt.gridLayout.tblCont : tf.tbl.parentNode) : Dom.id(this.loaderTgtId);
|
||||||
targetEl.removeChild(this.loaderDiv);
|
targetEl.removeChild(this.loaderDiv);
|
||||||
this.loaderDiv = null;
|
this.loaderDiv = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
var Paging = (function () {
|
var Paging = (function () {
|
||||||
var Paging = function Paging(tf) {
|
var Paging = function Paging(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//css class for paging buttons (previous,next,etc.)
|
//css class for paging buttons (previous,next,etc.)
|
||||||
this.btnPageCssClass = f.paging_btn_css_class || "pgInp";
|
this.btnPageCssClass = f.paging_btn_css_class || "pgInp";
|
||||||
|
@ -109,7 +109,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
var key = tf.Evt.getKeyCode(e);
|
var key = tf.Evt.getKeyCode(e);
|
||||||
if (key === 13) {
|
if (key === 13) {
|
||||||
if (tf.sorted) {
|
if (tf.sorted) {
|
||||||
tf.Filter();
|
tf.filter();
|
||||||
o.changePage(o.evt.slcIndex());
|
o.changePage(o.evt.slcIndex());
|
||||||
} else {
|
} else {
|
||||||
o.changePage();
|
o.changePage();
|
||||||
|
@ -223,7 +223,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
|
|
||||||
// paging elements (buttons+drop-down list) are added to defined element
|
// paging elements (buttons+drop-down list) are added to defined element
|
||||||
if (!this.pagingTgtId) {
|
if (!this.pagingTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);
|
var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);
|
||||||
targetEl.appendChild(btnFirstSpan);
|
targetEl.appendChild(btnFirstSpan);
|
||||||
|
@ -264,15 +264,15 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
value: function (filterTable) {
|
value: function (filterTable) {
|
||||||
if (filterTable === undefined) filterTable = false;
|
if (filterTable === undefined) filterTable = false;
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid || tf.paging) {
|
if (!tf.hasGrid() || tf.paging) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tf.paging = true;
|
tf.paging = true;
|
||||||
this.isPagingRemoved = true;
|
this.isPagingRemoved = true;
|
||||||
this.init();
|
this.init();
|
||||||
tf.ResetValues();
|
tf.resetValues();
|
||||||
if (filterTable) {
|
if (filterTable) {
|
||||||
tf.Filter();
|
tf.filter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -363,14 +363,14 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
tf.nbVisibleRows = tf.validRowsIndex.length;
|
tf.nbVisibleRows = tf.validRowsIndex.length;
|
||||||
tf.isStartBgAlternate = false;
|
tf.isStartBgAlternate = false;
|
||||||
//re-applies filter behaviours after filtering process
|
//re-applies filter behaviours after filtering process
|
||||||
tf.ApplyGridProps();
|
tf.applyGridProps();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setPage: {
|
setPage: {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function (cmd) {
|
value: function (cmd) {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid || !this.paging) {
|
if (!tf.hasGrid() || !this.paging) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var btnEvt = this.evt, cmdtype = typeof cmd;
|
var btnEvt = this.evt, cmdtype = typeof cmd;
|
||||||
|
@ -404,7 +404,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
var evt = this.evt;
|
var evt = this.evt;
|
||||||
|
|
||||||
if (!tf.hasGrid && !tf.isFirstLoad) {
|
if (!tf.hasGrid() && !tf.isFirstLoad) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.resultsPerPageSlc || !this.resultsPerPage) {
|
if (this.resultsPerPageSlc || !this.resultsPerPage) {
|
||||||
|
@ -427,7 +427,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
|
|
||||||
// results per page select is added to external element
|
// results per page select is added to external element
|
||||||
if (!this.resultsPerPageTgtId) {
|
if (!this.resultsPerPageTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.resultsPerPageTgtId ? tf.rDiv : Dom.id(this.resultsPerPageTgtId);
|
var targetEl = !this.resultsPerPageTgtId ? tf.rDiv : Dom.id(this.resultsPerPageTgtId);
|
||||||
slcRSpan.appendChild(Dom.text(slcRText));
|
slcRSpan.appendChild(Dom.text(slcRText));
|
||||||
|
@ -447,7 +447,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid || !this.resultsPerPageSlc || !this.resultsPerPage) {
|
if (!tf.hasGrid() || !this.resultsPerPageSlc || !this.resultsPerPage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var slcR = this.resultsPerPageSlc, slcRSpan = Dom.id(tf.prfxSlcResultsTxt + tf.id);
|
var slcR = this.resultsPerPageSlc, slcRSpan = Dom.id(tf.prfxSlcResultsTxt + tf.id);
|
||||||
|
@ -586,7 +586,7 @@ define(["exports", "../dom", "../types", "../string", "../helpers", "../event"],
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if (!tf.hasGrid) {
|
if (!tf.hasGrid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// btns containers
|
// btns containers
|
||||||
|
|
|
@ -13,7 +13,7 @@ define(["exports", "../types", "../dom", "../event", "../helpers"], function (ex
|
||||||
var PopupFilter = (function () {
|
var PopupFilter = (function () {
|
||||||
var PopupFilter = function PopupFilter(tf) {
|
var PopupFilter = function PopupFilter(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
// Enable external filters behaviour
|
// Enable external filters behaviour
|
||||||
tf.isExternalFlt = true;
|
tf.isExternalFlt = true;
|
||||||
|
@ -56,7 +56,7 @@ define(["exports", "../types", "../dom", "../event", "../helpers"], function (ex
|
||||||
this.toggle(colIndex);
|
this.toggle(colIndex);
|
||||||
|
|
||||||
if (this.popUpFltAdjustToContainer) {
|
if (this.popUpFltAdjustToContainer) {
|
||||||
var popUpDiv = this.popUpFltElms[colIndex], header = this.tf.GetHeaderElement(colIndex), headerWidth = header.clientWidth * 0.95;
|
var popUpDiv = this.popUpFltElms[colIndex], header = this.tf.getHeaderElement(colIndex), headerWidth = header.clientWidth * 0.95;
|
||||||
if (Helpers.isIE()) {
|
if (Helpers.isIE()) {
|
||||||
var headerLeft = Dom.position(header).left;
|
var headerLeft = Dom.position(header).left;
|
||||||
popUpDiv.style.left = (headerLeft) + "px";
|
popUpDiv.style.left = (headerLeft) + "px";
|
||||||
|
@ -78,7 +78,7 @@ define(["exports", "../types", "../dom", "../event", "../helpers"], function (ex
|
||||||
}
|
}
|
||||||
var popUpSpan = Dom.create("span", ["id", tf.prfxPopUpSpan + tf.id + "_" + i], ["ci", i]);
|
var popUpSpan = Dom.create("span", ["id", tf.prfxPopUpSpan + tf.id + "_" + i], ["ci", i]);
|
||||||
popUpSpan.innerHTML = this.popUpImgFltHtml;
|
popUpSpan.innerHTML = this.popUpImgFltHtml;
|
||||||
var header = tf.GetHeaderElement(i);
|
var header = tf.getHeaderElement(i);
|
||||||
header.appendChild(popUpSpan);
|
header.appendChild(popUpSpan);
|
||||||
Event.add(popUpSpan, "click", function (evt) {
|
Event.add(popUpSpan, "click", function (evt) {
|
||||||
_this.onClick(evt);
|
_this.onClick(evt);
|
||||||
|
@ -103,9 +103,8 @@ define(["exports", "../types", "../dom", "../event", "../helpers"], function (ex
|
||||||
var popUpDiv = !div ? Dom.create("div", ["id", tf.prfxPopUpDiv + tf.id + "_" + colIndex]) : div;
|
var popUpDiv = !div ? Dom.create("div", ["id", tf.prfxPopUpDiv + tf.id + "_" + colIndex]) : div;
|
||||||
popUpDiv.className = this.popUpDivCssClass;
|
popUpDiv.className = this.popUpDivCssClass;
|
||||||
tf.externalFltTgtIds.push(popUpDiv.id);
|
tf.externalFltTgtIds.push(popUpDiv.id);
|
||||||
var header = tf.GetHeaderElement(colIndex);
|
var header = tf.getHeaderElement(colIndex);
|
||||||
header.insertBefore(popUpDiv, header.firstChild);
|
header.insertBefore(popUpDiv, header.firstChild);
|
||||||
//popUpDiv.onclick = function(e){ evt.stop(e || global.event); };
|
|
||||||
Event.add(popUpDiv, "click", function (evt) {
|
Event.add(popUpDiv, "click", function (evt) {
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ define(["exports", "../dom", "../types", "../helpers"], function (exports, _dom,
|
||||||
var RowsCounter = (function () {
|
var RowsCounter = (function () {
|
||||||
var RowsCounter = function RowsCounter(tf) {
|
var RowsCounter = function RowsCounter(tf) {
|
||||||
// TableFilter configuration
|
// TableFilter configuration
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element
|
//id of custom container element
|
||||||
this.rowsCounterTgtId = f.rows_counter_target_id || null;
|
this.rowsCounterTgtId = f.rows_counter_target_id || null;
|
||||||
|
@ -40,7 +40,7 @@ define(["exports", "../dom", "../types", "../helpers"], function (exports, _dom,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
|
|
||||||
if ((!tf.hasGrid && !tf.isFirstLoad) || this.rowsCounterSpan) {
|
if ((!tf.hasGrid() && !tf.isFirstLoad) || this.rowsCounterSpan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ define(["exports", "../dom", "../types", "../helpers"], function (exports, _dom,
|
||||||
|
|
||||||
// counter is added to defined element
|
// counter is added to defined element
|
||||||
if (!this.rowsCounterTgtId) {
|
if (!this.rowsCounterTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = !this.rowsCounterTgtId ? tf.lDiv : Dom.id(this.rowsCounterTgtId);
|
var targetEl = !this.rowsCounterTgtId ? tf.lDiv : Dom.id(this.rowsCounterTgtId);
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ define(["exports", "../dom", "../types", "../helpers"], function (exports, _dom,
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid) {
|
if (!tf.hasGrid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.rowsCounterSpan) {
|
if (!this.rowsCounterSpan) {
|
||||||
|
|
|
@ -10,10 +10,14 @@ define(["exports", "../dom", "../event", "../types", "../helpers"], function (ex
|
||||||
var Event = _event.Event;
|
var Event = _event.Event;
|
||||||
var Types = _types.Types;
|
var Types = _types.Types;
|
||||||
var Helpers = _helpers.Helpers;
|
var Helpers = _helpers.Helpers;
|
||||||
|
|
||||||
|
|
||||||
|
var global = window;
|
||||||
|
|
||||||
var StatusBar = (function () {
|
var StatusBar = (function () {
|
||||||
var StatusBar = function StatusBar(tf) {
|
var StatusBar = function StatusBar(tf) {
|
||||||
// Configuration object
|
// Configuration object
|
||||||
var f = tf.fObj || {};
|
var f = tf.config();
|
||||||
|
|
||||||
//id of custom container element
|
//id of custom container element
|
||||||
this.statusBarTgtId = f.status_bar_target_id || null;
|
this.statusBarTgtId = f.status_bar_target_id || null;
|
||||||
|
@ -43,7 +47,7 @@ define(["exports", "../dom", "../event", "../types", "../helpers"], function (ex
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid && !tf.isFirstLoad) {
|
if (!tf.hasGrid() && !tf.isFirstLoad) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +63,7 @@ define(["exports", "../dom", "../event", "../types", "../helpers"], function (ex
|
||||||
|
|
||||||
// target element container
|
// target element container
|
||||||
if (!this.statusBarTgtId) {
|
if (!this.statusBarTgtId) {
|
||||||
tf.SetTopDiv();
|
tf.setToolbar();
|
||||||
}
|
}
|
||||||
var targetEl = (!this.statusBarTgtId) ? tf.lDiv : Dom.id(this.statusBarTgtId);
|
var targetEl = (!this.statusBarTgtId) ? tf.lDiv : Dom.id(this.statusBarTgtId);
|
||||||
|
|
||||||
|
@ -98,7 +102,7 @@ define(["exports", "../dom", "../event", "../types", "../helpers"], function (ex
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = t === "" ? this.statusBarCloseDelay : 1;
|
var d = t === "" ? this.statusBarCloseDelay : 1;
|
||||||
window.setTimeout(function () {
|
global.setTimeout(function () {
|
||||||
_this.statusBarSpan.innerHTML = t;
|
_this.statusBarSpan.innerHTML = t;
|
||||||
if (_this.onAfterShowMsg) {
|
if (_this.onAfterShowMsg) {
|
||||||
_this.onAfterShowMsg.call(null, _this.tf, t);
|
_this.onAfterShowMsg.call(null, _this.tf, t);
|
||||||
|
@ -110,7 +114,7 @@ define(["exports", "../dom", "../event", "../types", "../helpers"], function (ex
|
||||||
writable: true,
|
writable: true,
|
||||||
value: function () {
|
value: function () {
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if (!tf.hasGrid || !this.statusBarDiv) {
|
if (!tf.hasGrid() || !this.statusBarDiv) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ define(["exports", "../cookie"], function (exports, _cookie) {
|
||||||
var Cookie = _cookie.Cookie;
|
var Cookie = _cookie.Cookie;
|
||||||
var Store = (function () {
|
var Store = (function () {
|
||||||
var Store = function Store(tf) {
|
var Store = function Store(tf) {
|
||||||
var f = tf.fObj;
|
var f = tf.config();
|
||||||
|
|
||||||
this.duration = !isNaN(f.set_cookie_duration) ? parseInt(f.set_cookie_duration, 10) : 100000;
|
this.duration = !isNaN(f.set_cookie_duration) ? parseInt(f.set_cookie_duration, 10) : 100000;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ define(["exports", "../cookie"], function (exports, _cookie) {
|
||||||
var fltValues = [];
|
var fltValues = [];
|
||||||
//store filters' values
|
//store filters' values
|
||||||
for (var i = 0; i < tf.fltIds.length; i++) {
|
for (var i = 0; i < tf.fltIds.length; i++) {
|
||||||
var value = tf.GetFilterValue(i);
|
var value = tf.getFilterValue(i);
|
||||||
if (value === "") {
|
if (value === "") {
|
||||||
value = " ";
|
value = " ";
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
});
|
});
|
||||||
|
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.RemoveGrid();
|
tf.remove();
|
||||||
deepEqual(dom.id(tf.fltIds[3]), null, 'CheckList UL element');
|
deepEqual(dom.id(tf.fltIds[3]), null, 'CheckList UL element');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,7 +31,7 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
});
|
});
|
||||||
|
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.RemoveGrid();
|
tf.remove();
|
||||||
deepEqual(dom.id(tf.fltIds[3]), null, 'Filter is removed');
|
deepEqual(dom.id(tf.fltIds[3]), null, 'Filter is removed');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Highlighted keywords', function() {
|
test('Highlighted keywords', function() {
|
||||||
tf.SetFilterValue(1, 'Perth');
|
tf.setFilterValue(1, 'Perth');
|
||||||
tf.SetFilterValue(3, '3.1');
|
tf.setFilterValue(3, '3.1');
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
deepEqual(highlightKeyword.highlightedNodes.length, 2, 'Number of highlighted words');
|
deepEqual(highlightKeyword.highlightedNodes.length, 2, 'Number of highlighted words');
|
||||||
|
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
deepEqual(highlightKeyword.highlightedNodes.length, 0, 'Number of highlighted words');
|
deepEqual(highlightKeyword.highlightedNodes.length, 0, 'Number of highlighted words');
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -35,7 +35,7 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
});
|
});
|
||||||
|
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.RemoveGrid();
|
tf.remove();
|
||||||
var fltIcn1 = tf.Cpt.popupFilter.popUpFltImgs[3];
|
var fltIcn1 = tf.Cpt.popupFilter.popUpFltImgs[3];
|
||||||
deepEqual(fltIcn1, undefined, 'Filter icon is removed');
|
deepEqual(fltIcn1, undefined, 'Filter icon is removed');
|
||||||
deepEqual(dom.id(tf.fltIds[3]), null, 'Filter is removed');
|
deepEqual(dom.id(tf.fltIds[3]), null, 'Filter is removed');
|
||||||
|
|
|
@ -19,7 +19,7 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
Cookie.remove(tf.pgLenCookie);
|
Cookie.remove(tf.pgLenCookie);
|
||||||
|
|
||||||
tf.init();
|
tf.init();
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
|
|
||||||
module('Sanity checks');
|
module('Sanity checks');
|
||||||
test('Store module', function() {
|
test('Store module', function() {
|
||||||
|
@ -30,13 +30,13 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
|
|
||||||
module('Check page number persistence');
|
module('Check page number persistence');
|
||||||
test('Page number value', function() {
|
test('Page number value', function() {
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
tf.Cpt.paging._changePage(1);
|
tf.Cpt.paging._changePage(1);
|
||||||
var cookieName = tf.pgNbCookie;
|
var cookieName = tf.pgNbCookie;
|
||||||
deepEqual(tf.Cpt.store.getPageNb(cookieName), '2', 'Page number value');
|
deepEqual(tf.Cpt.store.getPageNb(cookieName), '2', 'Page number value');
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Check page length persistence');
|
module('Check page length persistence');
|
||||||
|
@ -46,20 +46,20 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
paging._changeResultsPerPage();
|
paging._changeResultsPerPage();
|
||||||
var cookieName = tf.pgLenCookie;
|
var cookieName = tf.pgLenCookie;
|
||||||
deepEqual(tf.Cpt.store.getPageLength(cookieName), '2', 'Page length value');
|
deepEqual(tf.Cpt.store.getPageLength(cookieName), '2', 'Page length value');
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Check filters persistence');
|
module('Check filters persistence');
|
||||||
test('Filters value', function() {
|
test('Filters value', function() {
|
||||||
tf.SetFilterValue(0, 'Sydney');
|
tf.setFilterValue(0, 'Sydney');
|
||||||
tf.SetFilterValue(3, '1.5');
|
tf.setFilterValue(3, '1.5');
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
var cookieName = tf.fltsValuesCookie;
|
var cookieName = tf.fltsValuesCookie;
|
||||||
deepEqual(tf.Cpt.store.getFilterValues(cookieName)[0], 'Sydney', 'Filter 0 value');
|
deepEqual(tf.Cpt.store.getFilterValues(cookieName)[0], 'Sydney', 'Filter 0 value');
|
||||||
deepEqual(tf.Cpt.store.getFilterValues(cookieName)[3], '1.5', 'Filter 3 value');
|
deepEqual(tf.Cpt.store.getFilterValues(cookieName)[3], '1.5', 'Filter 3 value');
|
||||||
tf._ClearFilters();
|
tf._clearFilters();
|
||||||
tf._Filter();
|
tf._filter();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ requirejs(['test-config', '../src/core'], function(config, TableFilter){
|
||||||
module('DOM tests');
|
module('DOM tests');
|
||||||
test('Filters row', function() {
|
test('Filters row', function() {
|
||||||
equal(tf.tbl.rows[0].className, 'fltrow', 'Filters row CSS class name');
|
equal(tf.tbl.rows[0].className, 'fltrow', 'Filters row CSS class name');
|
||||||
equal(tf.GetFilterElement(0).nodeName, 'INPUT', 'Filter DOM element');
|
equal(tf.getFilterElement(0).nodeName, 'INPUT', 'Filter DOM element');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue