1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-07 00:12:25 +02:00
TableFilter/dist/TF_Modules/tf_publicMethods.js
2015-03-06 19:49:30 +11:00

1 line
2.3 KiB
JavaScript

TF.prototype.HasGrid=function(){return this.hasGrid},TF.prototype.GetFiltersId=function(){if(!this.hasGrid)return;return this.fltIds},TF.prototype.GetValidRowsIndex=function(e){if(!this.hasGrid)return;if(!e)return this.validRowsIndex;this.validRowsIndex=[];for(var t=this.refRow;t<this.GetRowsNb(!0);t++){var n=this.tbl.rows[t];this.paging?(n.getAttribute("validRow")=="true"||n.getAttribute("validRow")==null)&&this.validRowsIndex.push(n.rowIndex):this.GetRowDisplay(n)!="none"&&this.validRowsIndex.push(n.rowIndex)}return this.validRowsIndex},TF.prototype.GetFiltersRowIndex=function(){if(!this.hasGrid)return;return this.filtersRowIndex},TF.prototype.GetHeadersRowIndex=function(){if(!this.hasGrid)return;return this.headersRow},TF.prototype.GetStartRowIndex=function(){if(!this.hasGrid)return;return this.refRow},TF.prototype.GetLastRowIndex=function(){if(!this.hasGrid)return;return this.nbRows-1},TF.prototype.GetHeaderElement=function(e){var t=this.gridLayout?this.headTbl:this.tbl,n,r=tf_Tag(this.tbl,"thead");for(var i=0;i<this.nbCells;i++){if(i!=e)continue;r.length==0&&(n=t.rows[this.headersRow].cells[i]),r.length==1&&(n=r[0].rows[this.headersRow].cells[i]);break}return n},TF.prototype.GetTableData=function(){var e=this.tbl.rows;for(var t=this.refRow;t<this.nbRows;t++){var n,r;n=[t,[]];var i=e[t].cells;for(var s=0;s<i.length;s++){var o=this.GetCellData(s,i[s]);n[1].push(o)}this.tblData.push(n)}return this.tblData},TF.prototype.GetFilteredData=function(e){if(!this.validRowsIndex)return[];var t=this.tbl.rows,n=[];if(e){var r=this.gridLayout?this.headTbl:this.tbl,i=r.rows[this.headersRow],s=[i.rowIndex,[]];for(var o=0;o<this.nbCells;o++){var u=this.GetCellData(o,i.cells[o]);s[1].push(u)}n.push(s)}var a=this.GetValidRowsIndex(!0);for(var f=0;f<a.length;f++){var s,l;s=[this.validRowsIndex[f],[]];var c=t[this.validRowsIndex[f]].cells;for(var o=0;o<c.length;o++){var h=this.GetCellData(o,c[o]);s[1].push(h)}n.push(s)}return n},TF.prototype.GetFilteredDataCol=function(e){if(e==undefined)return[];var t=this.GetFilteredData(),n=[];for(var r=0;r<t.length;r++){var i=t[r],s=i[1],o=s[e];n.push(o)}return n},TF.prototype.GetConfigObject=function(){return this.fObj},TF.prototype.GetImportedModules=function(){return this.importedModules||[]},TF.prototype.GetFilterableRowsNb=function(){return this.GetRowsNb(!1)};