jqwidgets-ng
Version:
[](https://jqwidgets.com/license/)
8 lines (7 loc) • 102 kB
JavaScript
/*
jQWidgets v23.0.0 (2025-May)
Copyright (c) 2011-2025 jQWidgets.
License: https://jqwidgets.com/license/
*/
/* eslint-disable */
(function(){if(typeof document==="undefined"){return}(function(a){a.extend(a.jqx._jqxGrid.prototype,{_updatefilterrowui:function(f){var m=this.columns.records.length;var e=0;var l=this;if(!this.filterrow){return}for(var i=0;i<m;i++){var g=this.columns.records[i];var c=parseInt(g.width);if(c<g.minwidth){c=g.minwidth}if(c>g.maxwidth){c=g.maxwidth}var k=a(this.filterrow[0].cells[i]);k.css("left",e);var h=true;if(k.width()==c){h=false}if(f){h=true}k.width(c);if(!k[0]){continue}k[0].left=e;if(g.element){k[0].style.width=g.element.style.width;k[0].style.left=g.element.style.left}if(!(g.hidden&&g.hideable)){e+=c}else{k.css("display","none")}if(!h){continue}if(g.createfilterwidget&&g.filtertype=="custom"){g.createfilterwidget(g,k)}else{if(g.filterable){var d=function(n,o){var j=a(o.children()[0]);if(j[0]){j[0].style.width=(c-8)+"px";if(a.jqx.browser.msie){j[0].style.width=(c-16)+"px"}}j.attr("disabled",n.disabled)};switch(g.filtertype){case"number":case"input":a(k.children()[0]).width(c);k.find("input")[0].style.width=(c-30)+"px";if(a.jqx.browser.msie){k.find("input")[0].style.width=(c-36)+"px"}k.find("input").attr("disabled",l.disabled);a(k.find(".jqx-dropdownlist-state-normal")).jqxDropDownList({theme:l.theme,disabled:l.disabled});break;case"date":case"range":if(this.host.jqxDateTimeInput){a(k.children()[0]).jqxDateTimeInput({theme:l.theme,disabled:l.disabled,width:c-10})}else{d(this,k)}break;case"textbox":case"default":d(this,k);break;case"list":case"checkedlist":if(this.host.jqxDropDownList){a(k.children()[0]).jqxDropDownList({theme:l.theme,disabled:l.disabled,width:c-10})}else{d(this,k)}break;case"bool":case"boolean":if(!this.host.jqxCheckBox){d(this,k)}else{a(k.children()[0]).jqxCheckBox({theme:l.theme,disabled:l.disabled})}break}}}}var b=a(this.filterrow.children()[0]);b.width(parseInt(e)+2);b.height(this.filterrowheight)},filterByQuery:function(l){var j=this;var f=[];for(var h=0;h<this.columns.records.length;h++){var e=this.columns.records[h];var m="string";if(!this.source){this.source=new a.jqx.dataAdapter({})}var d=this.source.datafields||((this.source._source)?this.source._source.datafields:null);if(d){var p="";a.each(d,function(){if(this.name==e.displayfield){if(this.type){p=this.type}return false}});if(p){m=p}}f.push({text:e.text,dataField:e.datafield,type:m})}function o(C){var v=C.trim();var w=[/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}-\d{2}-\d{2}$/,/^\d{2}\s+[A-Za-z]+\s+\d{4}$/,/^[A-Za-z]+\s+\d{2},\s+\d{4}$/];for(var I=0;I<w.length;I++){var J=w[I];var z=v.match(J);if(!z){continue}try{var H,L,B;if(J===w[0]){var E=v.split("/");var u=parseInt(E[0],10);var s=parseInt(E[1],10);var r=parseInt(E[2],10);if(u>12){H=u;L=s-1}else{if(s>12){H=s;L=u-1}else{L=u-1;H=s}}B=r}else{if(J===w[1]){var E=v.split("-");B=parseInt(E[0],10);L=parseInt(E[1],10)-1;H=parseInt(E[2],10)}else{if(J===w[2]){var E=v.split(" ");H=parseInt(E[0],10);L=n(E[1]);B=parseInt(E[2],10)}else{if(J===w[3]){var G=v.replace(",","");var D=G.split(" ");var x=D[0];var t=D[1];var y=D[2];L=n(x);H=parseInt(t,10);B=parseInt(y,10)}}}}var A=new Date(B,L,H);if(!isNaN(A.getTime())){return A}}catch(K){continue}}var F=new Date(v);return isNaN(F.getTime())?null:F}function n(r){var i=["january","february","march","april","may","june","july","august","september","october","november","december"];return i.indexOf(r.toLowerCase())}function c(y,t){function K(i){return i.trim().replace(/\s+/g," ")}function x(i){var R=new Date(i);if(!isNaN(R)){return R}return null}function O(R,i){if(i.type==="date"){var S=x(R);if(S){return S.toISOString().split("T")[0]}return R}if(i.type==="boolean"||i.type==="bool"){if(R.toLowerCase()==="true"){return true}if(R.toLowerCase()==="false"){return false}return R}if(i.type==="number"){var T=parseFloat(R);if(!isNaN(T)){return T}return R}return R}var v=[{keyword:"greater than or equal to",op:"GREATER_THAN_OR_EQUAL"},{keyword:"greater than or equal",op:"GREATER_THAN_OR_EQUAL"},{keyword:"greater than",op:"GREATER_THAN"},{keyword:"less than or equal to",op:"LESS_THAN_OR_EQUAL"},{keyword:"less than or equal",op:"LESS_THAN_OR_EQUAL"},{keyword:"less than",op:"LESS_THAN"},{keyword:"not equal to",op:"NOT_EQUAL"},{keyword:"not equal",op:"NOT_EQUAL"},{keyword:"not equals",op:"NOT_EQUAL"},{keyword:"starts with",op:"STARTS_WITH"},{keyword:"ends with",op:"ENDS_WITH"},{keyword:"contains",op:"CONTAINS"},{keyword:"is",op:"EQUAL"},{keyword:"=",op:"EQUAL"},];var w=["and","or"];var J=["<=",">=","<>","!=","<",">"];var P=t.slice().sort(function(R,i){return i.text.length-R.text.length});var s=[];for(var M=0;M<P.length;M++){var z=P[M];var u=z.text.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");s.push({col:z,regex:new RegExp("^"+u,"i")})}function B(U){var X="";var T=0;while(T<U.length){if(U.charAt(T)==="("||U.charAt(T)===")"){break}var W=U.slice(T).match(/^(and|or)\b/i);if(W){break}var R=false;for(var S=0;S<s.length;S++){var V=s[S].regex;if(U.slice(T).match(V)){R=true;break}}if(R){break}X+=U.charAt(T);T++}return{value:X.trim(),length:T}}function r(ab){var Y=[];var ae=ab.trim();while(ae.length>0){var X=/^\s+/.exec(ae);if(X){ae=ae.slice(X[0].length);continue}if(ae.charAt(0)==="("){Y.push({type:"OPEN_PAREN"});ae=ae.slice(1);continue}if(ae.charAt(0)===")"){Y.push({type:"CLOSE_PAREN"});ae=ae.slice(1);continue}var W=ae.match(/^(and|or)\b/i);if(W){Y.push({type:"LOGIC",value:W[1].toUpperCase()});ae=ae.slice(W[0].length);continue}var ad=null;for(var U=0;U<s.length;U++){var S=s[U].col;var aa=s[U].regex;var T=aa.exec(ae);if(T){ad=S;Y.push({type:"COLUMN",value:ad});ae=ae.slice(T[0].length);break}}if(ad){continue}var R=null;for(var U=0;U<v.length;U++){var V=v[U];if(ae.toLowerCase().indexOf(V.keyword)===0){R=V.op;Y.push({type:"OPERATOR",value:R});ae=ae.slice(V.keyword.length);break}}if(R){continue}var Z=null;for(var U=0;U<J.length;U++){if(ae.indexOf(J[U])===0){Z=J[U];break}}if(Z){Y.push({type:"OPERATOR",value:Z});ae=ae.slice(Z.length);continue}if(ae.charAt(0)==="="){Y.push({type:"OPERATOR",value:"EQUAL"});ae=ae.slice(1);continue}if(ae.charAt(0)===":"){Y.push({type:"OPERATOR",value:"EQUAL"});ae=ae.slice(1);continue}var ac=B(ae);if(ac.value.length>0){Y.push({type:"VALUE",value:ac.value});ae=ae.slice(ac.length);continue}break}return Y}y=K(y).toLowerCase();y=y.replace(/\b(filter\s+by|where\s+value)\b/g,"").trim();var G=r(y);var A=0;var E=null;var D={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","!=":"NOT_EQUAL","<>":"NOT_EQUAL",};function I(){return G[A]}function F(R){var i=G[A];if(!i){return null}if(!R||i.type===R){A++;return i}return null}function H(){var T=L();while(true){var S=I();if(!S||S.type!=="LOGIC"){break}var i=F("LOGIC").value;var R=L();T={logic:i,conditions:[T,R]}}return T}function L(){var ac=I();if(ac&&ac.type==="OPEN_PAREN"){F("OPEN_PAREN");var Z=H();F("CLOSE_PAREN");return Z}ac=I();var V=null;if(ac&&ac.type==="COLUMN"){V=F("COLUMN").value;E=V}else{if(ac&&ac.type==="VALUE"&&E){V=E}else{console.warn("Expected COLUMN or VALUE but got",ac);return null}}var S="EQUAL";var Y=I();if(Y&&Y.type==="OPERATOR"){var U=F("OPERATOR").value;S=D.hasOwnProperty(U)?D[U]:U}var ab=F("VALUE");if(!ab){console.warn("Expected VALUE token");return null}var W=ab.value.split(/\s+or\s+/i);var aa=[];for(var X=0;X<W.length;X++){var T=K(W[X]);if(T){aa.push(T)}}var R=[];for(var X=0;X<aa.length;X++){R.push({field:V.dataField,type:V.type,operator:S,value:O(aa[X],V)})}if(R.length===1){return R[0]}return{logic:"OR",conditions:R}}function Q(V,S){if(!V){return[]}if(typeof S==="undefined"){S="AND"}if(V.conditions){var U=[];for(var T=0;T<V.conditions.length;T++){var W=V.conditions[T];var R=(T===0)?S:V.logic;U=U.concat(Q(W,R))}return U}return[{field:V.field,type:V.type,operator:V.operator,value:V.value,logic:S}]}try{var C=H();return Q(C)}catch(N){console.error("Parse error:",N);return[]}}function k(x,w,t,r){var v="You are a helpful assistant converting natural language filter queries into structured JSON filters.\nUse only these columns:\n";for(var u=0;u<w.length;u++){var s=w[u];v+="- "+s.text+" ("+s.type+") => "+s.dataField+"\n"}v+='\nSupported operators: EQUAL, NOT_EQUAL, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, CONTAINS, STARTS_WITH, ENDS_WITH\n\nRespond in this format:\n[\n {\n "field": "dataField",\n "operator": "EQUAL",\n "value": "some value",\n "type": "string",\n "logic": "AND"\n }\n]\n';function y(A,i,E,D,B,F){var z=A||"https://api.openai.com/v1/chat/completions";var G=new XMLHttpRequest();G.open("POST",z,true);G.setRequestHeader("Authorization","Bearer "+i);G.setRequestHeader("Content-Type","application/json");G.onreadystatechange=function(){if(G.readyState===4){if(G.status>=200&&G.status<300){try{var I=JSON.parse(G.responseText);if(j._aiCanFetch){var K=I.choices[0].message.content;var H=JSON.parse(K);if(B&&typeof B==="function"){B(H)}j._aiCanFetch=false;F(null,H)}else{F(null,[])}}catch(J){console.error("Failed to parse OpenAI response:",G.responseText);F(J,[])}}else{console.error("Error calling OpenAI API:",G.status,G.statusText);F(new Error("HTTP error: "+G.status),[])}}};var C=JSON.stringify({model:"gpt-4",messages:[{role:"system",content:E},{role:"user",content:"Query: "+D}],temperature:0});G.send(C)}y(j.aiUrl,t,v,x,r,function(z,i){if(z){return}console.log(i)})}var b=this.aiKey;var g=function(s){function i(E){var B={};for(var D=0;D<E.length;D++){var x=E[D];var H=x.field;var F=x.type;var y=x.operator;var I=x.value;var z=x.logic;for(var C=0;C<j.columns.records.length;C++){var A=j.columns.records[C];if(H===A.text&&A.datafield){H=A.datafield}}if(!B[H]){var w=new a.jqx.filter();B[H]={filterGroup:w,logic:z||"and"}}if(z){B[H].logic=z||"and"}var G=B[H].filterGroup;var v;switch(F){case"string":v=G.createfilter("stringfilter",I,y);break;case"date":v=G.createfilter("datefilter",I,y);break;case"number":v=G.createfilter("numericfilter",I,y);break;case"boolean":case"bool":v=G.createfilter("booleanfilter",I,y);break;default:continue}G.addfilter(B[H].logic.toLowerCase(),v)}return B}j.clearfilters();var r=i(s);for(var u in r){if(r.hasOwnProperty(u)){var t=r[u].filterGroup;j.addfilter(u,t,false)}}j.applyfilters()};var q=c(l,f);if(q&&q.length>0){g(q)}else{if(b){k(l,f,b,g)}}},clearfilterrow:function(d){this._disablefilterrow=true;if(!this.columns.records){return}var m=this.columns.records.length;var e=0;for(var i=0;i<m;i++){var f=this.columns.records[i];var l=a(this.filterrow[0].cells[i]);if(typeof d=="string"){if(f.displayfield!=d){continue}}if(f.filterable){var c=function(o,p){var j=a(p.children()[0]);j.val("");if(j[0]){o["_oldWriteText"+j[0].id]=""}};switch(f.filtertype){case"number":case"input":l.find("input").val("");if(this.host.jqxDropDownList){var k=a(a(a(l).children()[0]).children()[1]);k.jqxDropDownList("clearSelection");var g=0;if(g==0){var b=this._getfiltersbytype(f.filtertype=="number"?"number":"string");var n=new a.jqx.filter();var h=n.getoperatorsbyfiltertype(f.filtertype=="number"?"numberfilter":"stringfilter");if(f.filtercondition!=null){g=h.indexOf(f.filtercondition.toUpperCase());if(g==-1){g=f.filtertype=="number"?0:2}}else{g=f.filtertype=="number"?0:2}}k.jqxDropDownList({selectedIndex:g});k.jqxDropDownList("ensureVisible",g)}break;case"date":case"range":if(this.host.jqxDateTimeInput){a(l.children()[0]).jqxDateTimeInput("setDate",null)}else{c(this,l)}break;case"textbox":case"default":c(this,l);break;case"list":if(this.host.jqxDropDownList){a(l.children()[0]).jqxDropDownList("clearSelection")}else{c(this,l)}break;case"checkedlist":if(this.host.jqxDropDownList){a(l.children()[0]).jqxDropDownList("checkAll",false)}else{c(this,l)}break;case"bool":case"boolean":if(!this.host.jqxCheckBox){c(this,l)}else{a(l.children()[0]).jqxCheckBox({checked:null})}break}}}this._disablefilterrow=false},_applyfilterfromfilterrow:function(){if(this._disablefilterrow==true){return}if(this.disabled){return}var A=this.columns.records.length;var E=this.that;for(var u=0;u<A;u++){var l=new a.jqx.filter();var v=this.columns.records[u];if(!v.filterable){continue}if(v.datafield===null){continue}var f=E._getcolumntypebydatafield(v);var d=E._getfiltertype(f);var m=1;var F=true;var e=v.filtertype;var C=function(j,M,J){var i=true;if(j._filterwidget){var H=j._filterwidget.val();if(H!=""){var K="equal";if(M=="stringfilter"){var K="contains"}if(M=="numericfilter"){if(E.gridlocalization.decimalseparator==","){if(H.indexOf(E.gridlocalization.decimalseparator)>=0){H=H.replace(E.gridlocalization.decimalseparator,".")}}}if(M!="stringfilter"){var L=0;if(H.indexOf(">")!=-1){K="greater_than";L=1}if(H.indexOf("<")!=-1){K="less_than";L=1}if(H.indexOf("=")!=-1){if(K=="greater_than"){K="greater_than_or_equal";L=2}else{if(K=="less_than"){K="less_than_or_equal";L=2}else{K="equal";L=1}}}if(L!=0){H=H.substring(L);if(H.length<1){return false}}}if(j.filtercondition!=undefined){K=j.filtercondition}if(M=="datefilter"){var I=J.createfilter(M,H,K,null,j.cellsformat,E.gridlocalization)}else{var I=J.createfilter(M,H,K)}J.addfilter(m,I)}else{i=false}}return i};switch(v.filtertype){case"range":case"date":if(v._filterwidget.jqxDateTimeInput){if(v.filtertype=="range"){var q=v._filterwidget.jqxDateTimeInput("getRange");if(q!=null&&q.from!=null&&q.to!=null){var p="GREATER_THAN_OR_EQUAL";var s=new Date(0);s.setHours(0);s.setMinutes(0);s.setFullYear(q.from.getFullYear(),q.from.getMonth(),q.from.getDate());var r=new Date(0);r.setHours(0);r.setMinutes(0);r.setFullYear(q.to.getFullYear(),q.to.getMonth(),q.to.getDate());r.setHours(q.to.getHours());r.setMinutes(q.to.getMinutes());r.setSeconds(q.to.getSeconds());var z=l.createfilter(d,s,p);l.addfilter(0,z);var c="LESS_THAN_OR_EQUAL";var y=l.createfilter(d,r,c);l.addfilter(0,y)}else{F=false}}else{var q=v._filterwidget.jqxDateTimeInput("getDate");if(q!=null){var s=new Date(0);s.setHours(0);s.setMinutes(0);s.setFullYear(q.getFullYear(),q.getMonth(),q.getDate());if(v._filterwidget.jqxDateTimeInput("showTimeButton")){s.setHours(q.getHours());s.setMinutes(q.getMinutes())}var p="EQUAL";if(v.filtercondition!=undefined){p=v.filtercondition}var z=l.createfilter(d,s,p);var h=v._filterwidget.jqxDateTimeInput("showTimeButton");if(h){z=l.createfilter(d,s,p,null,v.cellsformat)}l.addfilter(0,z)}else{F=false}}}else{F=C(v,d,l)}break;case"input":if(v._filterwidget){var q=v._filterwidget.find("input").val();var k=v._filterwidget.find(".filter").jqxDropDownList("selectedIndex");if(k<0){k=0}var x=l.getoperatorsbyfiltertype(d)[k];if(E.updatefilterconditions){var G=E.updatefilterconditions(d,l.getoperatorsbyfiltertype(d));if(G!=undefined){l.setoperatorsbyfiltertype(d,G)}var x=l.getoperatorsbyfiltertype(d)[k]}var o=x=="NULL"||x=="NOT_NULL";var t=x=="EMPTY"||x=="NOT_EMPTY";if(q!=undefined&&q.length>0||o||t){z=l.createfilter(d,q,x,null,v.cellsformat,E.gridlocalization);l.addfilter(0,z)}else{F=false}}else{F=false}break;case"number":if(v._filterwidget){var q=v._filterwidget.find("input").val();if(E.gridlocalization.decimalseparator==","){if(q.indexOf(E.gridlocalization.decimalseparator)>=0){q=q.replace(E.gridlocalization.decimalseparator,".")}}var k=v._filterwidget.find(".filter").jqxDropDownList("selectedIndex");var x=l.getoperatorsbyfiltertype(d)[k];if(E.updatefilterconditions){var G=E.updatefilterconditions(d,l.getoperatorsbyfiltertype(d));if(G!=undefined){l.setoperatorsbyfiltertype(d,G)}var x=l.getoperatorsbyfiltertype(d)[k]}var o=x=="NULL"||x=="NOT_NULL";var t=x=="EMPTY"||x=="NOT_EMPTY";if(q!=undefined&&q.length>0||o||t){z=l.createfilter(d,new Number(q),x,null,v.cellsformat,E.gridlocalization);l.addfilter(0,z)}else{F=false}}else{F=false}break;case"textbox":case"default":F=C(v,d,l);break;case"bool":case"boolean":if(v._filterwidget.jqxCheckBox){var q=v._filterwidget.jqxCheckBox("checked");if(q!=null){var p="equal";var n=l.createfilter(d,q,p);l.addfilter(m,n)}else{F=false}}else{F=C(v,d,l)}break;case"list":var g=v._filterwidget.jqxDropDownList("listBox");if(g.selectedIndex>=0){var b=g.getSelectedItem();var q=b.label;var B=b.value;var p="equal";if(q===""){p="NULL"}var n=l.createfilter(d,q,p);l.addfilter(m,n);if(B!==q){n.data=B}}else{F=false}break;case"checkedlist":if(v._filterwidget.jqxDropDownList){var g=v._filterwidget.jqxDropDownList("listBox");var D=g.getCheckedItems();if(D.length==0){for(var w=1;w<g.items.length;w++){var q=g.items[w].label;var B=g.items[w].value;var p="not_equal";if(q===""){p="NOT_NULL"}var n=l.createfilter(d,q,p);if(B!==q){n.data=B}l.addfilter(0,n)}F=true}else{if(D.length!=g.items.length){for(var w=0;w<D.length;w++){var q=D[w].label;var B=D[w].value;var p="equal";if(q===""){p="NULL"}var n=l.createfilter(d,q,p);if(B!==q){n.data=B}l.addfilter(m,n)}}else{F=false}}}else{F=C(v,d,l)}break}if(!this._loading){if(F){this.addfilter(v.displayfield,l,false)}else{this.removefilter(v.displayfield,false)}}}if(!this._loading){this.applyfilters("filterrow")}},_updatefilterrow:function(){var o=a('<div style="position: relative;" id="row00'+this.element.id+'"></div>');var h=0;var v=this.columns.records.length;var l=this.toThemeProperty("jqx-grid-cell");l+=" "+this.toThemeProperty("jqx-grid-cell-pinned");l+=" "+this.toThemeProperty("jqx-grid-cell-filter-row");var k=v+10;var f=new Array();var w=this.that;this.filterrow[0].cells=f;o.height(this.filterrowheight);this.filterrow.children().detach();this.filterrow.append(o);if(!this._filterrowcache){this._filterrowcache=new Array()}if(!this._idsCache){this._idsCache=new Array()}if(this._idsCache){for(var t=0;t<this._idsCache.length;t++){var n=this._idsCache[t].id;var g=this._idsCache[t].type;switch(g){case"dropDownList":a("#"+n).jqxDropDownList("destroy");break;case"dateTimeInput":a("#"+n).jqxDateTimeInput("destroy");break}}}this._initcolumntypes();var e=false;var d=new Array();var b=document.createDocumentFragment();for(var r=0;r<v;r++){var s=this.columns.records[r];var q=s.width;if(q<s.minwidth){q=s.minwidth}if(q>s.maxwidth){q=s.maxwidth}var c=document.createElement("div");c.style.overflow="hidden";c.style.position="absolute";c.style.height="100%";c.className=l;c=a(c);b.appendChild(c[0]);c[0].style.left=h+"px";if(this.rtl){c.css("z-index",k++);c.css("border-left-width","1px")}else{c.css("z-index",k--)}if(q=="auto"){q=0}c[0].style.width=parseFloat(q)+"px";c[0].left=h;if(!(s.hidden&&s.hideable)){h+=q}else{c.css("display","none")}f[f.length]=c[0];var p=true;if(!this.rtl){if(this.groupable){var u=(this.showrowdetailscolumn&&this.rowdetails)?1:0;if(this.groups.length+u>r){p=false}}if(this.showrowdetailscolumn&&this.rowdetails&&r==0){p=false}}else{if(this.groupable){var u=(this.showrowdetailscolumn&&this.rowdetails)?1:0;if(this.groups.length+u+r>v-1){p=false}}if(this.showrowdetailscolumn&&this.rowdetails&&r==v-1){p=false}}if(p){if(s.filtertype=="custom"&&s.createfilterwidget){var m=function(){w._applyfilterfromfilterrow()};s.createfilterwidget(s,c,m)}else{if(s.filterable){if(this._filterrowcache[s.datafield]){e=true;c.append(this._filterrowcache[s.datafield]);s._filterwidget=this._filterrowcache[s.datafield]}else{this._addfilterwidget(s,c,q);d[s.datafield]=s._filterwidget}}}}}o[0].appendChild(b);this._filterrowcache=d;if(a.jqx.browser.msie&&a.jqx.browser.version<8){o.css("z-index",k--)}o.width(parseFloat(h)+2);this.filterrow.addClass(l);this.filterrow.css("border-top-width","1px");this.filterrow.css("border-right-width","0px");if(e){this._updatefilterrowui(true)}},_getfilterdataadapter:function(b){var c=this.source._source?true:false;if(!c){var f=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[b.displayfield],autoSort:true,autoSortField:b.displayfield,async:false})}else{var e={localdata:a.extend(true,{},this.source.records),datatype:this.source.datatype,async:false};var d=this;var f=new a.jqx.dataAdapter(e,{autoBind:false,autoSort:true,autoSortField:b.displayfield,async:false,uniqueDataFields:[b.displayfield],beforeLoadComplete:function(g){var l=new Array();if(b.cellsformat){var k=d._getcolumntypebydatafield(b);for(var h=0;h<g.length;h++){l.push(g[h]);var j=g[h][b.displayfield];g[h][b.displayfield+"JQValue"]=j;if(k==="date"){if(j!=null){g[h][b.displayfield]=f.formatDate(j,b.cellsformat,d.gridlocalization)}else{g[h][b.displayfield]=""}}else{if(k==="number"||k==="float"||k==="int"){if(j!=null){g[h][b.displayfield]=f.formatNumber(j,b.cellsformat,d.gridlocalization)}else{g[h][b.displayfield]=""}}}}return l}else{return g}}})}if(b.filteritems&&b.filteritems.length>0){var e={localdata:b.filteritems,datatype:this.source.datatype,async:false};var f=new a.jqx.dataAdapter(e,{autoBind:false,async:false})}else{if(b.filteritems){if(b.filteritems._source){b.filteritems._options.autoBind=false;b.filteritems._options.async=false;return b.filteritems}else{if(a.isFunction(b.filteritems)){return b.filteritems()}}}}return f},refreshfilterrow:function(){if(!this.showfilterrow){return}this.refreshingfilter=true;this._updatefilterrowui();this._updatelistfilters(true,true);var h=this.that;var l=this.columns.records.length;for(var d=0;d<l;d++){var c=this.columns.records[d];if(c.filterable){if(c.filter){var b=c.filter.getfilters();if(b.length>0){var k=b[0].value;var e=c._filterwidget;var f=c._filterwidget.parent();if(e!=null){switch(c.filtertype){case"number":f.find("input").val(k);if(this.host.jqxDropDownList){var i=c.filter.getoperatorsbyfiltertype("numericfilter");e.find(".filter").jqxDropDownList("selectIndex",i.indexOf(b[0].condition))}break;case"input":f.find("input").val(k);if(this.host.jqxDropDownList){var i=c.filter.getoperatorsbyfiltertype("stringfilter");e.find(".filter").jqxDropDownList("selectIndex",i.indexOf(b[0].condition))}break;case"date":case"range":if(this.host.jqxDateTimeInput){var k=c.filter.getfilterat(0).filtervalue;if(k!=undefined){if(c.filter.getfilterat(1)){var g=c.filter.getfilterat(1).filtervalue}else{g=k}if(c.filtertype=="range"){a(f.children()[0]).jqxDateTimeInput("setRange",new Date(k),new Date(g))}else{a(f.children()[0]).jqxDateTimeInput("setDate",new Date(k))}}}else{e.val(k)}break;case"textbox":case"default":e.val(k);h["_oldWriteText"+e[0].id]=k;break;case"bool":case"boolean":if(!this.host.jqxCheckBox){e.val(k)}else{a(f.children()[0]).jqxCheckBox({checked:k})}break}}}}}}this.refreshingfilter=false},_destroyedfilters:function(){var g=this.that;var b=this.columns.records.length;for(var f=0;f<b;f++){var c=this.columns.records[f];if(c.filterable){var h=c._filterwidget;if(c.filtertype=="list"||c.filtertype=="checkedlist"){this.removeHandler(h,"select");this.removeHandler(h,"close");h.jqxDropDownList("destroy")}else{if(c.filtertype=="date"||c.filtertype=="range"){this.removeHandler(h,"valueChanged");h.jqxDateTimeInput("destroy")}else{if(c.filtertype=="bool"){this.removeHandler(h,"change");h.jqxCheckBox("destroy")}else{if(c.filtertype=="number"||c.filtertype==="input"){var d=h.find(".jqx-input");this.removeHandler(d,"keydown");var e=a(h.children()[1]);e.jqxDropDownList("destroy")}else{this.removeHandler(h,"keydown")}}}}h.remove()}}},_updatelistfilters:function(l,k){var v=this.that;var t=this.columns.records.length;for(var p=0;p<t;p++){var q=this.columns.records[p];if(q.filterable){if(q.filtertype=="list"||q.filtertype=="checkedlist"){var h=q._filterwidget;if(!l){if(q.filter==undefined){h.jqxDropDownList("renderSelection");continue}}else{var e=this._getfilterdataadapter(q);h.jqxDropDownList({source:e});var d=h.jqxDropDownList("getItems");var o=true;if(d.length!=e.records.length+1){o=false}if(o){for(var s=1;s<d.length;s++){if(d[s].label!=e.records[s-1][q.displayfield]){o=false;break}}}if(o&&!k){continue}}var m=q.filtertype=="checkedlist"?true:false;var d=h.jqxDropDownList("getItems");var b=h.jqxDropDownList("listBox");h.jqxDropDownList("dataBind");if(m){h.jqxDropDownList({selectionRenderer:function(){return v.gridlocalization.filterselectstring}});if(b.getItem(this.gridlocalization.filterselectallstring)==null){b.insertAt({label:this.gridlocalization.filterselectallstring},0)}var n=a('<span style="top: 2px; position: relative; color: inherit; border: none; background-color: transparent;">'+this.gridlocalization.filterselectstring+"</span>");n.addClass(this.toThemeProperty("jqx-item"));h.jqxDropDownList("setContent",n);b.checkAll(false);if(q.filter){var g=q.filter.getfilters();for(var s=0;s<b.items.length;s++){var f=b.items[s].label;var r=undefined;a.each(g,function(){var i;if(this.condition=="NOT_EQUAL"){if(f==this.value){i=false}else{i=true}}else{if(this.condition=="EQUAL"){if(f==this.value){i=true}else{i=false}}}if(r==undefined&&i!==undefined){r=i}else{if(this.condition=="EQUAL"){r=r||i}else{r=r&&i}}});if(r){b.checkIndex(s,false,false)}else{b.uncheckIndex(s,false,false)}}b._updateCheckedItems();var u=b.getCheckedItems().length;if(b.items.length!=u&&u>0){b.host.jqxListBox("indeterminateIndex",0,true,false)}}}else{if(b.getItem(this.gridlocalization.filterchoosestring)==null){b.insertAt({label:this.gridlocalization.filterchoosestring,value:""},0)}h.jqxDropDownList({selectedIndex:0});if(q.filter){var g=q.filter.getfilters();var c=-1;for(var s=0;s<b.items.length;s++){var f=b.items[s].label;a.each(g,function(){if(this.condition=="NOT_EQUAL"){return true}if(f==this.value){c=s;return false}})}if(c!=-1){b.selectIndex(c)}}}if(d.length<8){h.jqxDropDownList("autoDropDownHeight",true)}else{h.jqxDropDownList("autoDropDownHeight",false)}}}}},_renderfilter:function(){var f=this;var g=a("<div style='display: flex; height: calc(100% - 10px); margin-top: 5px; align-items: center; position: relative; margin-left: 4px;'><input title='Filter Input' style='width: 200px; height: 100%; direction: ltr;' role='textbox' type='text'/><div style='cursor: pointer; height: 100%;'><div></div></div></div>");var m=g.find("input");var e=g.find("div:first");g.addClass(this.toThemeProperty("jqx-rc-all"));g.addClass(this.toThemeProperty("jqx-widget"));g.addClass(this.toThemeProperty("jqx-input-group"));m.addClass(this.toThemeProperty("jqx-input"));m.addClass(this.toThemeProperty("jqx-rc-l"));m.addClass(this.toThemeProperty("jqx-input-group-addon"));m.addClass(this.toThemeProperty("jqx-widget"));m.addClass(this.toThemeProperty("jqx-widget-content"));e.addClass(this.toThemeProperty("jqx-fill-state-normal"));e.addClass(this.toThemeProperty("jqx-rc-r"));e.addClass(this.toThemeProperty("jqx-input-group-addon"));e.find("div").addClass(this.toThemeProperty("jqx-icon-search"));if(this.rtl){m.addClass(this.toThemeProperty("jqx-rtl"));m.css("direction","rtl")}this.filterbar.children().remove();this.filterbutton=e;var c=new Array();for(var d=0;d<f.columns.records.length;d++){if(f.columns.records[d].datafield&&f.columns.records[d].filterable){c.push({label:f.columns.records[d].text,value:f.columns.records[d].displayfield})}}var n=c.length<10?true:false;var j=a("<div aria-label='Search Columns' style='position: relative; display: none; margin-right: 4px; margin-left: 4px; float: left;'>"+this.gridlocalization.filtersearchstring+"</div>");this.filterbar.append(j);var b=a("<div aria-expanded='false' aria-label='Filter Columns' class='filtercolumns' style='position: relative; margin-top:5px; margin-left:4px; margin-right: 4px; float: left;'></div>");this.filterbar.append(b);if(b.jqxDropDownList){b.jqxDropDownList({theme:this.theme,enableBrowserBoundsDetection:true,autoDropDownHeight:n,rtl:f.rtl,dropDownWidth:220,selectedIndex:0,width:"auto",height:25,source:c,displayMember:"label",valueMember:"value"})}this.filtercolumnsList=b;m[0].parentElement.insertBefore(j[0],m[0]);var l=function(o){f.filterinput.val("");for(var p=0;p<f.dataview.filters.length;p++){var q=f.dataview.filters[p];if(q.datafield===o){f.filterinput.val(q.filter.getfilterat(0).filtervalue)}}};if(f.filterHeight!==35){}f._updateSimpleFilter=l;this.addHandler(b,"select",function(o){var i=o.args.item.value;l(i)});if(this.filterbarmode==="simple"){this.filtercolumnsList.hide();j.show()}else{this.filtercolumnsList.show();j.hide()}var k=function(){if(!e.hasClass("jqx-fill-state-disabled")){var p=m.val();if(b.jqxDropDownList){var s=b.jqxDropDownList("getSelectedItem")}var u=function(z,v,i){var y=new a.jqx.filter();var x=f._getcolumntypebydatafield(z);var A=f._getfiltertype(x);if(A=="datefilter"){var w=y.createfilter(A,v,"EQUAL",null,z.cellsFormat,f.gridlocalization)}else{if(A=="numericfilter"||A=="booleanfilter"){if(A=="numericfilter"){if(f.gridlocalization.decimalseparator==","){if(v.indexOf(f.gridlocalization.decimalseparator)>=0){v=v.replace(f.gridlocalization.decimalseparator,".")}}if(v.indexOf(f.gridlocalization.currencysymbol)>=0){v=v.replace(f.gridlocalization.currencysymbol,"")}if(v.indexOf(f.gridlocalization.percentagesymbol)>=0){v=v.replace(f.gridlocalization.percentagesymbol,"")}}var w=y.createfilter(A,v,"EQUAL",null,z.cellsFormat,f.gridlocalization)}else{var w=y.createfilter(A,v,"CONTAINS")}}y.operator=i;y.addfilter(0,w);return y};if(f.filterbarmode!=="simple"){if(s){var t=s.value;var r=u(t,p,"and");if(p.length>0){f.removefilter(t);f.addfilter(t,r);f.applyfilters()}else{f.removefilter(t);f.applyfilters()}}}else{f.clearfilters(false,false);if(p.length>0){for(var o=0;o<f.columns.records.length;o++){var q=f.columns.records[o];if(q.filterable!==true){continue}if((q.datatype==="date"||q.datatype==="number")&&p.indexOf("1")===-1&&p.indexOf("2")===-1&&p.indexOf("3")===-1&&p.indexOf("4")===-1&&p.indexOf("5")===-1&&p.indexOf("6")===-1&&p.indexOf("7")===-1&&p.indexOf("8")===-1&&p.indexOf("9")===-1){continue}var r=u(q,p,"or");f.addfilter(q.datafield,r)}}f.applyfilters()}if(f.dataview.filters.length==0){f.filtericon.fadeOut(200)}else{f.filtericon.fadeIn(200)}}};m.keydown(function(i){if(i.keyCode===13){k();if(i.preventDefault){i.preventDefault()}return false}});e.click(function(){k()});this.filterinput=m;this.filterbar.append(g);var h=a("<div style='float: left; width: 16px; height: 16px; position: relative; margin: 3px;'></div>");h.attr("title",f.gridlocalization.filterclearstring);h.addClass(f.toThemeProperty("jqx-icon-close"));g.append(h);h.hide();f.filtericon=h;h.click(function(){f.clearfilters();m.val("");f.filtericon.fadeOut(200)});if(f.dataview.filters.length>0){l(f.dataview.filters[0].datafield)}},_renderfiltercolumn:function(){var b=this.that;if(this.filterable){if(!this.columns.records){return}a.each(this.columns.records,function(d,e){var c=false;if(b.autoshowfiltericon){if(this.filter){a(this.filtericon).show();c=true}else{a(this.filtericon).hide()}}else{if(this.filterable){a(this.filtericon).show();c=true}}this.element.removeAttribute("filter");if(c){this.element.setAttribute("filter",true)}if(this.align=="right"&&!this.renderer){if(this.element){if(!c){this.element.firstChild.firstChild.style.marginRight="2px"}else{this.element.firstChild.firstChild.style.marginRight="18px"}}}})}},_initcolumntypes:function(){if(this.columns&&this.columns.records){var b=this.source._source.datafields;if(b){for(var c=0;c<this.columns.records.length;c++){var d=this.columns.records[c];if(d.datatype){continue}var e="";a.each(b,function(){if(this.name==d.displayfield){if(this.type){e=this.type}return false}});if(e!=""){d.datatype=e}else{d.datatype=""}}}}},_getcolumntypebydatafield:function(f){var g=this.that;var e="string";var d=g.source.datafields||((g.source._source)?g.source._source.datafields:null);if(d){var i="";a.each(d,function(){if(this.name==f.displayfield){if(this.type){i=this.type}return false}});if(i){return i}}if(f!=null){if(this.dataview.cachedrecords==undefined){return e}var b=null;if(!this.virtualmode){if(this.dataview.cachedrecords.length==0){return e}b=this.dataview.cachedrecords[0][f.displayfield];if(b!=null&&b.toString()==""){return"string"}}else{a.each(this.dataview.cachedrecords,function(){b=this[f.displayfield];return false})}if(b!=null){if(typeof b=="boolean"){e="boolean"}else{if(a.jqx.dataFormat.isNumber(b)){e="number"}else{var h=new Date(b);if(h.toString()=="NaN"||h.toString()=="Invalid Date"){if(a.jqx.dataFormat){h=a.jqx.dataFormat.tryparsedate(b);if(h!=null){if(h&&h.getFullYear()){if(h.getFullYear()==1970&&h.getMonth()==0&&h.getDate()==1){var c=new Number(b);if(!isNaN(c)){return"number"}return"string"}}return"date"}else{e="string"}}else{e="string"}}else{e="date"}}}}}return e},_getfiltersbytype:function(b){var c=this.that;var d="";switch(b){case"number":case"float":case"int":d=c.gridlocalization.filternumericcomparisonoperators;break;case"date":d=c.gridlocalization.filterdatecomparisonoperators;break;case"boolean":case"bool":d=c.gridlocalization.filterbooleancomparisonoperators;break;case"string":default:d=c.gridlocalization.filterstringcomparisonoperators;break}return d},_getfiltertype:function(b){var c="stringfilter";switch(b){case"number":case"int":case"float":case"decimal":c="numericfilter";break;case"boolean":case"bool":c="booleanfilter";break;case"date":case"time":case"range":c="datefilter";break;case"string":case"input":c="stringfilter";break}return c},_buildfilter:function(r,l,F){var f=a(l).find(".filter1");var G=a(l).find(".filter2");var K=a(l).find(".filter3");var k=a(l).find(".filtertext1"+r.element.id);var j=a(l).find(".filtertext2"+r.element.id);var A=k.val();var z=j.val();var M=r._getcolumntypebydatafield(F);var t=r._getfiltersbytype(M);var J=new a.jqx.filter();var w=r._getfiltertype(M);if(r.filtermode==="default"&&(F.filtertype!=="list"&&F.filtertype!=="checkedlist")){var E=f.jqxDropDownList("selectedIndex");var c=G.jqxDropDownList("selectedIndex");var D=K.jqxDropDownList("selectedIndex");var e=null;var d=null;if(r.updatefilterconditions){var p=r.updatefilterconditions(w,J.getoperatorsbyfiltertype(w));if(p!=undefined){J.setoperatorsbyfiltertype(w,p)}}var q=false;var L=J.getoperatorsbyfiltertype(w)[E];var K=J.getoperatorsbyfiltertype(w)[D];var v=L=="NULL"||L=="NOT_NULL";var h=L=="EMPTY"||L=="NOT_EMPTY";if(L==undefined){L=J.getoperatorsbyfiltertype(w)[0]}if(K==undefined){K=J.getoperatorsbyfiltertype(w)[0]}if(A.length>0||v||h){e=J.createfilter(w,A,L,null,F.cellsformat,r.gridlocalization);J.addfilter(c,e);q=true}var u=K=="NULL"||K=="NOT_NULL";var g=K=="EMPTY"||K=="NOT_EMPTY";if(z.length>0||u||g){d=J.createfilter(w,z,K,null,F.cellsformat,r.gridlocalization);J.addfilter(c,d);q=true}if(q){var C=F.displayfield;this.addfilter(C,J,true)}else{this._clearfilter(r,l,F)}}else{if(r.filtermode==="excel"||(F.filtertype==="list"||F.filtertype==="checkedlist")){var B=this;var n=false;var x=f.data().jqxListBox.instance;var I=this.filtermode==="excel"||F.filtertype==="checkedlist";var o=x.getCheckedItems();if(!I){var o=x.getSelectedItems()}if(o.length==0){for(var H=1;H<x.items.length;H++){var m=x.items[H].value;if(m===undefined){m=""}var b="not_equal";if(m&&m.indexOf){if(m.indexOf("|")>=0||m.indexOf(" AND ")>=0||m.indexOf(" OR ")>=0||m.indexOf(" and ")>=0||m.indexOf(" or ")>=0){m=m.replace("|","");m=m.replace("AND","");m=m.replace("OR","");m=m.replace("and","");m=m.replace("or","");var b="equal"}}if(w=="datefilter"){var y=J.createfilter(w,m,b,null,F.cellsformat,r.gridlocalization)}else{var y=J.createfilter(w,m,b,null)}J.addfilter(0,y)}n=true}else{if(o.length!=x.items.length){n=true;for(var H=0;H<o.length;H++){if(r.gridlocalization.filterselectallstring===o[H].value){continue}var m=o[H].value;if(m===undefined){m=""}var b="equal";if(w=="datefilter"){var y=J.createfilter(w,m,b,null,F.cellsformat,r.gridlocalization)}else{var y=J.createfilter(w,m,b,null)}var s=1;J.addfilter(s,y)}}else{n=false}}if(n){var C=F.displayfield;this.addfilter(C,J,true)}else{var C=F.displayfield;this.removefilter(C,true)}}}},_clearfilter:function(e,c,d){var b=d.displayfield;this.removefilter(b,true)},addfilter:function(d,e,c){if(this._loading){throw new Error("jqxGrid: "+this.loadingerrormessage);return false}var f=this.getcolumn(d);var b=this._getcolumn(d);if(f==undefined||f==null){return}f.filter=e;if(b){b.filter=e}this.dataview.addfilter(d,e);if(c==true&&c!=undefined){this.applyfilters("add")}},removefilter:function(d,c){if(this._loading){throw new Error("jqxGrid: "+this.loadingerrormessage);return false}var e=this.getcolumn(d);var b=this._getcolumn(d);if(e==undefined||e==null){return}if(e.filter==null){return}this.dataview.removefilter(d,e.filter);e.filter=null;b.filter=null;if(this.showfilterrow){this.clearfilterrow(d)}if(c==true||c!==false){this.applyfilters("remove")}},applyfilters:function(f){var c=false;if(this.dataview.filters.length>=0&&(this.virtualmode||!this.source.localdata)){if(this.source!=null&&this.source.filter){var g=-1;if(this.pageable){g=this.dataview.pagenum;this.dataview.pagenum=0}else{this.vScrollInstance.setPosition(0);this.loadondemand=true;this._renderrows(this.virtualsizeinfo)}if(this.pageable&&this.virtualmode){this.dataview.pagenum=0}this.source.filter(this.dataview.filters,this.dataview.records,this.dataview.records.length);if(this.pageable&&!this.virtualmode){this.dataview.pagenum=g}}}this._cellscache=new Array();if(this.dataview.clearsortdata){this.dataview.clearsortdata()}if(!this.virtualmode){var b=this.selectedrowindexes;var d=this.that;this.dataview.refresh();if(this.dataview.clearsortdata){if(this.sortcolumn&&this.sortdirection){var e=this.sortdirection.ascending?"asc":"desc";if(!this._loading){this.sortby(this.sortcolumn,e,null,false)}else{this.sortby(this.sortcolumn,e,null,false,false)}}}}else{if(this.pageable){this.dataview.updateview();if(this.gotopage){this.gotopage(0)}}this.rendergridcontent(false,false);if(this.showfilterrow){if(typeof f!="string"&&a.isEmptyObject(f)){this.refreshfilterrow()}}this._postrender("filter");this._raiseEvent(13,{filters:this.dataview.filters});return}if(this.pageable){this.dataview.updateview();if(this.gotopage){this.gotopage(0);this.updatepagerdetails()}}this._updaterowsproperties();if(!this.groupable||(this.groupable&&this.groups.length==0)){this._rowdetailscache=new Array();this.virtualsizeinfo=null;this._pagescache=new Array();if(this.columns&&this.columns.records&&this.columns.records.length>0&&!this.columns.records[0].filtericon){this.prerenderrequired=true}this.rendergridcontent(true,false);this._updatecolumnwidths();this._updatecellwidths();this._renderrows(this.virtualsizeinfo);if(this.showaggregates&&this._updatecolumnsaggregates){this._updatecolumnsaggregates()}this._postrender("filter")}else{this.collapseallgroups();this._rowdetailscache=new Array();this._render(true,true,false,false,false);if(this.showfilterrow){this._updatefocusedfilter()}this._updatecolumnwidths();this._updatecellwidths();this._renderrows(this.virtualsizeinfo);this._postrender("filter")}if(this.showfilterrow){if(typeof f!="string"&&a.isEmptyObject(f)){this.refreshfilterrow()}}this._raiseEvent(13,{filters:this.dataview.filters})},getfilterinformation:function(){var d=new Array();for(var b=0;b<this.dataview.filters.length;b++){var c=this.getcolumn(this.dataview.filters[b].datafield);d[b]={filter:this.dataview.filters[b].filter,datafield:c.datafield,displayfield:c.displayfield,filtercolumn:c.datafield,filtercolumntext:c.text}}return d},clearfilters:function(b){var d=this.that;if(this.showfilterrow){this.clearfilterrow()}if(this.columns.records){var c=b==true||b!==false;a.each(this.columns.records,function(){d.removefilter(this.displayfield,!c)})}if(b===false){return}if(b==true||b!==false){this.applyfilters("clear")}},_updatefilterpanel:function(s,p,E){if(s==null||s==undefined){s=this}var Q=s._getcolumntypebydatafield(E);var u=s._getfiltersbytype(Q);if(!s.host.jqxDropDownList){throw new Error("jqxGrid: Missing reference to jqxdropdownlist.js.");return}s.filterpanel.detach();s.excelfilterpanel.detach();if(E.filterpanel){E.filterpanel.detach()}a(p).children().detach();var k=a(s.menuitemsarray[6]);a(k).css("height","190px");if(E.createfilterpanel&&!E.filterpanel){var K=a("<div class='filter' style='margin-left: 7px;'></div>");a(p).append(K);E.createfilterpanel(E.displayfield,K);E.filterpanel=K}if(E.filtertype==="list"||E.filtertype==="checkedlist"){a(p).append(s.excelfilterpanel)}else{if(E.filtertype!=="custom"){a(p).append(s.filterpanel)}else{if(E.filterpanel){a(p).append(E.filterpanel)}}}var g=a(p);var N=g.find("#filterclearbutton"+s.element.id);var l=g.find("#filterbutton"+s.element.id);var f=g.find(".filter1");var m=g.find(".filter2");var P=g.find(".filter3");var j=g.find(".filtertext1"+s.element.id);var h=g.find(".filtertext2"+s.element.id);if(this._hasdatefilter&&(E.filtertype!=="list"&&E.filtertype!=="checkedlist"&&E.filtertype!=="custom")){var e=j.parent();var d=h.parent();e.children().remove();d.children().remove();if(E.filtertype=="date"){s._showwhere.text(s.gridlocalization.filtershowrowdatestring);var b=a("<div class='filtertext1"+s.element.id+"' style=''></div>");e.append(b);var n=function(c){var i={calendar:s.gridlocalization,todayString:s.gridlocalization.todaystring,clearString:s.gridlocalization.clearstring};c.jqxDateTimeInput({disabled:s.disabled,firstDayOfWeek:s.gridlocalization.firstDay,localization:i,rtl:s.rtl,width:s._filterpanelwidth-10,height:this.filterMenuItemsHeight,value:null,formatString:E.cellsformat,theme:s.theme})};n(b);var b=a("<div class='filtertext2"+s.element.id+"' style=''></div>");d.append(b);n(b)}else{s._showwhere.text(s.gridlocalization.filtershowrowstring);var b=a("<input autocomplete='off' class='filtertext1"+s.element.id+"' style='box-sizing: content-box; height: 16px; padding: 3px;' type='text'></input>");e.append(b);var n=function(c){c.addClass(s.toThemeProperty("jqx-input"));c.addClass(s.toThemeProperty("jqx-filter-input jqx-widget-content"));c.addClass(s.toThemeProperty("jqx-rc-all"));c.width(s._filterpanelwidth-18);c[0].style.height=this.filterMenuItemsHeight+"px"};n(b);var b=a("<input autocomplete='off' class='filtertext2"+s.element.id+"' style='box-sizing: content-box; height: 16px; padding: 3px;' type='text'></input>");d.append(b);n(b)}var j=g.find(".filtertext1"+s.element.id);var h=g.find(".filtertext2"+s.element.id)}if(E.filtertype!="date"){j.val("");h.val("")}else{j.val(null);h.val(null)}this.removeHandler(l,"click");this.addHandler(l,"click",function(){s._buildfilter(s,p,E);s._closemenu()});this.removeHandler(N,"click");this.addHandler(N,"click",function(){s._clearfilter(s,p,E);s._closemenu()});this.removeHandler(l,"keydown");this.addHandler(l,"keydown",function(c){if(c.keyCode===13){s._buildfilter(s,p,E);s._closemenu()}});this.removeHandler(N,"keydown");this.addHandler(N,"keydown",function(c){if(c.keyCode===13){s._clearfilter(s,p,E);s._closemenu()}});this.removeHandler(j,"keydown");this.addHandler(j,"keydown",function(c){if(c.keyCode===13){l.trigger("click")}if(c.keyCode===27){s._closemenu()}});this.removeHandler(h,"keydown");this.addHandler(h,"keydown",function(c){if(c.keyCode===13){l.trigger("click")}if(c.keyCode===27){s._closemenu()}});if(this.filtermode==="default"&&(E.filtertype!=="list"&&E.filtertype!=="checkedlist"&&E.filtertype!=="custom")){if(f.jqxDropDownList("source")!=u){f.jqxDropDownList({enableBrowserBoundsDetection:false,source:u});P.jqxDropDownList({enableBrowserBoundsDetection:false,source:u})}if(Q=="boolean"||Q=="bool"){f.jqxDropDownList({autoDropDownHeight:true,selectedIndex:0});P.jqxDropDownList({autoDropDownHeight:true,selectedIndex:0})}else{var H=false;if(u&&u.length){if(u.length<5){H=true}}f.jqxDropDownList({autoDropDownHeight:H,selectedIndex:2});P.jqxDropDownList({autoDropDownHeight:H,selectedIndex:2})}m.jqxDropDownList({selectedIndex:0});var z=E.filter;var M=new a.jqx.filter();var x="";switch(Q){case"number":case"int":case"float":case"decimal":x="numericfilter";o=M.getoperatorsbyfiltertype("numericfilter");break;case"boolean":case"bool":x="booleanfilter";o=M.getoperatorsbyfiltertype("booleanfilter");break;case"date":case"time":x="datefilter";o=M.getoperatorsbyfiltertype("datefilter");break;case"string":x="stringfilter";o=M.getoperatorsbyfiltertype("stringfilter");break}if(z!=null){var e=z.getfilterat(0);var d=z.getfilterat(1);var I=z.getoperatorat(0);if(s.updatefilterconditions){var o=[];var r=s.updatefilterconditions(x,o);if(r!=undefined){for(var O=0;O<r.length;O++){r[O]=r[O].toUpperCase()}z.setoperatorsbyfiltertype(x,r);o=r}}var w="default";if(e!=null){var D=o.indexOf(e.comparisonoperator);var A=e.filtervalue;j.val(A);f.jqxDropDownList({selectedIndex:D,animationType:w})}if(d!=null){var C=o.indexOf(d.comparisonoperator);var y=d.filtervalue;h.val(y);P.jqxDropDownList({selectedIndex:C,animationType:w})}if(z.getoperatorat(0)==undefined){m.jqxDropDownList({selectedIndex:0,animationType:w})}else{if(z.getoperatorat(0)=="and"||z.getoperatorat(0)==0){m.jqxDropDownList({selectedIndex:0})}else{m.jqxDropDownList({selectedIndex:1})}}}if(s.updatefilterpanel){s.updatefilterpanel(f,P,m,j,h,l,N,z,x,o)}if(!this._hasdatefilter||(this._hasdatefilter&&E.filtertype!="date")){if(!this.touchdevice){j.focus();setTimeout(function(){j.focus()},10)}}}else{if(this.filtermode==="excel"||E.filtertype==="list"||E.filtertype==="checkedlist"){var v=s._getfilterdataadapter(E);var x=s._getfiltertype(Q);var L=this.filtermode==="excel"||E.filtertype==="checkedlist";if(E.filtertype=="date"){s._showwhere.text(s.gridlocalization.filtershowrowstring)}f.jqxListBox("focus");this.removeHandler(f,"keyup");this.addHandler(f,"keyup",function(c){if(c.keyCode===13){l.trigger("click")}if(c.keyCode===27){s._closemenu()}});if(E.cellsformat){f.jqxListBox({checkboxes:L,displayMember:E.displayfield,valueMember:E.displayfield+"JQValue",source:v})}else{f.jqxListBox({checkboxes:L,displayMember:E.displayfield,valueMember:E.displayfield,source:v})}if(L){f.jqxListBox("insertAt",{label:s.gridlocalization.filterselectallstring},0);var F=f.data().jqxListBox.instance;F.checkAll(false);var B=this;if(E.filter){F.uncheckAll(false);var t=E.filter.getfilters();for(var J=0;J<F.items.length;J++){var G=F.items[J].value;a.each(t,function(){if(this.condition=="NOT_EQUAL"){if(G!=this.value){F.uncheckIndex(J,false,false);return false}else{if(G!=null&&this.value!=null&&G.toString()!=this.value.toString()){F.uncheckIndex(J,false,false);return false}}}else{if(this.condition=="EQUAL"){if(G==this.value){F.checkIndex(J,false,false);return false}else{if(G!=null&&this.value!=null&&G.toString()==this.value.toString()){F.checkIndex(J,false,false);return false}}}}})}F._updateCheckedItems();var q=F.getCheckedItems().length;if(F.items.length!=q&&q>0){F.host.jqxListBox("indeterminateIndex",0,true,false)}if(q===F.items.length-1){F.host.jqxListBox("checkIndex",0,true,false)}}}else{if(E.filter){var F=f.data().jqxListBox.instance;F.clearSelection();var t=E.filter.getfilters();for(var J=0;J<F.items.length;J++){var G=F.items[J].value;a.each(t,function(){if(this.condition=="NOT_EQUAL"){if(G!=this.value){F.unselectIndex(J,false,false);return false}}else{if(this.condition=="EQUAL"){if(G==this.value){F.selectIndex(J,true,false);return false}}}})}F._renderItems()}}}}},_initfilterpanel:function(z,b,c,p,w){if(z==null||z==undefined){z=this}b[0].innerHTML="";var t=a("<div class='filter' style='position: absolute; bottom: 3px; margin-left: 3px;'></div>");b.append(t);var n=a("<div class='filter showwhere' style='height: 18px; margin-top: 3px; margin-bottom: 3px;'></div>");n.text(z.gridlocalization.filtershowrowstring);this._showwhere=n;var o=w?"ex":"";var v=a("<div class='filter filter1' id='filter1"+z.element.id+o+"'></div>");var h=a("<div class='filter filter2' id='filter2"+z.element.id+o+"' style='margin-top: 3px; margin-bottom: 3px;'></div>");var s=a("<div class='filter filter3' id='filter3"+z.element.id+o+"'></div>");var e=z._getcolumntypebydatafield(c);if(!v.jqxDropDownList){throw new Error("jqxGrid: jqxdropdownlist.js is not loaded.");return}v[0].setAttribute("aria-label","Filter Condition 1");h[0].setAttribute("aria-label","Filter Operator");s[0].setAttribute("aria-label","Filter Condition 2");v[0].setAttribute("aria-expanded",false);h[0].setAttribute("aria-expanded",false);s[0].setAttribute("aria-expanded",false);var q=z._getfiltersbytype(e);this._hasdatefilter=false;this._filterpanelwidth=p;if(this.columns&&this.columns.records){for(var u=0;u<this.columns.records.length;u++){if(this.columns.records[u].filtertype=="date"){this._hasdatefilter=true;break}}}else{if(this.columns&&!this.columns.records){for(var u=0;u<this.columns.length;u++){if(this.columns[u].filtertype=="date"){this._hasdatefilter=true;break}}}}var k=a("<div style='margin-top:3px;' class='filter'><input autocomplete='off' class='filtertext1"+z.element.id+"' style='padding: 3px; height: 17px; margin-top: 3px; margin-bottom: 3px;' type='text'></input></div>");var m=k.find("input");m.addClass(this.toThemeProperty("jqx-input"));m.addClass(this.toThemeProperty("jqx-filter-input jqx-widget-content"));m.addClass(this.toThemeProperty("jqx-rc-all"));m.width(p-18);var l=a("<div style='margin-top:3px;' class='filter'><input autocomplete='off' class='filtertext2"+z.element.id+"' style='padding: 3px; height: 17px; margin-top: 3px;' type='text'></input></div>");var j=l.find("input");j.addClass(this.toThemeProperty("jqx-input"));j.addClass(this.toThemeProperty("jqx-filter-input jqx-widget-content"));j.addClass(this.toThemeProperty("jqx-rc-all"));j.width(p-18);if(z.rtl){m.css("direction","rtl");j.css("direction","rtl")}var g=a("<div class='filter' style='height: 35px; text-align:center; margin-top: 15px; margin-left:-2px;'></div>");var f=a('<span tabIndex=0 id="filterbutton'+z.element.id+'" class="primary filterbutton" style="padding: 6px 15px;">'+z.gridlocalization.filterstring+"</span>");g.append(f);var x=a('<span tabIndex=0 id="filterclearbutton'+z.element.id+'" class="secondary filterclearbutton" style="position: relative; left: 1px; padding: 6px 15px; margin-left: 7px;">'+z.gridlocalization.filterclearstring+"</span>");g.append(x);f.jqxButton({height:this.filterMenuItemsHeight,theme:z.theme});x.jqxButton({height:this.filterMenuItemsHeight,theme:z.theme});var y=function(A){if(A){if(A.text().indexOf("case sensitive")!=-1){var i=A.text();i=i.replace("case sensitive","match case");A.text(i)}A.css("font-family",z.host.css("font-family"));A.css("font-size",z.host.css("font-size"));A.css("top","2px");A.css("position","relative");return A}return""};if(this.filtermode==="default"&&!w){t.append(n);t.append(v);v.jqxDropDownList({_checkForHiddenParent:false,autoItemsHeight:true,rtl:z.rtl,enableBrowserBoundsDetection:false,selectedIndex:2,width:p-10,he