Best JavaScript code snippet using fast-check-monorepo
TableSort.js
Source:TableSort.js
1// TableSort 9.22// Jürgen Berkemeier, 7. 7. 20163// www.j-berkemeier.de4( function() { 5 "use strict";6 var JB_sortbutStyle = document.createElement('style'); // Stylesheet für Button im TH7 JB_sortbutStyle.innerText = 'button.sortbut { width:100%; height:100%; border: none; background-color: transparent; font: inherit; color: inherit; text-align: inherit; padding: 0; cursor: pointer; } button.sortbut::-moz-focus-inner { margin: -1px; border-width: 1px; padding: 0; }';8 document.head.appendChild(JB_sortbutStyle);9 var JB_Table = function(tab) {10 11 var up = String.fromCharCode(9650);12 var down = String.fromCharCode(9660);13 // var up = String.fromCharCode(8593);14 // var down = String.fromCharCode(8595);15 // var up = String.fromCharCode(11014);16 // var down = String.fromCharCode(11015);17 var no = String.fromCharCode(160,160,160); // Idee: 9674 ???18 var dieses = this;19 var defsort = 0;20 var startsort_u = -1,startsort_d = -1;21 var first = true;22 var ssort;23 var tbdy = tab.getElementsByTagName("tbody")[0];24 var tz = tbdy.rows;25 var nzeilen = tz.length;26 if (nzeilen==0) return;27 var nspalten = tz[0].cells.length;28 var Titel = tab.getElementsByTagName("thead")[0].getElementsByTagName("tr")[0].getElementsByTagName("th");29 var Arr = new Array(nzeilen);30 var ct = 0;31 var sdir = new Array(nspalten);32 var stype = new Array(nspalten); 33 var sortable = new Array(nspalten); 34 for(var i=0;i<nspalten;i++) { 35 stype[i] = "n";36 sdir[i] = "u";37 sortable[i] = false;38 }39 40 var initTableHead = function(t,nr) {41 var b = document.createElement("button");42 b.type = "button";43 b.className = "sortbut"44 b.innerHTML = t.innerHTML;45 t.innerHTML = "";46 if(window.addEventListener) b.addEventListener("click",function() { dieses.sort(nr); },false);47 //b.title = 'Die Tabelle nach "'+b.textContent+'" sortieren.';48 t.appendChild(b);49 sortsymbol.init(t,no);50 if(t.className.indexOf("vorsortiert-")>-1) {51 sortsymbol.set(t,down);52 ssort = nr;53 }54 else if(t.className.indexOf("vorsortiert")>-1) {55 sortsymbol.set(t,up);56 ssort = nr;57 }58 if(t.className.indexOf("sortiere-")>-1) startsort_d=nr;59 else if(t.className.indexOf("sortiere")>-1) startsort_u=nr;60 sortable[nr] = true;61 } // initTableHead62 63 var sortsymbol = {64 init: function(t,s) {65 var tt = t.querySelector("button");66 var sp = tt.getElementsByTagName("span");67 for(var i=0;i<sp.length;i++) {68 if(!sp[i].hasChildNodes()) {69 t.sym = sp[i].appendChild(document.createTextNode(s));70 break;71 }72 }73 if(typeof(t.sym)=="undefined") t.sym = tt.appendChild(document.createTextNode(s));74 },75 set: function(t,s) {76 t.sym.data = s;77 },78 get: function(t) {79 return t.sym.data;80 }81 } // sortsymbol82 var VglFkt_s = function(a,b) {83 var as = a[ssort], bs = b[ssort];84 var ret=(as>bs)?1:(as<bs)?-1:0;85 if(!ret && ssort!=defsort) {86 if (stype[defsort]=="s") { as = a[defsort]; bs = b[defsort]; ret = (as>bs)?1:(as<bs)?-1:0; }87 else ret = parseFloat(a[defsort])-parseFloat(b[defsort])88 }89 return ret;90 } // VglFkt_s91 var VglFkt_n = function(a,b) {92 var ret = parseFloat(a[ssort])-parseFloat(b[ssort]);93 if(!ret && ssort!=defsort) {94 if (stype[defsort]=="s") { var as = a[defsort],bs = b[defsort]; ret = (as>bs)?1:(as<bs)?-1:0; }95 else ret = parseFloat(a[defsort])-parseFloat(b[defsort]);96 }97 return ret;98 } // VglFkt_n99 var convert = function(val,s) {100 var dmy;101 var trmdat = function() {102 if(dmy[0]<10) dmy[0] = "0" + dmy[0];103 if(dmy[1]<10) dmy[1] = "0" + dmy[1];104 if(dmy[2]<10) dmy[2] = "200" + dmy[2];105 else if(dmy[2]<20) dmy[2] = "20" + dmy[2];106 else if(dmy[2]<99) dmy[2] = "19" + dmy[2];107 else if(dmy[2]>9999) dmy[2] = "9999";108 }109 if(val.length==0) val = "0";110 if(!isNaN(val) && val.search(/[0-9]/)!=-1) return val;111 var n = val.replace(",",".");112 if(!isNaN(n) && n.search(/[0-9]/)!=-1) return n;113 n = n.replace(/\s| | |\u00A0/g,"");114 if(!isNaN(n) && n.search(/[0-9]/)!=-1) return n;115 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+\s+\d+:\d\d\:\d\d\s*$/)) {116 var dp = val.search(":");117 dmy = val.substring(0,dp-2).split(".");118 dmy[3] = val.substring(dp-2,dp);119 dmy[4] = val.substring(dp+1,dp+3);120 dmy[5] = val.substring(dp+4,dp+6);121 for(var i=0;i<6;i++) dmy[i] = parseInt(dmy[i],10);122 trmdat();123 for(var i=3;i<6;i++) if(dmy[i]<10) dmy[i] = "0" + dmy[i];124 return (""+dmy[2]+dmy[1]+dmy[0]+"."+dmy[3]+dmy[4]+dmy[5]).replace(/ /g,"");125 }126 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+\s+\d+:\d\d\s*$/)) {127 var dp = val.search(":");128 dmy = val.substring(0,dp-2).split(".");129 dmy[3] = val.substring(dp-2,dp);130 dmy[4] = val.substring(dp+1,dp+3);131 for(var i=0;i<5;i++) dmy[i] = parseInt(dmy[i],10);132 trmdat();133 for(var i=3;i<5;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];134 return (""+dmy[2]+dmy[1]+dmy[0]+"."+dmy[3]+dmy[4]).replace(/ /g,"");135 }136 if(!val.search(/^\s*\d+:\d\d\:\d\d\s*$/)) {137 dmy = val.split(":");138 for(var i=0;i<3;i++) dmy[i] = parseInt(dmy[i],10);139 for(var i=0;i<3;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];140 return (""+dmy[0]+dmy[1]+"."+dmy[2]).replace(/ /g,"");141 }142 if(!val.search(/^\s*\d+:\d\d\s*$/)) {143 dmy = val.split(":");144 for(var i=0;i<2;i++) dmy[i] = parseInt(dmy[i],10);145 for(var i=0;i<2;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];146 return (""+dmy[0]+dmy[1]).replace(/ /g,"");147 }148 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+/)) {149 dmy = val.split(".");150 for(var i=0;i<3;i++) dmy[i] = parseInt(dmy[i],10);151 trmdat();152 return (""+dmy[2]+dmy[1]+dmy[0]).replace(/ /g,"");153 }154 stype[s] = "s";155// return val.toLowerCase().replace(/\u00e4/g,"ae").replace(/\u00f6/g,"oe").replace(/\u00fc/g,"ue").replace(/\u00df/g,"ss");156 return val.toLowerCase().replace(/\u00e4/g,"a ").replace(/\u00f6/g,"o ").replace(/\u00fc/g,"u ").replace(/\u00df/g,"ss");157 } // convert158 this.sort = function(sp) {159 if(sp<0 || sp>=nspalten) return;160 if(!sortable[sp]) return;161 if(typeof(JB_presort)=="function") JB_presort(tab,tbdy,tz,nzeilen,nspalten,ssort);162 if (first) {163 for(var z=0;z<nzeilen;z++) {164 var zelle = tz[z].getElementsByTagName("td"); // cells;165 Arr[z] = new Array(nspalten+1);166// Arr[z] = new Array(nspalten*2);167 Arr[z][nspalten] = tz[z];168 for(var s=0;s<nspalten;s++) {169 if (zelle[s].getAttribute("data-sort_key")) 170 var zi = convert(zelle[s].getAttribute("data-sort_key"),s);171 else if (zelle[s].getAttribute("sort_key")) 172 var zi = convert(zelle[s].getAttribute("sort_key"),s);173 else 174 var zi = convert(zelle[s].textContent,s);175 Arr[z][s] = zi ;176// Arr[z][s+nspalten] = zelle[s].innerHTML;177 /* zelle[s].innerHTML += "<br>"+zi; // zum Debuggen */178 }179 }180 first = false;181 }182 if(sp==ssort) {183 Arr.reverse() ;184 if ( sortsymbol.get(Titel[ssort])==down )185 sortsymbol.set(Titel[ssort],up);186 else187 sortsymbol.set(Titel[ssort],down);188 }189 else {190 if ( ssort>=0 && ssort<nspalten ) sortsymbol.set(Titel[ssort],no);191 ssort = sp;192 if(stype[ssort]=="s") Arr.sort(VglFkt_s);193 else Arr.sort(VglFkt_n);194 if(sdir[ssort]=="u") {195 sortsymbol.set(Titel[ssort],up);196 }197 else {198 Arr.reverse() ;199 sortsymbol.set(Titel[ssort],down);200 }201 }202/* for(var z=0;z<nzeilen;z++) {203 var zelle = tz[z].getElementsByTagName("td"); // cells;204 for(var s=0;s<nspalten;s++) 205 zelle[s].innerHTML = Arr[z][s+nspalten];206 }*/207 for(var z=0;z<nzeilen;z++)208 tbdy.appendChild(Arr[z][nspalten]);209 if(typeof(JB_aftersort)=="function") JB_aftersort(tab,tbdy,tz,nzeilen,nspalten,ssort);210 } // sort211 //if(!tab.title.length) tab.title="Ein Klick auf die Spalten\u00fcberschrift sortiert die Tabelle."; 212 for(var i=Titel.length-1;i>-1;i--) {213 var t=Titel[i];214 if(t.className.indexOf("sortier")>-1) {215 ct++;216 initTableHead(t,i);217 defsort = i ;218 if(t.className.indexOf("sortierbar-")>-1) sdir[i] = "d";219 }220 }221 if(ct==0) {222 for(var i=0;i<Titel.length;i++) 223 initTableHead(Titel[i],i);224 defsort = 0;225 }226 if(startsort_u>=0) this.sort(startsort_u);227 if(startsort_d>=0) { this.sort(startsort_d); this.sort(startsort_d); }228 if(typeof(JB_aftersortinit)=="function") JB_aftersortinit(tab,tbdy,tz,nzeilen,nspalten,-1);229 } // JB_Table230 var JB_initTableSort = function() {231 if (!document.querySelectorAll) return;232 var JB_Tables = [];233 var Sort_Table = document.querySelectorAll("table.sortierbar, table[sortable]");234 for(var i=0;i<Sort_Table.length;i++) JB_Tables.push(new JB_Table(Sort_Table[i]));235 var pars = decodeURI(window.location.search.substring(1));236 if(pars.length) { // jbts=((0,1),(10,0),(3,3),(2,2)) tnr,snr237 pars = pars.replace(/\s/g,"");238 pars = pars.match(/jbts=\(?(\(\d+,\d+\),?){1,}\)?/gi); 239 if(pars) {240 pars = pars[0].substr(pars[0].search("=")+1); 241 pars = pars.replace(/\(\(/g,"(").replace(/\)\)/g,")").replace(/\)\(/g,")|(").replace(/\),\(/g,")|("); 242 pars = pars.split("|");243 for(var i=0;i<pars.length;i++) {244 var p = pars[i].substring(1,pars[i].length-1).split(","); 245 if(p[0]>-1&&p[0]<JB_Tables.length) JB_Tables[p[0]].sort(p[1]);246 }247 }248 } 249 } // initTableSort250 if(window.addEventListener) window.addEventListener("DOMContentLoaded",JB_initTableSort,false);...
table_sort.js
Source:table_sort.js
1// TableSort 9.12// Jürgen Berkemeier, 2. 7. 20163// www.j-berkemeier.de4// Added module OneForAll localisations vars5// txt_sort_by1, txt_sort_by2, txt_sort_table6( function() { 7 "use strict";8 var JB_sortbutStyle = document.createElement('style'); // Stylesheet für Button im TH9 JB_sortbutStyle.innerText = 'button.sortbut { width:100%; height:100%; border: none; background-color: transparent; font: inherit; color: inherit; text-align: inherit; padding: 0; cursor: pointer; } button.sortbut::-moz-focus-inner { margin: -1px; border-width: 1px; padding: 0; }';10 document.head.appendChild(JB_sortbutStyle);11 var JB_Table = function(tab) {12 13 var up = String.fromCharCode(9650);14 var down = String.fromCharCode(9660);15 // var up = String.fromCharCode(8593);16 // var down = String.fromCharCode(8595);17 // var up = String.fromCharCode(11014);18 // var down = String.fromCharCode(11015);19 var no = String.fromCharCode(160,160,160,160); // Idee: 9674 ???20 var dieses = this;21 var defsort = 0;22 var startsort_u = -1,startsort_d = -1;23 var first = true;24 var ssort;25 var tbdy = tab.getElementsByTagName("tbody")[0];26 var tz = tbdy.rows;27 var nzeilen = tz.length;28 if (nzeilen==0) return;29 var nspalten = tz[0].cells.length;30 var Titel = tab.getElementsByTagName("thead")[0].getElementsByTagName("tr")[0].getElementsByTagName("th");31 var Arr = new Array(nzeilen);32 var ct = 0;33 var sdir = new Array(nspalten);34 var stype = new Array(nspalten); 35 var sortable = new Array(nspalten); 36 for(var i=0;i<nspalten;i++) { 37 stype[i] = "n";38 sdir[i] = "u";39 sortable[i] = false;40 }41 42 var initTableHead = function(t,nr) {43 var b = document.createElement("button");44 b.type = "button";45 b.className = "sortbut"46 b.innerHTML = t.innerHTML;47 t.innerHTML = "";48 if(window.addEventListener) b.addEventListener("click",function() { dieses.sort(nr); },false);49 b.title = txt_sort_by1+' "'+b.textContent+'"'+txt_sort_by2+'.';50 t.appendChild(b);51 sortsymbol.init(t,no);52 if(t.className.indexOf("vorsortiert-")>-1) {53 sortsymbol.set(t,down);54 ssort = nr;55 }56 else if(t.className.indexOf("vorsortiert")>-1) {57 sortsymbol.set(t,up);58 ssort = nr;59 }60 if(t.className.indexOf("sortiere-")>-1) startsort_d=nr;61 else if(t.className.indexOf("sortiere")>-1) startsort_u=nr;62 sortable[nr] = true;63 } // initTableHead64 65 var sortsymbol = {66 init: function(t,s) {67 var tt = t.querySelector("button");68 var sp = tt.getElementsByTagName("span");69 for(var i=0;i<sp.length;i++) {70 if(!sp[i].hasChildNodes()) {71 t.sym = sp[i].appendChild(document.createTextNode(s));72 break;73 }74 }75 if(typeof(t.sym)=="undefined") t.sym = tt.appendChild(document.createTextNode(s));76 },77 set: function(t,s) {78 t.sym.data = s;79 },80 get: function(t) {81 return t.sym.data;82 }83 } // sortsymbol84 var VglFkt_s = function(a,b) {85 var as = a[ssort], bs = b[ssort];86 var ret=(as>bs)?1:(as<bs)?-1:0;87 if(!ret && ssort!=defsort) {88 if (stype[defsort]=="s") { as = a[defsort]; bs = b[defsort]; ret = (as>bs)?1:(as<bs)?-1:0; }89 else ret = parseFloat(a[defsort])-parseFloat(b[defsort])90 }91 return ret;92 } // VglFkt_s93 var VglFkt_n = function(a,b) {94 var ret = parseFloat(a[ssort])-parseFloat(b[ssort]);95 if(!ret && ssort!=defsort) {96 if (stype[defsort]=="s") { var as = a[defsort],bs = b[defsort]; ret = (as>bs)?1:(as<bs)?-1:0; }97 else ret = parseFloat(a[defsort])-parseFloat(b[defsort]);98 }99 return ret;100 } // VglFkt_n101 var convert = function(val,s) {102 var dmy;103 var trmdat = function() {104 if(dmy[0]<10) dmy[0] = "0" + dmy[0];105 if(dmy[1]<10) dmy[1] = "0" + dmy[1];106 if(dmy[2]<10) dmy[2] = "200" + dmy[2];107 else if(dmy[2]<20) dmy[2] = "20" + dmy[2];108 else if(dmy[2]<99) dmy[2] = "19" + dmy[2];109 else if(dmy[2]>9999) dmy[2] = "9999";110 }111 if(val.length==0) val = "0";112 if(!isNaN(val) && val.search(/[0-9]/)!=-1) return val;113 var n = val.replace(",",".");114 if(!isNaN(n) && n.search(/[0-9]/)!=-1) return n;115 n = n.replace(/\s| | |\u00A0/g,"");116 if(!isNaN(n) && n.search(/[0-9]/)!=-1) return n;117 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+\s+\d+:\d\d\:\d\d\s*$/)) {118 var dp = val.search(":");119 dmy = val.substring(0,dp-2).split(".");120 dmy[3] = val.substring(dp-2,dp);121 dmy[4] = val.substring(dp+1,dp+3);122 dmy[5] = val.substring(dp+4,dp+6);123 for(var i=0;i<6;i++) dmy[i] = parseInt(dmy[i],10);124 trmdat();125 for(var i=3;i<6;i++) if(dmy[i]<10) dmy[i] = "0" + dmy[i];126 return (""+dmy[2]+dmy[1]+dmy[0]+"."+dmy[3]+dmy[4]+dmy[5]).replace(/ /g,"");127 }128 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+\s+\d+:\d\d\s*$/)) {129 var dp = val.search(":");130 dmy = val.substring(0,dp-2).split(".");131 dmy[3] = val.substring(dp-2,dp);132 dmy[4] = val.substring(dp+1,dp+3);133 for(var i=0;i<5;i++) dmy[i] = parseInt(dmy[i],10);134 trmdat();135 for(var i=3;i<5;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];136 return (""+dmy[2]+dmy[1]+dmy[0]+"."+dmy[3]+dmy[4]).replace(/ /g,"");137 }138 if(!val.search(/^\s*\d+:\d\d\:\d\d\s*$/)) {139 dmy = val.split(":");140 for(var i=0;i<3;i++) dmy[i] = parseInt(dmy[i],10);141 for(var i=0;i<3;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];142 return (""+dmy[0]+dmy[1]+"."+dmy[2]).replace(/ /g,"");143 }144 if(!val.search(/^\s*\d+:\d\d\s*$/)) {145 dmy = val.split(":");146 for(var i=0;i<2;i++) dmy[i] = parseInt(dmy[i],10);147 for(var i=0;i<2;i++) if(dmy[i]<10) dmy[i] = "0"+dmy[i];148 return (""+dmy[0]+dmy[1]).replace(/ /g,"");149 }150 if(!val.search(/^\s*\d+\s*\.\s*\d+\s*\.\s*\d+/)) {151 dmy = val.split(".");152 for(var i=0;i<3;i++) dmy[i] = parseInt(dmy[i],10);153 trmdat();154 return (""+dmy[2]+dmy[1]+dmy[0]).replace(/ /g,"");155 }156 stype[s] = "s";157// return val.toLowerCase().replace(/\u00e4/g,"ae").replace(/\u00f6/g,"oe").replace(/\u00fc/g,"ue").replace(/\u00df/g,"ss");158 return val.toLowerCase().replace(/\u00e4/g,"a ").replace(/\u00f6/g,"o ").replace(/\u00fc/g,"u ").replace(/\u00df/g,"ss");159 } // convert160 this.sort = function(sp) {161 if(sp<0 || sp>=nspalten) return;162 if(!sortable[sp]) return;163 if (first) {164 for(var z=0;z<nzeilen;z++) {165 var zelle = tz[z].getElementsByTagName("td"); // cells;166 Arr[z] = new Array(nspalten+1);167 Arr[z][nspalten] = tz[z];168 for(var s=0;s<nspalten;s++) {169 if (zelle[s].getAttribute("data-sort_key")) 170 var zi = convert(zelle[s].getAttribute("data-sort_key"),s);171 else if (zelle[s].getAttribute("sort_key")) 172 var zi = convert(zelle[s].getAttribute("sort_key"),s);173 else 174 var zi = convert(zelle[s].textContent,s);175 Arr[z][s] = zi ;176 // zelle[s].innerHTML += "<br>"+zi; // zum Debuggen177 }178 }179 first = false;180 }181 if(sp==ssort) {182 Arr.reverse() ;183 if ( sortsymbol.get(Titel[ssort])==down )184 sortsymbol.set(Titel[ssort],up);185 else186 sortsymbol.set(Titel[ssort],down);187 }188 else {189 if ( ssort>=0 && ssort<nspalten ) sortsymbol.set(Titel[ssort],no);190 ssort = sp;191 if(stype[ssort]=="s") Arr.sort(VglFkt_s);192 else Arr.sort(VglFkt_n);193 if(sdir[ssort]=="u") {194 sortsymbol.set(Titel[ssort],up);195 }196 else {197 Arr.reverse() ;198 sortsymbol.set(Titel[ssort],down);199 }200 }201 for(var z=0;z<nzeilen;z++)202 tbdy.appendChild(Arr[z][nspalten]);203 if(typeof(JB_aftersort)=="function") JB_aftersort(tab,tbdy,tz,nzeilen,nspalten,ssort);204 } // sort205 if(!tab.title.length) tab.title=txt_sort_table;206 for(var i=Titel.length-1;i>-1;i--) {207 var t=Titel[i];208 if(t.className.indexOf("sortier")>-1) {209 ct++;210 initTableHead(t,i);211 defsort = i ;212 if(t.className.indexOf("sortierbar-")>-1) sdir[i] = "d";213 }214 }215 if(ct==0) {216 for(var i=0;i<Titel.length;i++) 217 initTableHead(Titel[i],i);218 defsort = 0;219 }220 if(startsort_u>=0) this.sort(startsort_u);221 if(startsort_d>=0) { this.sort(startsort_d); this.sort(startsort_d); }222 if(typeof(JB_aftersortinit)=="function") JB_aftersortinit(tab,tbdy,tz,nzeilen,nspalten,-1);223 } // JB_Table224 var JB_initTableSort = function() {225 if (!document.querySelectorAll) return;226 var JB_Tables = [];227 var Sort_Table = document.querySelectorAll("table.sortierbar, table[sortable]");228 for(var i=0;i<Sort_Table.length;i++) JB_Tables.push(new JB_Table(Sort_Table[i]));229 var pars = decodeURI(window.location.search.substring(1));230 if(pars.length) { // jbts=((0,1),(10,0),(3,3),(2,2)) tnr,snr231 pars = pars.replace(/\s/g,"");232 pars = pars.match(/jbts=\(?(\(\d+,\d+\),?){1,}\)?/gi); 233 if(pars) {234 pars = pars[0].substr(pars[0].search("=")+1); 235 pars = pars.replace(/\(\(/g,"(").replace(/\)\)/g,")").replace(/\)\(/g,")|(").replace(/\),\(/g,")|("); 236 pars = pars.split("|");237 for(var i=0;i<pars.length;i++) {238 var p = pars[i].substring(1,pars[i].length-1).split(","); 239 if(p[0]>-1&&p[0]<JB_Tables.length) JB_Tables[p[0]].sort(p[1]);240 }241 }242 } 243 } // initTableSort244 if(window.addEventListener) window.addEventListener("DOMContentLoaded",JB_initTableSort,false);...
GridView.js
Source:GridView.js
...25 },26 27 render : function(){28 if(this.header.row[0].sortSymbol==undefined)29 this.header.initializeSortSymbol();30 var text="<table id=\"jui_gridview\" class=\"jui_gridview\" cellspacing=\"0\" cellpadding=\"2px\" >";31 text+="<tr class=\"header\">";32 for(k=0;k<this.header.row.length;k++){33 text+="<td width=\""+ this.header.row[k].Width + "\"";34 text+=" onClick=\"JUI.Component.GridView.prototype.instances["+this.index+"].data.sortRows('"+this.header.row[k].Name+"')\"" + " >";35 text+=this.header.row[k].Label;36 text+=" <span class=\"updownsign\">"+ this.header.row[k].sortSymbol +"</span></td>";37 } 38 text+="</tr>"; 39 for(i=0; i<this.data.rows.length; i++){40 var fetchRow= this.data.rows[i];41 text+="<tr onMouseOver=\"JUI.Component.GridView.prototype.setStyle(this,'mouseover')\" onMouseOut=\"JUI.Component.GridView.prototype.setStyle(this,'')\">";42 for(j=0; j<this.header.row.length; j++){43 if(fetchRow[this.header.row[j].Name]==undefined || fetchRow[this.header.row[j].Name]==null ){44 text+="<td> </td>";45 }46 else{47 text+="<td>"+fetchRow[this.header.row[j].Name]+"</td>";48 }49 }50 text+="</tr>"; 51 }52 text+="</table>";53 document.getElementById(this.containerId).innerHTML = text;54 }55}; 56JUI.Component.GridView.Helper={};57JUI.Component.GridView.Helper.Rows=function(parent){58 this.rows =[];59 this.parent=parent;60 return this;61};62JUI.Component.GridView.Helper.Rows.prototype = {63 addRow : function(rowobj){64 this.rows.push(rowobj); 65 },66 67 deleteRow : function(){68 this.rows.pop();69 },70 71 sortRows : function(colName){72 var changedCol = this.parent.header.changeSortSymbol(colName);73 function sortfunction(a,b){ 74 75 if(changedCol.sortSymbol=="")76 {//ascending77 if (a[colName] === b[colName]) {78 return 0;79 }80 if (typeof a[colName] === typeof b[colName]) {81 return a[colName] < b[colName] ? -1 : 1;82 }83 return typeof a[colName] < typeof b[colName] ? -1 : 1;84 }85 else if(changedCol.sortSymbol=="")86 {//descending...
Using AI Code Generation
1const { SortSymbol } = require('fast-check-monorepo');2const sortSymbol = SortSymbol();3console.log(sortSymbol);4const { SortSymbol } = require('fast-check-monorepo');5const sortSymbol = SortSymbol();6console.log(sortSymbol);7fc.letrec( (tie) => ({8 a: fc.record({b: tie('b')}),9 b: fc.record({a: tie('a')})10}));11fc.letrec( (tie) => ({12 a: fc.record({b: tie('b')}),13 b: fc.record({a: tie('a')})14}));15fc.letrec( (tie) => ({16 a: fc.record({b: tie('b')}),17 b: fc.record({a: tie('a')})18}));
Using AI Code Generation
1import { SortSymbol } from 'fast-check-monorepo';2const sortSymbol = new SortSymbol();3console.log(sortSymbol.sortSymbol('abdc'));4import { SortSymbol } from 'fast-check-monorepo';5const sortSymbol = new SortSymbol();6console.log(sortSymbol.sortSymbol('abdc'));7import { SortSymbol } from 'fast-check-monorepo';8const sortSymbol = new SortSymbol();9console.log(sortSymbol.sortSymbol('abdc'));10import { SortSymbol } from 'fast-check-monorepo';11const sortSymbol = new SortSymbol();12console.log(sortSymbol.sortSymbol('abdc'));13import { SortSymbol } from 'fast-check-monorepo';14const sortSymbol = new SortSymbol();15console.log(sortSymbol.sortSymbol('abdc'));16import { SortSymbol } from 'fast-check-monorepo';17const sortSymbol = new SortSymbol();18console.log(sortSymbol.sortSymbol('abdc'));
Using AI Code Generation
1const { SortSymbol } = require('fast-check-monorepo');2console.log(SortSymbol);3const { SortSymbol } = require('fast-check-monorepo');4console.log(SortSymbol);5const { SortSymbol } = require('fast-check-monorepo');6console.log(SortSymbol);7const { SortSymbol } = require('fast-check-monorepo');8console.log(SortSymbol);9const { SortSymbol } = require('fast-check-monorepo');10console.log(SortSymbol);11const { SortSymbol } = require('fast-check-monorepo');12console.log(SortSymbol);13const { SortSymbol } = require('fast-check-monorepo');14console.log(SortSymbol);15const { SortSymbol } = require('fast-check-monorepo');16console.log(SortSymbol);17const { SortSymbol } = require('fast-check-monorepo');18console.log(SortSymbol);19const { SortSymbol } = require('fast-check-monorepo');20console.log(SortSymbol);21const { SortSymbol } = require('fast-check-monorepo');22console.log(SortSymbol);23const { Sort
Using AI Code Generation
1const { SortSymbol } = require('fast-check');2const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');3const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');4const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');5const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');6const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');7const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');8const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');9const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');10const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');11const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');12const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');13const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');14const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');15const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');16const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');17const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');18const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');19const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');20const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');21const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');22const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');23const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');24const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');25const { sortSymbol } = require('../dist/lib/check/arbitrary/SortSymbolArbitrary.js');26const { SortSymbol } = require('../dist/lib/check/arbitrary/SortSymbol.js');27const { sortSymbol } = require('../dist/lib/check/arbitrary
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!