").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("
").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("
")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);
\ No newline at end of file
diff --git a/static/js/jquery.min.js b/static/js/jquery.min.js
new file mode 100644
index 0000000..ab28a24
--- /dev/null
+++ b/static/js/jquery.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="
",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d
b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,""],area:[1,""],param:[1,""],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:k.htmlSerialize?[0,"",""]:[1,"X","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" a",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();ca",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/static/js/jqxbuttons.js b/static/js/jqxbuttons.js
new file mode 100644
index 0000000..091daee
--- /dev/null
+++ b/static/js/jqxbuttons.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.jqx.cssroundedcorners=function(b){var c={all:"jqx-rc-all",top:"jqx-rc-t",bottom:"jqx-rc-b",left:"jqx-rc-l",right:"jqx-rc-r","top-right":"jqx-rc-tr","top-left":"jqx-rc-tl","bottom-right":"jqx-rc-br","bottom-left":"jqx-rc-bl"};for(prop in c){if(!c.hasOwnProperty(prop)){continue}if(b==prop){return c[prop]}}};a.jqx.jqxWidget("jqxButton","",{});a.extend(a.jqx._jqxButton.prototype,{defineInstance:function(){var b={cursor:"arrow",roundedCorners:"all",disabled:false,height:null,width:null,overrideTheme:false,enableHover:true,enableDefault:true,enablePressed:true,rtl:false,_ariaDisabled:false,_scrollAreaButton:false,template:"default",aria:{"aria-disabled":{name:"disabled",type:"boolean"}}};a.extend(true,this,b);return b},createInstance:function(d){var b=this;b._setSize();if(!b._ariaDisabled){b.host.attr("role","button")}if(!b.overrideTheme){b.host.addClass(b.toThemeProperty(a.jqx.cssroundedcorners(b.roundedCorners)));if(b.enableDefault){b.host.addClass(b.toThemeProperty("jqx-button"))}b.host.addClass(b.toThemeProperty("jqx-widget"))}b.isTouchDevice=a.jqx.mobile.isTouchDevice();if(!b._ariaDisabled){a.jqx.aria(this)}if(b.cursor!="arrow"){if(!b.disabled){b.host.css({cursor:b.cursor})}else{b.host.css({cursor:"arrow"})}}var g="mouseenter mouseleave mousedown focus blur";if(b._scrollAreaButton){var g="mousedown"}if(b.isTouchDevice){b.addHandler(b.host,a.jqx.mobile.getTouchEventName("touchstart"),function(h){b.isPressed=true;b.refresh()});b.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchend")+"."+b.element.id,function(h){b.isPressed=false;b.refresh()})}b.addHandler(b.host,g,function(h){switch(h.type){case"mouseenter":if(!b.isTouchDevice){if(!b.disabled&&b.enableHover){b.isMouseOver=true;b.refresh()}}break;case"mouseleave":if(!b.isTouchDevice){if(!b.disabled&&b.enableHover){b.isMouseOver=false;b.refresh()}}break;case"mousedown":if(!b.disabled){b.isPressed=true;b.refresh()}break;case"focus":if(!b.disabled){b.isFocused=true;b.refresh()}break;case"blur":if(!b.disabled){b.isFocused=false;b.refresh()}break}});b.mouseupfunc=function(h){if(!b.disabled){if(b.isPressed||b.isMouseOver){b.isPressed=false;b.refresh()}}};b.addHandler(a(document),"mouseup.button"+b.element.id,b.mouseupfunc);try{if(document.referrer!=""||window.frameElement){if(window.top!=null&&window.top!=window.self){var f="";if(window.parent&&document.referrer){f=document.referrer}if(f.indexOf(document.location.host)!=-1){var e=function(h){b.isPressed=false;b.refresh()};if(window.top.document){b.addHandler(a(window.top.document),"mouseup",e)}}}}}catch(c){}b.propertyChangeMap.roundedCorners=function(h,j,i,k){h.host.removeClass(h.toThemeProperty(a.jqx.cssroundedcorners(i)));h.host.addClass(h.toThemeProperty(a.jqx.cssroundedcorners(k)))};b.propertyChangeMap.width=function(h,j,i,k){h._setSize();h.refresh()};b.propertyChangeMap.height=function(h,j,i,k){h._setSize();h.refresh()};b.propertyChangeMap.disabled=function(h,j,i,k){if(i!=k){h.host[0].disabled=k;h.host.attr("disabled",k);h.refresh();if(!k){h.host.css({cursor:h.cursor})}else{h.host.css({cursor:"default"})}a.jqx.aria(h,"aria-disabled",h.disabled)}};b.propertyChangeMap.rtl=function(h,j,i,k){if(i!=k){h.refresh()}};b.propertyChangeMap.template=function(h,j,i,k){if(i!=k){h.host.removeClass("jqx-"+i);h.refresh()}};b.propertyChangeMap.theme=function(h,j,i,k){h.host.removeClass();if(h.enableDefault){h.host.addClass(h.toThemeProperty("jqx-button"))}h.host.addClass(h.toThemeProperty("jqx-widget"));if(!h.overrideTheme){h.host.addClass(h.toThemeProperty(a.jqx.cssroundedcorners(h.roundedCorners)))}h._oldCSSCurrent=null;h.refresh()};if(b.disabled){b.element.disabled=true;b.host.attr("disabled",true)}},resize:function(c,b){this.width=c;this.height=b;this._setSize()},val:function(){var c=this;var b=c.host.find("input");if(b.length>0){if(arguments.length==0||typeof(value)=="object"){return b.val()}b.val(value);c.refresh();return b.val()}if(arguments.length==0||typeof(value)=="object"){if(c.element.nodeName.toLowerCase()=="button"){return a(c.element).text()}return c.element.value}c.element.value=arguments[0];if(c.element.nodeName.toLowerCase()=="button"){a(c.element).text(arguments[0])}c.refresh()},_setSize:function(){var b=this;if(b.width!=null&&(b.width.toString().indexOf("px")!=-1||b.width.toString().indexOf("%")!=-1)){b.host.css("width",b.width)}else{if(b.width!=undefined&&!isNaN(b.width)){b.host.css("width",b.width)}}if(b.height!=null&&(b.height.toString().indexOf("px")!=-1||b.height.toString().indexOf("%")!=-1)){b.host.css("height",b.height)}else{if(b.height!=undefined&&!isNaN(b.height)){b.host.css("height",parseInt(b.height))}}},_removeHandlers:function(){var b=this;b.removeHandler(b.host,"selectstart");b.removeHandler(b.host,"click");b.removeHandler(b.host,"focus");b.removeHandler(b.host,"blur");b.removeHandler(b.host,"mouseenter");b.removeHandler(b.host,"mouseleave");b.removeHandler(b.host,"mousedown");b.removeHandler(a(document),"mouseup.button"+b.element.id,b.mouseupfunc);if(b.isTouchDevice){b.removeHandler(b.host,a.jqx.mobile.getTouchEventName("touchstart"));b.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchend")+"."+b.element.id)}b.mouseupfunc=null;delete b.mouseupfunc},focus:function(){this.host.focus()},destroy:function(){var b=this;b._removeHandlers();var c=a.data(b.element,"jqxButton");if(c){delete c.instance}b.host.removeClass();b.host.removeData();b.host.remove();delete b.set;delete b.get;delete b.call;delete b.element;delete b.host},render:function(){this.refresh()},refresh:function(){var c=this;if(c.overrideTheme){return}var e=c.toThemeProperty("jqx-fill-state-focus");var i=c.toThemeProperty("jqx-fill-state-disabled");var b=c.toThemeProperty("jqx-fill-state-normal");if(!c.enableDefault){b=""}var h=c.toThemeProperty("jqx-fill-state-hover");var f=c.toThemeProperty("jqx-fill-state-pressed");var g=c.toThemeProperty("jqx-fill-state-pressed");if(!c.enablePressed){f=""}var d="";if(!c.host){return}c.host[0].disabled=c.disabled;if(c.disabled){d=b+" "+i;if(c.template!=="default"&&c.template!==""){d+=" jqx-"+c.template}c.host.addClass(d);c._oldCSSCurrent=d;return}else{if(c.isMouseOver&&!c.isTouchDevice){if(c.isPressed){d=g}else{d=h}}else{if(c.isPressed){d=f}else{d=b}}}if(c.isFocused){d+=" "+e}if(c.template!=="default"&&c.template!==""){d+=" jqx-"+c.template}if(d!=c._oldCSSCurrent){if(c._oldCSSCurrent){c.host.removeClass(c._oldCSSCurrent)}c.host.addClass(d);c._oldCSSCurrent=d}if(c.rtl){c.host.addClass(c.toThemeProperty("jqx-rtl"));c.host.css("direction","rtl")}}});a.jqx.jqxWidget("jqxLinkButton","",{});a.extend(a.jqx._jqxLinkButton.prototype,{defineInstance:function(){this.disabled=false;this.height=null;this.width=null;this.rtl=false;this.href=null},createInstance:function(d){var c=this;this.host.onselectstart=function(){return false};this.host.attr("role","button");var b=this.height||this.host.height();var e=this.width||this.host.width();this.href=this.host.attr("href");this.target=this.host.attr("target");this.content=this.host.text();this.element.innerHTML="";this.host.append("
");var f=this.host.find("input");f.addClass(this.toThemeProperty("jqx-reset"));f.width(e);f.height(b);f.val(this.content);this.host.find("tr").addClass(this.toThemeProperty("jqx-reset"));this.host.find("td").addClass(this.toThemeProperty("jqx-reset"));this.host.find("tbody").addClass(this.toThemeProperty("jqx-reset"));this.host.css("color","inherit");this.host.addClass(this.toThemeProperty("jqx-link"));f.css({width:e});f.css({height:b});var g=d==undefined?{}:d[0]||{};f.jqxButton(g);if(this.disabled){this.host[0].disabled=true}this.propertyChangeMap.disabled=function(h,j,i,k){h.host[0].disabled=k;h.host.find("input").jqxButton({disabled:k})};this.addHandler(f,"click",function(h){if(!this.disabled){c.onclick(h)}return false})},onclick:function(b){if(this.target!=null){window.open(this.href,this.target)}else{window.location=this.href}}});a.jqx.jqxWidget("jqxRepeatButton","jqxButton",{});a.extend(a.jqx._jqxRepeatButton.prototype,{defineInstance:function(){this.delay=50},createInstance:function(e){var c=this;var d=a.jqx.mobile.isTouchDevice();var b=!d?"mouseup."+this.base.element.id:"touchend."+this.base.element.id;var f=!d?"mousedown."+this.base.element.id:"touchstart."+this.base.element.id;this.addHandler(a(document),b,function(g){if(c.timeout!=null){clearTimeout(c.timeout);c.timeout=null;c.refresh()}if(c.timer!=undefined){clearInterval(c.timer);c.timer=null;c.refresh()}});this.addHandler(this.base.host,f,function(g){if(c.timer!=null){clearInterval(c.timer)}c.timeout=setTimeout(function(){clearInterval(c.timer);c.timer=setInterval(function(h){c.ontimer(h)},c.delay)},150)});this.mousemovefunc=function(g){if(!d){if(g.which==0){if(c.timer!=null){clearInterval(c.timer);c.timer=null}}}};this.addHandler(this.base.host,"mousemove",this.mousemovefunc)},destroy:function(){var c=a.jqx.mobile.isTouchDevice();var b=!c?"mouseup."+this.base.element.id:"touchend."+this.base.element.id;var e=!c?"mousedown."+this.base.element.id:"touchstart."+this.base.element.id;this.removeHandler(this.base.host,"mousemove",this.mousemovefunc);this.removeHandler(this.base.host,e);this.removeHandler(a(document),b);this.timer=null;delete this.mousemovefunc;delete this.timer;var d=a.data(this.base.element,"jqxRepeatButton");if(d){delete d.instance}a(this.base.element).removeData();this.base.destroy();delete this.base},stop:function(){clearInterval(this.timer);this.timer=null},ontimer:function(b){var b=new a.Event("click");if(this.base!=null&&this.base.host!=null){this.base.host.trigger(b)}}});a.jqx.jqxWidget("jqxToggleButton","jqxButton",{});a.extend(a.jqx._jqxToggleButton.prototype,{defineInstance:function(){this.toggled=false;this.uiToggle=true;this.aria={"aria-checked":{name:"toggled",type:"boolean"},"aria-disabled":{name:"disabled",type:"boolean"}}},createInstance:function(c){var b=this;b.base.overrideTheme=true;b.isTouchDevice=a.jqx.mobile.isTouchDevice();a.jqx.aria(this);b.propertyChangeMap.roundedCorners=function(d,f,e,g){d.base.host.removeClass(d.toThemeProperty(a.jqx.cssroundedcorners(e)));d.base.host.addClass(d.toThemeProperty(a.jqx.cssroundedcorners(g)))};b.propertyChangeMap.toggled=function(d,f,e,g){d.refresh()};b.propertyChangeMap.disabled=function(d,f,e,g){d.base.disabled=g;d.refresh()};b.addHandler(b.base.host,"click",function(d){if(!b.base.disabled&&b.uiToggle){b.toggle()}});if(!b.isTouchDevice){b.addHandler(b.base.host,"mouseenter",function(d){if(!b.base.disabled){b.refresh()}});b.addHandler(b.base.host,"mouseleave",function(d){if(!b.base.disabled){b.refresh()}})}b.addHandler(b.base.host,"mousedown",function(d){if(!b.base.disabled){b.refresh()}});b.addHandler(a(document),"mouseup.togglebutton"+b.base.element.id,function(d){if(!b.base.disabled){b.refresh()}})},destroy:function(){this._removeHandlers();this.base.destroy()},_removeHandlers:function(){this.removeHandler(this.base.host,"click");this.removeHandler(this.base.host,"mouseenter");this.removeHandler(this.base.host,"mouseleave");this.removeHandler(this.base.host,"mousedown");this.removeHandler(a(document),"mouseup.togglebutton"+this.base.element.id)},toggle:function(){this.toggled=!this.toggled;this.refresh();a.jqx.aria(this,"aria-checked",this.toggled)},unCheck:function(){this.toggled=false;this.refresh()},check:function(){this.toggled=true;this.refresh()},refresh:function(){var c=this;var h=c.base.toThemeProperty("jqx-fill-state-disabled");var b=c.base.toThemeProperty("jqx-fill-state-normal");if(!c.base.enableDefault){b=""}var g=c.base.toThemeProperty("jqx-fill-state-hover");var e=c.base.toThemeProperty("jqx-fill-state-pressed");var f=c.base.toThemeProperty("jqx-fill-state-pressed");var d="";c.base.host[0].disabled=c.base.disabled;if(c.base.disabled){d=b+" "+h;c.base.host.addClass(d);return}else{if(c.base.isMouseOver&&!c.isTouchDevice){if(c.base.isPressed||c.toggled){d=f}else{d=g}}else{if(c.base.isPressed||c.toggled){d=e}else{d=b}}}if(c.base.template!=="default"&&c.base.template!==""){d+=" jqx-"+c.base.template}if(c.base.host.hasClass(h)&&h!=d){c.base.host.removeClass(h)}if(c.base.host.hasClass(b)&&b!=d){c.base.host.removeClass(b)}if(c.base.host.hasClass(g)&&g!=d){c.base.host.removeClass(g)}if(c.base.host.hasClass(e)&&e!=d){c.base.host.removeClass(e)}if(c.base.host.hasClass(f)&&f!=d){c.base.host.removeClass(f)}if(!c.base.host.hasClass(d)){c.base.host.addClass(d)}}})})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxcore.js b/static/js/jqxcore.js
new file mode 100644
index 0000000..37754ee
--- /dev/null
+++ b/static/js/jqxcore.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+var jqxBaseFramework=window.minQuery||window.jQuery;(function(a){a.jqx=a.jqx||{};a.jqx.define=function(b,c,d){b[c]=function(){if(this.baseType){this.base=new b[this.baseType]();this.base.defineInstance()}this.defineInstance()};b[c].prototype.defineInstance=function(){};b[c].prototype.base=null;b[c].prototype.baseType=undefined;if(d&&b[d]){b[c].prototype.baseType=d}};a.jqx.invoke=function(e,d){if(d.length==0){return}var f=typeof(d)==Array||d.length>0?d[0]:d;var c=typeof(d)==Array||d.length>1?Array.prototype.slice.call(d,1):a({}).toArray();while(e[f]==undefined&&e.base!=null){if(e[f]!=undefined&&a.isFunction(e[f])){return e[f].apply(e,c)}if(typeof f=="string"){var b=f.toLowerCase();if(e[b]!=undefined&&a.isFunction(e[b])){return e[b].apply(e,c)}}e=e.base}if(e[f]!=undefined&&a.isFunction(e[f])){return e[f].apply(e,c)}if(typeof f=="string"){var b=f.toLowerCase();if(e[b]!=undefined&&a.isFunction(e[b])){return e[b].apply(e,c)}}return};a.jqx.hasProperty=function(c,b){if(typeof(b)=="object"){for(var e in b){var d=c;while(d){if(d.hasOwnProperty(e)){return true}if(d.hasOwnProperty(e.toLowerCase())){return true}d=d.base}return false}}else{while(c){if(c.hasOwnProperty(b)){return true}if(c.hasOwnProperty(b.toLowerCase())){return true}c=c.base}}return false};a.jqx.hasFunction=function(e,d){if(d.length==0){return false}if(e==undefined){return false}var f=typeof(d)==Array||d.length>0?d[0]:d;var c=typeof(d)==Array||d.length>1?Array.prototype.slice.call(d,1):{};while(e[f]==undefined&&e.base!=null){if(e[f]&&a.isFunction(e[f])){return true}if(typeof f=="string"){var b=f.toLowerCase();if(e[b]&&a.isFunction(e[b])){return true}}e=e.base}if(e[f]&&a.isFunction(e[f])){return true}if(typeof f=="string"){var b=f.toLowerCase();if(e[b]&&a.isFunction(e[b])){return true}}return false};a.jqx.isPropertySetter=function(c,b){if(b.length==1&&typeof(b[0])=="object"){return true}if(b.length==2&&typeof(b[0])=="string"&&!a.jqx.hasFunction(c,b)){return true}return false};a.jqx.validatePropertySetter=function(f,d,b){if(!a.jqx.propertySetterValidation){return true}if(d.length==1&&typeof(d[0])=="object"){for(var e in d[0]){var g=f;while(!g.hasOwnProperty(e)&&g.base){g=g.base}if(!g||!g.hasOwnProperty(e)){if(!b){var c=g.hasOwnProperty(e.toString().toLowerCase());if(!c){throw"Invalid property: "+e}else{return true}}return false}}return true}if(d.length!=2){if(!b){throw"Invalid property: "+d.length>=0?d[0]:""}return false}while(!f.hasOwnProperty(d[0])&&f.base){f=f.base}if(!f||!f.hasOwnProperty(d[0])){if(!b){throw"Invalid property: "+d[0]}return false}return true};a.jqx.set=function(f,e){var d=0;if(e.length==1&&typeof(e[0])=="object"){if(f.isInitialized&&Object.keys&&Object.keys(e[0]).length>1){var g=!f.base?f.element:f.base.element;var j=a.data(g,f.widgetName).initArgs;if(JSON&&JSON.stringify&&e[0]&&j[0]){try{if(JSON.stringify(e[0])==JSON.stringify(j[0])){return}}catch(h){}}f.batchUpdate=e[0];var b={};var c={};a.each(e[0],function(k,l){var m=f;while(!m.hasOwnProperty(k)&&m.base!=null){m=m.base}if(m.hasOwnProperty(k)){if(f[k]!=l){b[k]=f[k];c[k]=l;d++}}else{if(m.hasOwnProperty(k.toLowerCase())){if(f[k.toLowerCase()]!=l){b[k.toLowerCase()]=f[k.toLowerCase()];c[k.toLowerCase()]=l;d++}}}});if(d<2){f.batchUpdate=null}}a.each(e[0],function(k,l){var m=f;while(!m.hasOwnProperty(k)&&m.base!=null){m=m.base}if(m.hasOwnProperty(k)){a.jqx.setvalueraiseevent(m,k,l)}else{if(m.hasOwnProperty(k.toLowerCase())){a.jqx.setvalueraiseevent(m,k.toLowerCase(),l)}else{if(a.jqx.propertySetterValidation){throw"jqxCore: invalid property '"+k+"'"}}}});if(f.batchUpdate!=null){f.batchUpdate=null;if(f.propertiesChangedHandler&&d>1){f.propertiesChangedHandler(f,b,c)}}}else{if(e.length==2){while(!f.hasOwnProperty(e[0])&&f.base){f=f.base}if(f.hasOwnProperty(e[0])){a.jqx.setvalueraiseevent(f,e[0],e[1])}else{if(f.hasOwnProperty(e[0].toLowerCase())){a.jqx.setvalueraiseevent(f,e[0].toLowerCase(),e[1])}else{if(a.jqx.propertySetterValidation){throw"jqxCore: invalid property '"+e[0]+"'"}}}}}};a.jqx.setvalueraiseevent=function(c,d,e){var b=c[d];c[d]=e;if(!c.isInitialized){return}if(c.propertyChangedHandler!=undefined){c.propertyChangedHandler(c,d,b,e)}if(c.propertyChangeMap!=undefined&&c.propertyChangeMap[d]!=undefined){c.propertyChangeMap[d](c,d,b,e)}};a.jqx.get=function(e,d){if(d==undefined||d==null){return undefined}if(e.propertyMap){var c=e.propertyMap(d);if(c!=null){return c}}if(e.hasOwnProperty(d)){return e[d]}if(e.hasOwnProperty(d.toLowerCase())){return e[d.toLowerCase()]}var b=undefined;if(typeof(d)==Array){if(d.length!=1){return undefined}b=d[0]}else{if(typeof(d)=="string"){b=d}}while(!e.hasOwnProperty(b)&&e.base){e=e.base}if(e){return e[b]}return undefined};a.jqx.serialize=function(e){var b="";if(a.isArray(e)){b="[";for(var d=0;d
0){b+=", "}b+=a.jqx.serialize(e[d])}b+="]"}else{if(typeof(e)=="object"){b="{";var c=0;for(var d in e){if(c++>0){b+=", "}b+=d+": "+a.jqx.serialize(e[d])}b+="}"}else{b=e.toString()}}return b};a.jqx.propertySetterValidation=true;a.jqx.jqxWidgetProxy=function(g,c,b){var d=a(c);var f=a.data(c,g);if(f==undefined){return undefined}var e=f.instance;if(a.jqx.hasFunction(e,b)){return a.jqx.invoke(e,b)}if(a.jqx.isPropertySetter(e,b)){if(a.jqx.validatePropertySetter(e,b)){a.jqx.set(e,b);return undefined}}else{if(typeof(b)=="object"&&b.length==0){return}else{if(typeof(b)=="object"&&b.length==1&&a.jqx.hasProperty(e,b[0])){return a.jqx.get(e,b[0])}else{if(typeof(b)=="string"&&a.jqx.hasProperty(e,b[0])){return a.jqx.get(e,b)}}}}throw"jqxCore: Invalid parameter '"+a.jqx.serialize(b)+"' does not exist.";return undefined};a.jqx.applyWidget=function(c,d,k,l){var g=false;try{g=window.MSApp!=undefined}catch(f){}var m=a(c);if(!l){l=new a.jqx["_"+d]()}else{l.host=m;l.element=c}if(c.id==""){c.id=a.jqx.utilities.createId()}var j={host:m,element:c,instance:l,initArgs:k};l.widgetName=d;a.data(c,d,j);a.data(c,"jqxWidget",j.instance);var h=new Array();var l=j.instance;while(l){l.isInitialized=false;h.push(l);l=l.base}h.reverse();h[0].theme=a.jqx.theme||"";a.jqx.jqxWidgetProxy(d,c,k);for(var b in h){l=h[b];if(b==0){l.host=m;l.element=c;l.WinJS=g}if(l!=undefined){if(l.definedInstance){l.definedInstance()}if(l.createInstance!=null){if(g){MSApp.execUnsafeLocalFunction(function(){l.createInstance(k)})}else{l.createInstance(k)}}}}for(var b in h){if(h[b]!=undefined){h[b].isInitialized=true}}if(g){MSApp.execUnsafeLocalFunction(function(){j.instance.refresh(true)})}else{j.instance.refresh(true)}};a.jqx.jqxWidget=function(b,c,f){var j=false;try{jqxArgs=Array.prototype.slice.call(f,0)}catch(h){jqxArgs=""}try{j=window.MSApp!=undefined}catch(h){}var g=b;var l="";if(c){l="_"+c}a.jqx.define(a.jqx,"_"+g,l);var k=new Array();if(!window[g]){var d=function(m){if(m==null){return""}var e=a.type(m);switch(e){case"string":case"number":case"date":case"boolean":case"bool":if(m===null){return""}return m.toString()}var n="";a.each(m,function(p){var r=this;if(p>0){n+=", "}n+="[";var o=0;if(a.type(r)=="object"){for(var q in r){if(o>0){n+=", "}n+="{"+q+":"+r[q]+"}";o++}}else{if(o>0){n+=", "}n+="{"+p+":"+r+"}";o++}n+="]"});return n};window[g]=function(e,r){var m=[];if(!r){r={}}m.push(r);var n=e;if(a.type(n)==="object"&&e[0]){n=e[0].id;if(n===""){n=e[0].id=a.jqx.utilities.createId()}}if(window.jqxWidgets&&window.jqxWidgets[n]){if(r){a.each(window.jqxWidgets[n],function(s){var t=a(this.element).data();if(t&&t.jqxWidget){a(this.element)[g](r)}})}if(window.jqxWidgets[n].length==1){var p=a(window.jqxWidgets[n][0].widgetInstance.element).data();if(p&&p.jqxWidget){return window.jqxWidgets[n][0]}}var p=a(window.jqxWidgets[n][0].widgetInstance.element).data();if(p&&p.jqxWidget){return window.jqxWidgets[n]}}var o=a(e);if(o.length===0){throw new Error("Invalid Selector - "+e+"! Please, check whether the used ID or CSS Class name is correct.")}var q=[];a.each(o,function(v){var x=o[v];var u=null;if(!k[g]){var y=x.id;x.id="";u=a(x).clone();x.id=y}a.jqx.applyWidget(x,g,m,undefined);if(!k[g]){var t=a.data(x,"jqxWidget");var w=u[g]().data().jqxWidget.defineInstance();var s=function(A){var z=a.data(A,"jqxWidget");this.widgetInstance=z;var B=a.extend(this,z);B.on=function(C,D){B.addHandler(B.host,C,D)};B.off=function(C){B.removeHandler(B.host,C)};return B};k[g]=s;a.each(w,function(A,z){Object.defineProperty(s.prototype,A,{get:function(){if(this.widgetInstance){return this.widgetInstance[A]}return z},set:function(C){if(this.widgetInstance&&this.widgetInstance[A]!=C){if(this.widgetInstance[A]!=C&&d(this.widgetInstance[A])!=d(C)){var B={};B[A]=C;this.widgetInstance.host[g](B);this.widgetInstance[A]=C}}}})})}var t=new k[g](x);q.push(t);if(!window.jqxWidgets){window.jqxWidgets=new Array()}if(!window.jqxWidgets[n]){window.jqxWidgets[n]=new Array()}window.jqxWidgets[n].push(t)});if(q.length===1){return q[0]}return q}}a.fn[g]=function(){var e=Array.prototype.slice.call(arguments,0);if(e.length==0||(e.length==1&&typeof(e[0])=="object")){if(this.length==0){if(this.selector){throw new Error("Invalid Selector - "+this.selector+"! Please, check whether the used ID or CSS Class name is correct.")}else{throw new Error("Invalid Selector! Please, check whether the used ID or CSS Class name is correct.")}}return this.each(function(){var p=a(this);var o=this;var q=a.data(o,g);if(q==null){a.jqx.applyWidget(o,g,e,undefined)}else{a.jqx.jqxWidgetProxy(g,this,e)}})}else{if(this.length==0){if(this.selector){throw new Error("Invalid Selector - "+this.selector+"! Please, check whether the used ID or CSS Class name is correct.")}else{throw new Error("Invalid Selector! Please, check whether the used ID or CSS Class name is correct.")}}var n=null;var m=0;this.each(function(){var o=a.jqx.jqxWidgetProxy(g,this,e);if(m==0){n=o;m++}else{if(m==1){var p=[];p.push(n);n=p}n.push(o)}})}return n};try{a.extend(a.jqx["_"+g].prototype,Array.prototype.slice.call(f,0)[0])}catch(h){}a.extend(a.jqx["_"+g].prototype,{toThemeProperty:function(e,m){return a.jqx.toThemeProperty(this,e,m)}});a.jqx["_"+g].prototype.refresh=function(){if(this.base){this.base.refresh(true)}};a.jqx["_"+g].prototype.createInstance=function(){};a.jqx["_"+g].prototype.applyTo=function(n,m){if(!(m instanceof Array)){var e=[];e.push(m);m=e}a.jqx.applyWidget(n,g,m,this)};a.jqx["_"+g].prototype.getInstance=function(){return this};a.jqx["_"+g].prototype.propertyChangeMap={};a.jqx["_"+g].prototype.addHandler=function(o,e,m,n){a.jqx.addHandler(o,e,m,n)};a.jqx["_"+g].prototype.removeHandler=function(n,e,m){a.jqx.removeHandler(n,e,m)}};a.jqx.toThemeProperty=function(c,d,h){if(c.theme==""){return d}var g=d.split(" ");var b="";for(var f=0;f0){b+=" "}var e=g[f];if(h!=null&&h){b+=e+"-"+c.theme}else{b+=e+" "+e+"-"+c.theme}}return b};a.jqx.addHandler=function(g,h,e,f){var c=h.split(" ");for(var b=0;b=0){if(f.length>0){b.push(h[c]);j.push(h[c].replace(f,g))}else{j.push(h[c].replace("-"+g,"")+"-"+g)}}}this._removeOldClasses(b,e);this._addNewClasses(j,e);for(var c=0;cB){return 1}}catch(F){var G=F}return 0};var q=function(C){if(f.hiddenWidgets.length>0){f.hiddenWidgets.sort(o);var B=function(){var E=false;var G=new Array();for(var F=0;F0){q(false)}f.hiddenWidgets=new Array();f.resizeHandlers.sort(o);for(var u=0;u=0){f.hiddenWidgets.splice(f.hiddenWidgets.indexOf(A),1)}}if(t.jqxWidget.element){var r=t.jqxWidget.element.className;if(r.indexOf("dropdownlist")>=0||r.indexOf("datetimeinput")>=0||r.indexOf("combobox")>=0||r.indexOf("menu")>=0){if(t.jqxWidget.isOpened){var s=t.jqxWidget.isOpened();if(s){t.jqxWidget.close()}}}}}}}q()};if(!this.resizeHandlers){this.resizeHandlers=new Array();var j=a(window);if(j.on){this._resizeTimer=null;this._initResize=null;j.on("resize.jqx",function(n){if(f._resizeTimer!=undefined){clearTimeout(f._resizeTimer)}if(!f._initResize){f._initResize=true;h(null,"resize")}else{f._resizeTimer=setTimeout(function(){h(null,"resize")},a.jqx.resizeDelay)}});j.on("orientationchange.jqx",function(n){h(null,"orientationchange")});j.on("orientationchanged.jqx",function(n){h(null,"orientationchange")})}else{j.bind("resize.jqx",function(n){h(null,"orientationchange")});j.bind("orientationchange.jqx",function(n){h(null,"orientationchange")});j.bind("orientationchanged.jqx",function(n){h(null,"orientationchange")})}}if(k){if(g===-1){this.resizeHandlers.push({id:d[0].id,widget:d,callback:m,data:d.data()})}}if(a.jqx.isHidden(d)&&k===true){h(true)}a.jqx.resize=function(){h(null,"resize")}},html:function(c,d){if(!a(c).on){return a(c).html(d)}try{return a.access(c,function(s){var f=c[0]||{},m=0,j=c.length;if(s===undefined){return f.nodeType===1?f.innerHTML.replace(rinlinejQuery,""):undefined}var r=/<(?:script|style|link)/i,n="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",h=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,p=/<([\w:]+)/,g=/<(?:script|object|embed|option|style)/i,k=new RegExp("<(?:"+n+")[\\s/>]","i"),q=/^\s+/,t={option:[1,""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]};if(typeof s==="string"&&!r.test(s)&&(a.support.htmlSerialize||!k.test(s))&&(a.support.leadingWhitespace||!q.test(s))&&!t[(p.exec(s)||["",""])[1].toLowerCase()]){s=s.replace(h,"<$1>$2>");try{for(;m=0&&c.indexOf(".net4.0c")>=0){d.browser="msie";d.version="11";b[1]="msie"}if(c.indexOf("edge")>=0){d.browser="msie";d.version="12";b[1]="msie"}d[b[1]]=b[1];return d}});a.jqx.browser=a.jqx.utilities.getBrowser();a.jqx.isHidden=function(c){if(!c||!c[0]){return false}var b=c[0].offsetWidth,d=c[0].offsetHeight;if(b===0||d===0){return true}else{return false}};a.jqx.ariaEnabled=true;a.jqx.aria=function(c,e,d){if(!a.jqx.ariaEnabled){return}if(e==undefined){a.each(c.aria,function(g,h){var k=!c.base?c.host.attr(g):c.base.host.attr(g);if(k!=undefined&&!a.isFunction(k)){var j=k;switch(h.type){case"number":j=new Number(k);if(isNaN(j)){j=k}break;case"boolean":j=k=="true"?true:false;break;case"date":j=new Date(k);if(j=="Invalid Date"||isNaN(j)){j=k}break}c[h.name]=j}else{var k=c[h.name];if(a.isFunction(k)){k=c[h.name]()}if(k==undefined){k=""}try{!c.base?c.host.attr(g,k.toString()):c.base.host.attr(g,k.toString())}catch(f){}}})}else{try{if(c.host){if(!c.base){if(c.host){if(c.element.setAttribute){c.element.setAttribute(e,d.toString())}else{c.host.attr(e,d.toString())}}else{c.attr(e,d.toString())}}else{if(c.base.host){c.base.host.attr(e,d.toString())}else{c.attr(e,d.toString())}}}else{if(c.setAttribute){c.setAttribute(e,d.toString())}}}catch(b){}}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){var b=this.length;var d=Number(arguments[1])||0;d=(d<0)?Math.ceil(d):Math.floor(d);if(d<0){d+=b}for(;d=0||f.indexOf("WPDesktop")>=0||f.indexOf("IEMobile")>=0||f.indexOf("ZuneWP7")>=0){this.touchDevice=true;return true}else{if(f.indexOf("Touch")>=0){var b=("MSPointerDown" in window)||("pointerdown" in window);if(b){this.touchDevice=true;return true}if(f.indexOf("ARM")>=0){this.touchDevice=true;return true}this.touchDevice=false;return false}}}if(navigator.platform.toLowerCase().indexOf("win")!=-1){this.touchDevice=false;return false}if(("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch){this.touchDevice=true}return this.touchDevice}catch(g){this.touchDevice=false;return false}},getLeftPos:function(b){var c=b.offsetLeft;while((b=b.offsetParent)!=null){if(b.tagName!="HTML"){c+=b.offsetLeft;if(document.all){c+=b.clientLeft}}}return c},getTopPos:function(c){var e=c.offsetTop;var b=a(c).coord();while((c=c.offsetParent)!=null){if(c.tagName!="HTML"){e+=(c.offsetTop-c.scrollTop);if(document.all){e+=c.clientTop}}}var d=navigator.userAgent.toLowerCase();var f=(d.indexOf("windows phone")!=-1||d.indexOf("WPDesktop")!=-1||d.indexOf("ZuneWP7")!=-1||d.indexOf("msie 9")!=-1||d.indexOf("msie 11")!=-1||d.indexOf("msie 10")!=-1)&&d.indexOf("touch")!=-1;if(f){return b.top}if(this.isSafariMobileBrowser()){if(this.isSafari4MobileBrowser()&&this.isIPadSafariMobileBrowser()){return e}if(d.indexOf("version/7")!=-1){return b.top}if(d.indexOf("version/6")!=-1||d.indexOf("version/5")!=-1){e=e+a(window).scrollTop()}return b.top}return e},isChromeMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("android")!=-1;return b},isOperaMiniMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("opera mini")!=-1||c.indexOf("opera mobi")!=-1;return b},isOperaMiniBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("opera mini")!=-1;return b},isNewSafariMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("ipad")!=-1||c.indexOf("iphone")!=-1||c.indexOf("ipod")!=-1;b=b&&(c.indexOf("version/5")!=-1);return b},isSafari4MobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("ipad")!=-1||c.indexOf("iphone")!=-1||c.indexOf("ipod")!=-1;b=b&&(c.indexOf("version/4")!=-1);return b},isWindowsPhone:function(){var c=navigator.userAgent.toLowerCase();var b=(c.indexOf("windows phone")!=-1||c.indexOf("WPDesktop")!=-1||c.indexOf("ZuneWP7")!=-1||c.indexOf("msie 9")!=-1||c.indexOf("msie 11")!=-1||c.indexOf("msie 10")!=-1&&c.indexOf("touch")!=-1);return b},isSafariMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("ipad")!=-1||c.indexOf("iphone")!=-1||c.indexOf("ipod")!=-1;return b},isIPadSafariMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("ipad")!=-1;return b},isMobileBrowser:function(){var c=navigator.userAgent.toLowerCase();var b=c.indexOf("ipad")!=-1||c.indexOf("iphone")!=-1||c.indexOf("android")!=-1;return b},getTouches:function(b){if(b.originalEvent){if(b.originalEvent.touches&&b.originalEvent.touches.length){return b.originalEvent.touches}else{if(b.originalEvent.changedTouches&&b.originalEvent.changedTouches.length){return b.originalEvent.changedTouches}}}if(!b.touches){b.touches=new Array();b.touches[0]=b.originalEvent!=undefined?b.originalEvent:b;if(b.originalEvent!=undefined&&b.pageX){b.touches[0]=b}if(b.type=="mousemove"){b.touches[0]=b}}return b.touches},getTouchEventName:function(b){if(this.isWindowsPhone()){var c=navigator.userAgent.toLowerCase();if(c.indexOf("windows phone 8.1")!=-1){if(b.toLowerCase().indexOf("start")!=-1){return"pointerdown"}if(b.toLowerCase().indexOf("move")!=-1){return"pointermove"}if(b.toLowerCase().indexOf("end")!=-1){return"pointerup"}}if(b.toLowerCase().indexOf("start")!=-1){return"MSPointerDown"}if(b.toLowerCase().indexOf("move")!=-1){return"MSPointerMove"}if(b.toLowerCase().indexOf("end")!=-1){return"MSPointerUp"}}else{return b}},dispatchMouseEvent:function(b,f,d){if(this.simulatetouches){return}var c=document.createEvent("MouseEvent");c.initMouseEvent(b,true,true,f.view,1,f.screenX,f.screenY,f.clientX,f.clientY,false,false,false,false,0,null);if(d!=null){d.dispatchEvent(c)}},getRootNode:function(b){while(b.nodeType!==1){b=b.parentNode}return b},setTouchScroll:function(b,c){if(!this.enableScrolling){this.enableScrolling=[]}this.enableScrolling[c]=b},touchScroll:function(d,y,g,D,b,k){if(d==null){return}var B=this;var t=0;var j=0;var l=0;var u=0;var m=0;var n=0;if(!this.scrolling){this.scrolling=[]}this.scrolling[D]=false;var h=false;var q=a(d);var v=["select","input","textarea"];var c=0;var e=0;if(!this.enableScrolling){this.enableScrolling=[]}this.enableScrolling[D]=true;var D=D;var C=this.getTouchEventName("touchstart")+".touchScroll";var p=this.getTouchEventName("touchend")+".touchScroll";var A=this.getTouchEventName("touchmove")+".touchScroll";var c=function(E){if(!B.enableScrolling[D]){return true}if(a.inArray(E.target.tagName.toLowerCase(),v)!==-1){return}var F=B.getTouches(E);var G=F[0];if(F.length==1){B.dispatchMouseEvent("mousedown",G,B.getRootNode(G.target))}h=false;j=G.pageY;m=G.pageX;if(B.simulatetouches){if(G._pageY!=undefined){j=G._pageY;m=G._pageX}}B.scrolling[D]=true;t=0;u=0;return true};if(q.on){q.on(C,c)}else{q.bind(C,c)}var x=function(J){if(!B.enableScrolling[D]){return true}if(!B.scrolling[D]){return true}var L=B.getTouches(J);if(L.length>1){return true}var H=L[0].pageY;var I=L[0].pageX;if(B.simulatetouches){if(L[0]._pageY!=undefined){H=L[0]._pageY;I=L[0]._pageX}}var E=H-j;var F=I-m;e=H;touchHorizontalEnd=I;l=E-t;n=F-u;h=true;t=E;u=F;var G=b!=null?b[0].style.visibility!="hidden":true;var K=k!=null?k[0].style.visibility!="hidden":true;if(G||K){if((n!==0&&G)||(l!==0&&K)){g(-n*1,-l*1,F,E,J);J.preventDefault();J.stopPropagation();if(J.preventManipulation){J.preventManipulation()}return false}}};if(q.on){q.on(A,x)}else{q.bind(A,x)}if(this.simulatetouches){var o=a(window).on!=undefined||a(window).bind;var z=function(E){B.scrolling[D]=false};a(window).on!=undefined?a(document).on("mouseup.touchScroll",z):a(document).bind("mouseup.touchScroll",z);if(window.frameElement){if(window.top!=null){var r=function(E){B.scrolling[D]=false};if(window.top.document){a(window.top.document).on?a(window.top.document).on("mouseup",r):a(window.top.document).bind("mouseup",r)}}}var s=a(document).on!=undefined||a(document).bind;var w=function(E){if(!B.scrolling[D]){return true}B.scrolling[D]=false;var G=B.getTouches(E)[0],F=B.getRootNode(G.target);B.dispatchMouseEvent("mouseup",G,F);B.dispatchMouseEvent("click",G,F)};a(document).on!=undefined?a(document).on("touchend",w):a(document).bind("touchend",w)}var f=function(E){if(!B.enableScrolling[D]){return true}var G=B.getTouches(E)[0];if(!B.scrolling[D]){return true}B.scrolling[D]=false;if(h){B.dispatchMouseEvent("mouseup",G,F)}else{var G=B.getTouches(E)[0],F=B.getRootNode(G.target);B.dispatchMouseEvent("mouseup",G,F);B.dispatchMouseEvent("click",G,F);return true}};if(q.on){q.on("dragstart",function(E){E.preventDefault()});q.on("selectstart",function(E){E.preventDefault()})}q.on?q.on(p+" touchcancel.touchScroll",f):q.bind(p+" touchcancel.touchScroll",f)}});a.jqx.cookie=a.jqx.cookie||{};a.extend(a.jqx.cookie,{cookie:function(e,f,c){if(arguments.length>1&&String(f)!=="[object Object]"){c=a.extend({},c);if(f===null||f===undefined){c.expires=-1}if(typeof c.expires==="number"){var h=c.expires,d=c.expires=new Date();d.setDate(d.getDate()+h)}f=String(f);return(document.cookie=[encodeURIComponent(e),"=",c.raw?f:encodeURIComponent(f),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join(""))}c=f||{};var b,g=c.raw?function(j){return j}:decodeURIComponent;return(b=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?g(b[1]):null}});a.jqx.string=a.jqx.string||{};a.extend(a.jqx.string,{replace:function(f,d,e){if(d===e){return this}var b=f;var c=b.indexOf(d);while(c!=-1){b=b.replace(d,e);c=b.indexOf(d)}return b},contains:function(b,c){if(b==null||c==null){return false}return b.indexOf(c)!=-1},containsIgnoreCase:function(b,c){if(b==null||c==null){return false}return b.toString().toUpperCase().indexOf(c.toString().toUpperCase())!=-1},equals:function(b,c){if(b==null||c==null){return false}b=this.normalize(b);if(c.length==b.length){return b.slice(0,c.length)==c}return false},equalsIgnoreCase:function(b,c){if(b==null||c==null){return false}b=this.normalize(b);if(c.length==b.length){return b.toUpperCase().slice(0,c.length)==c.toUpperCase()}return false},startsWith:function(b,c){if(b==null||c==null){return false}return b.slice(0,c.length)==c},startsWithIgnoreCase:function(b,c){if(b==null||c==null){return false}return b.toUpperCase().slice(0,c.length)==c.toUpperCase()},normalize:function(b){if(b.charCodeAt(b.length-1)==65279){b=b.substring(0,b.length-1)}return b},endsWith:function(b,c){if(b==null||c==null){return false}b=this.normalize(b);return b.slice(-c.length)==c},endsWithIgnoreCase:function(b,c){if(b==null||c==null){return false}b=this.normalize(b);return b.toUpperCase().slice(-c.length)==c.toUpperCase()}});a.extend(a.easing,{easeOutBack:function(f,g,e,k,j,h){if(h==undefined){h=1.70158}return k*((g=g/j-1)*g*((h+1)*g+h)+1)+e},easeInQuad:function(f,g,e,j,h){return j*(g/=h)*g+e},easeInOutCirc:function(f,g,e,j,h){if((g/=h/2)<1){return -j/2*(Math.sqrt(1-g*g)-1)+e}return j/2*(Math.sqrt(1-(g-=2)*g)+1)+e},easeInOutSine:function(f,g,e,j,h){return -j/2*(Math.cos(Math.PI*g/h)-1)+e},easeInCubic:function(f,g,e,j,h){return j*(g/=h)*g*g+e},easeOutCubic:function(f,g,e,j,h){return j*((g=g/h-1)*g*g+1)+e},easeInOutCubic:function(f,g,e,j,h){if((g/=h/2)<1){return j/2*g*g*g+e}return j/2*((g-=2)*g*g+2)+e},easeInSine:function(f,g,e,j,h){return -j*Math.cos(g/h*(Math.PI/2))+j+e},easeOutSine:function(f,g,e,j,h){return j*Math.sin(g/h*(Math.PI/2))+e},easeInOutSine:function(f,g,e,j,h){return -j/2*(Math.cos(Math.PI*g/h)-1)+e}})})(jqxBaseFramework);(function(b){b.extend(b.event.special,{close:{noBubble:true},open:{noBubble:true},cellclick:{noBubble:true},rowclick:{noBubble:true},tabclick:{noBubble:true},selected:{noBubble:true},expanded:{noBubble:true},collapsed:{noBubble:true},valuechanged:{noBubble:true},expandedItem:{noBubble:true},collapsedItem:{noBubble:true},expandingItem:{noBubble:true},collapsingItem:{noBubble:true}});b.fn.extend({ischildof:function(f){var d=b(this).parents().get();for(var c=0;c>>0;if(typeof N!=="function"){throw TypeError()}var P=arguments[1],O;for(O=0;O=0){if(NK.length){I.push.apply(I,new Array(N-K.length))}}}else{throw new RangeError("Invalid array length")}return M}});i.jqx.observableArray.prototype.fromArray=function(O,N){var M=new i.jqx.observableArray(O,N);return M};i.jqx.observableArray.prototype.clone=function(){var M=new i.jqx.observableArray(K,J);M.observing=I.observing;M.changes=I.changes;M.notifier=I.notifier;return M};I.remove=function(N){if(N<0||N>=I.length){throw new Error("Invalid index : "+N)}if(I.hasOwnProperty(N)){var M=I[N];I[N]=undefined;K[N]=undefined;if(typeof H==="function"){H({object:I,type:"delete",index:N,name:"index",newValue:undefined,oldValue:M})}return true}return false};I.concat=function(N,P){var M=K.concat(N);var O=new i.jqx.observableArray(M,P);return O};Object.getOwnPropertyNames(Array.prototype).forEach(function(M){if(!(M in I)){var N=function(){var Q=I.observing;I.observing=false;var P=K[M];var O=P.apply(K,arguments);I.observing=Q;return O};Object.defineProperty(I,M,{configurable:false,enumerable:true,writeable:false,value:N})}});I.set=function(N,P){if(i.type(N)=="string"&&N.split(".").length>1){var M=N.split(".");var Q=I;for(var O=0;O=I.length){throw new Error("Invalid Index: "+N)}}if(O=I.length){I.push(P)}else{I[N]=P}return true};I.get=function(M){return I[M]};if(e instanceof Array){I.push.apply(I,e)}H=function(){if(!I.observing){return}if(arguments&&arguments[0]){I.changes.push(arguments[0])}if(J){J.apply(I,arguments)}if(I.notifier){I.notifier.apply(I,arguments)}};return I};i.jqx.formatDate=function(H,J,I){var e=i.jqx.dataFormat.formatdate(H,J,I);return e};i.jqx.formatNumber=function(H,J,I){var e=i.jqx.dataFormat.formatnumber(H,J,I);return e};i.jqx.dataAdapter=function(J,e){if(J!=undefined){if(J.dataFields!==undefined){J.datafields=J.dataFields}if(J.dataType!==undefined){J.datatype=J.dataType}if(J.localData!==undefined){J.localdata=J.localData}if(J.sortColumn!==undefined){J.sortcolumn=J.sortColumn}if(J.sortDirection!==undefined){J.sortdirection=J.sortDirection}if(J.sortOrder!==undefined){J.sortdirection=J.sortOrder}if(J.formatData!==undefined){J.formatdata=J.formatData}if(J.processData!==undefined){J.processdata=J.processData}if(J.pageSize!==undefined){J.pagesize=J.pageSize}if(J.pageNum!==undefined){J.pagenum=J.pageNum}if(J.updateRow!==undefined){J.updaterow=J.updateRow}if(J.addRow!==undefined){J.addrow=J.addRow}if(J.deleteRow!==undefined){J.deleterow=J.deleteRow}if(J.contentType!==undefined){J.contenttype=J.contentType}if(J.totalRecords!=undefined){J.totalrecords=J.totalRecords}if(J.loadError!=undefined){J.loadError=J.loadError}if(J.sortComparer!=undefined){J.sortcomparer=J.sortComparer}}this._source=J;this._options=e||{};if(J.beforeLoadComplete!=undefined){this._options.beforeLoadComplete=this._source.beforeLoadComplete}if(J.downloadComplete!=undefined){this._options.downloadComplete=this._source.downloadComplete}if(J.loadComplete!=undefined){this._options.loadComplete=this._source.loadComplete}if(J.autoBind!=undefined){this._options.downloadComplete=this._source.autoBind}if(J.formatData!=undefined){this._options.formatData=this._source.formatData}if(J.loadError!=undefined){this._options.loadError=this._source.loadError}if(J.beforeSend!=undefined){this._options.beforeSend=this._source.beforeSend}if(J.contentType!=undefined){this._options.contentType=this._source.contentType}if(J.async!=undefined){this._options.async=this._source.async}if(J.loadServerData!=undefined){this._options.loadServerData=this._source.loadServerData}if(J.uniqueDataFields!=undefined){this._options.uniqueDataFields=this._source.uniqueDataFields}this.records=new Array();this._downloadComplete=new Array();this._bindingUpdate=new Array();if(J!=undefined&&J.localdata!=null&&typeof J.localdata=="function"){var I=J.localdata();if(I!=null){J._localdata=J.localdata;var H=this;if(J._localdata.subscribe){H._oldlocaldata=[];J._localdata.subscribe(function(K){var L=function(M){if(i.isArray(M)){return i.makeArray(L(i(M)))}return i.extend(true,{},M)};if(H.suspendKO==false||H.suspendKO==undefined||H._oldlocaldata.length==0){H._oldlocaldata=L(K)}},J._localdata,"beforeChange");J._localdata.subscribe(function(L){if(H.suspendKO==false||H.suspendKO==undefined){var K="";H._oldrecords=H.records;if(H._oldlocaldata.length==0){J.localdata=J._localdata()}if(H._oldlocaldata.length==0){K="change"}else{if(L){if(H._oldlocaldata.length==L.length){K="update"}if(H._oldlocaldata.length>L.length){K="remove"}if(H._oldlocaldata.length0){this.callBindingUpdate("update");this._changedrecords=[]}else{this.dataBind(null,"")}}},formatDate:function(H,J,I){var e=i.jqx.dataFormat.formatdate(H,J,I);return e},formatNumber:function(H,J,I){var e=i.jqx.dataFormat.formatnumber(H,J,I);return e},dataBind:function(R,Z){if(this.isUpdating==true){return}var W=this._source;if(!W){return}if(W.generatedfields){W.datafields=null;W.generatedfields=null}i.jqx.dataFormat.datescache=new Array();if(W.dataFields!=null){W.datafields=W.dataFields}if(W.recordstartindex==undefined){W.recordstartindex=0}if(W.recordendindex==undefined){W.recordendindex=0}if(W.loadallrecords==undefined){W.loadallrecords=true}if(W.root==undefined){W.root=""}if(W.record==undefined){W.record=""}if(W.sort!=undefined){this.sort=W.sort}if(W.filter!=undefined){this.filter=W.filter}else{this.filter=null}if(W.sortcolumn!=undefined){this.sortcolumn=W.sortcolumn}if(W.sortdirection!=undefined){this.sortdirection=W.sortdirection}if(W.sortcomparer!=undefined){this.sortcomparer=W.sortcomparer}this.records=new Array();var K=this._options||{};this.virtualmode=K.virtualmode!=undefined?K.virtualmode:false;this.totalrecords=K.totalrecords!=undefined?K.totalrecords:0;this.pageable=K.pageable!=undefined?K.pageable:false;this.pagesize=K.pagesize!=undefined?K.pagesize:0;this.pagenum=K.pagenum!=undefined?K.pagenum:0;this.cachedrecords=K.cachedrecords!=undefined?K.cachedrecords:new Array();this.originaldata=new Array();this.recordids=new Array();this.updaterow=K.updaterow!=undefined?K.updaterow:null;this.addrow=K.addrow!=undefined?K.addrow:null;this.deleterow=K.deleterow!=undefined?K.deleterow:null;this.cache=K.cache!=undefined?K.cache:false;this.unboundmode=false;if(W.formatdata!=undefined){K.formatData=W.formatdata}if(W.data!=undefined){if(K.data==undefined){K.data={}}i.extend(K.data,W.data)}if(W.mapchar!=undefined){this.mapChar=W.mapchar?W.mapchar:">"}else{this.mapChar=K.mapChar?K.mapChar:">"}if(K.unboundmode||W.unboundmode){this.unboundmode=K.unboundmode||W.unboundmode}if(W.cache!=undefined){this.cache=W.cache}if(this.koSubscriptions){for(var ab=0;ab0){for(var Y=0;Y0){var am=an;for(var aj=0;aj0){var aF=false;var aA=false;for(var aw=0;aw=0)){aF=true;ar=av.map;aD=av.type;aB=av.name;aA=true;var aE=am[ax];if(ar!=null){var aq=ar.split(ag.mapChar);if(aq.length>0){var ay=am;for(var at=0;at0){var ay=am;for(var at=0;at0){var ai=this;var al=H(ai,ac);al.uid=aj;ag.records[ag.records.length]=al}else{this.uid=aj;ag.records[ag.records.length]=this}})}else{if(ac==0){var V=0;var T=new Array();i.each(W.localdata,function(ak,am){var ai=i.extend({},this);if(typeof am==="string"){ag.records=W.localdata;return false}else{var aj=ag.getid(W.id,ai,ak);if(typeof(aj)==="object"){aj=ak}ai.uid=aj;if(ak==0){for(var an in this){V++;var ao=i.type(this[an]);T.push({name:an,type:ao})}ac=V;W.datafields=T;W.generatedfields=T}if(ac>0){var al=H(ai,ac);al.uid=aj;ag.records[ag.records.length]=al}else{ag.records[ag.records.length]=ai}}})}else{i.each(W.localdata,function(ak){var ai=this;var al=H(ai,ac);var aj=ag.getid(W.id,al,ak);if(typeof(aj)==="object"){aj=ak}var ai=i.extend({},al);ai.uid=aj;ag.records[ag.records.length]=ai})}}}this.originaldata=W.localdata;this.cachedrecords=this.records;this.addForeignValues(W);if(K.uniqueDataFields){var S=this.getUniqueRecords(this.records,K.uniqueDataFields);this.records=S;this.cachedrecords=S}if(K.beforeLoadComplete){var ad=K.beforeLoadComplete(ag.records,this.originaldata);if(ad!=undefined){ag.records=ad;ag.cachedrecords=ad}}if(K.autoSort&&K.autoSortField){var O=Object.prototype.toString;Object.prototype.toString=(typeof field=="function")?field:function(){return this[K.autoSortField]};ag.records.sort(function(aj,ai){if(aj===undefined){aj=null}if(ai===undefined){ai=null}if(aj===null&&ai===null){return 0}if(aj===null&&ai!==null){return 1}if(aj!==null&&ai===null){return -1}aj=aj.toString();ai=ai.toString();if(aj===null&&ai===null){return 0}if(aj===null&&ai!==null){return 1}if(aj!==null&&ai===null){return -1}if(i.jqx.dataFormat.isNumber(aj)&&i.jqx.dataFormat.isNumber(ai)){if(ajai){return 1}return 0}else{if(i.jqx.dataFormat.isDate(aj)&&i.jqx.dataFormat.isDate(ai)){if(ajai){return 1}return 0}else{if(!i.jqx.dataFormat.isNumber(aj)&&!i.jqx.dataFormat.isNumber(ai)){aj=String(aj).toLowerCase();ai=String(ai).toLowerCase()}}}try{if(ajai){return 1}}catch(ak){var al=ak}return 0});Object.prototype.toString=O}ag.loadedData=W.localdata;ag.buildHierarchy();if(i.isFunction(K.loadComplete)){K.loadComplete(W.localdata,ag.records)}break;case"json":case"jsonp":case"xml":case"xhtml":case"script":case"text":if(W.localdata!=null){if(i.isFunction(W.beforeprocessing)){W.beforeprocessing(W.localdata)}if(W.datatype==="xml"){ag.loadxml(W.localdata,W.localdata,W)}else{if(Q==="text"){ag.loadtext(W.localdata,W)}else{ag.loadjson(W.localdata,W.localdata,W)}}ag.addForeignValues(W);if(K.uniqueDataFields){var S=ag.getUniqueRecords(ag.records,K.uniqueDataFields);ag.records=S;ag.cachedrecords=S}if(K.beforeLoadComplete){var ad=K.beforeLoadComplete(ag.records,this.originaldata);if(ad!=undefined){ag.records=ad;ag.cachedrecords=ad}}ag.loadedData=W.localdata;ag.buildHierarchy.call(ag);if(i.isFunction(K.loadComplete)){K.loadComplete(W.localdata,ag.records)}ag.callBindingUpdate(Z);return}var ae=K.data!=undefined?K.data:{};if(W.processdata){W.processdata(ae)}if(i.isFunction(K.processData)){K.processData(ae)}if(i.isFunction(K.formatData)){var e=K.formatData(ae);if(e!=undefined){ae=e}}var aa="application/x-www-form-urlencoded";if(K.contentType){aa=K.contentType}var J="GET";if(W.type){J=W.type}if(K.type){J=K.type}if(W.url&&W.url.length>0){if(i.isFunction(K.loadServerData)){ag._requestData(ae,W,K)}else{this.xhr=i.jqx.data.ajax({dataType:Q,cache:this.cache,type:J,url:W.url,async:N,timeout:W.timeout,contentType:aa,data:ae,success:function(al,ai,ao){if(i.isFunction(W.beforeprocessing)){var an=W.beforeprocessing(al,ai,ao);if(an!=undefined){al=an}}if(i.isFunction(K.downloadComplete)){var an=K.downloadComplete(al,ai,ao);if(an!=undefined){al=an}}if(al==null){ag.records=new Array();ag.cachedrecords=new Array();ag.originaldata=new Array();ag.callDownloadComplete();if(i.isFunction(K.loadComplete)){K.loadComplete(new Array())}return}var aj=al;if(al.records){aj=al.records}if(al.totalrecords!=undefined){W.totalrecords=al.totalrecords}else{if(al.totalRecords!=undefined){W.totalrecords=al.totalRecords}}if(W.datatype==="xml"){ag.loadxml(null,aj,W)}else{if(Q==="text"){ag.loadtext(aj,W)}else{ag.loadjson(null,aj,W)}}ag.addForeignValues(W);if(K.uniqueDataFields){var ak=ag.getUniqueRecords(ag.records,K.uniqueDataFields);ag.records=ak;ag.cachedrecords=ak}if(K.beforeLoadComplete){var am=K.beforeLoadComplete(ag.records,al);if(am!=undefined){ag.records=am;ag.cachedrecords=am}}ag.loadedData=al;ag.buildHierarchy.call(ag);ag.callDownloadComplete();if(i.isFunction(K.loadComplete)){K.loadComplete(al,ai,ao,ag.records)}},error:function(ak,ai,aj){if(i.isFunction(W.loaderror)){W.loaderror(ak,ai,aj)}if(i.isFunction(K.loadError)){K.loadError(ak,ai,aj)}ak=null;ag.callDownloadComplete()},beforeSend:function(aj,ai){if(i.isFunction(K.beforeSend)){K.beforeSend(aj,ai)}if(i.isFunction(W.beforesend)){W.beforesend(aj,ai)}}})}}else{ag.buildHierarchy(new Array());ag.callDownloadComplete();if(i.isFunction(K.loadComplete)){if(!ah){var ah={}}K.loadComplete(ah)}}break}this.callBindingUpdate(Z)},buildHierarchy:function(K){var e=this._source;var P=new Array();if(!e.datafields){return}if(e.hierarchy&&!e.hierarchy.reservedNames){e.hierarchy.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"}}else{if(e.hierarchy){var O=e.hierarchy.reservedNames;if(!O.leaf){O.leaf="leaf"}if(!O.parent){O.parent="parent"}if(!O.expanded){O.expanded="expanded"}if(!O.checked){O.checked="checked"}if(!O.selected){O.selected="selected"}if(!O.level){O.level="level"}if(!O.data){O.data="data"}}}if(!e.hierarchy){return}var N=this;var O=e.hierarchy.reservedNames;if(e.hierarchy.root){if(e.dataType=="xml"){var P=this.getRecordsHierarchy("uid","parentuid","records",null,K);this.hierarchy=P;return P}else{this.hierarchy=this.records;var R=e.hierarchy.root;for(var L=0;L1){var W=S;for(var V=0;V0){var K=function(O){if(O){for(var P=0;P=0&&(this._source.hierarchy||I)){var L=(J._source&&J._source.hierarchy)?J._source.hierarchy.reservedNames:null;if(L==null){L=N()}H[L.level]=0;if(e=="last"){this.hierarchy.push(H)}else{if(typeof e==="number"&&isFinite(e)){this.hierarchy.splice(e,0,H)}else{this.hierarchy.splice(0,0,H)}}}else{if(e=="last"){this.records.push(H)}else{if(typeof e==="number"&&isFinite(e)){this.records.splice(e,0,H)}else{this.records.splice(0,0,H)}}}return true}}return false},deleteRecord:function(H){var J=this;if(this.hierarchy.length>0){var K=function(L){if(L){for(var O=0;OQ.totalrecords){M=Q.totalrecords}}else{if(Q.virtualmode){K=H.recordstartindex;M=H.recordendindex;if(M>Q.totalrecords){M=Q.totalrecords}}else{K=0;M=Q.records.length}}for(var O=K;O0){V(af+1,ae)}else{if(!P){ac[ad].leaf=true}else{ac[ad][P.leaf]=true}}}else{if(!P){ac[ad].leaf=true}else{ac[ad][P.leaf]=true}}}};V(0,e)}return e},bindBindingUpdate:function(H,e){this._bindingUpdate[this._bindingUpdate.length]={id:H,func:e}},unbindBindingUpdate:function(H){for(var e=0;e0){return e}else{if(N.map){try{var e=i(H).attr(N.map);if(e!=null&&e.toString().length>0){return e}else{if(i(N.map,H).length>0){return i(N.map,H).text()}else{if(i(N.name,H).length>0){return i(N.name,H).text()}}}}catch(J){return K}}}return}}if(i(N,H).length>0){return i(N,H).text()}if(N){if(N.toString().length>0){var e=i(H).attr(N);if(e!=null&&e.toString().length>0){return i.trim(e).split(" ").join("").replace(/([ #;?%&,.+*~\':"!^$[\]()=>|\/@])/g,"")}else{var I=N.split(this.mapChar);if(I.length>1){var M=H;for(var L=0;L1){var aa=ae;for(var Q=0;Q0){var aa=ae;for(var Q=0;Q0){var Z=I;for(var Q=0;Q0){var al=am;for(var ah=0;ah0){W=ag[0]}}}else{var ad=Q.map.substring(0,M-1);var O=Q.map.indexOf("]");var R=Q.map.substring(M+1,O);W=i(ad,I).attr(R);if(W==undefined){W=i(I).attr(R)}if(W==undefined){W=""}}if(W==""){W=i(I).attr(Q.map);if(W==undefined){W=""}}}}if(W==""){W=i(Q.name,I);if(W.length==1){W=W.text()}else{var ag=new Array();for(var ab=0;ab0){W=ag[0]}}if(W==""){W=i(I).attr(Q.name);if(W==undefined){W=""}}if(W==""){if(I.nodeName&&I.nodeName==Q.name&&I.firstChild){W=i(I.firstChild).text()}}}var V=W;W=this.getvaluebytype(W,Q);if(Q.displayname!=undefined){L[Q.displayname]=W}else{L[Q.name]=W}}if(U.recordendindex<=0||X0){var ah=this.getid(U.id,i(I).parents(U.hierarchy.record+":first"));N.parentuid=ah}else{N.parentuid=null}}}this.records=aa;this.cachedrecords=this.records},loadtext:function(Y,P){if(Y==null){return}var e=P.rowDelimiter||this.rowDelimiter||"\n";var L=Y.split(e);var J=L.length;var X=Y.split("\r");if(J==1&&X.length>1){L=X;J=L.length}this.totalrecords=this.virtualmode?(P.totalrecords||J):J;this.records=new Array();this.originaldata=new Array();var U=this.records;var R=!this.pageable?P.recordstartindex:this.pagesize*this.pagenum;this.recordids=new Array();if(P.loadallrecords){R=0;J=this.totalrecords}var N=0;if(this.virtualmode){R=!this.pageable?P.recordstartindex:this.pagesize*this.pagenum;N=R;R=0;J=this.totalrecords}var V=P.datafields.length;var O=P.columnDelimiter||this.columnDelimiter;if(!O){O=(P.datatype==="tab"||P.datatype==="tsv")?"\t":","}for(var T=R;T=H.length){continue}var M=P.datafields[S];var Q=H[S];if(M.map&&i.isFunction(M.map)){Q=M.map(I)}if(M.type){Q=this.getvaluebytype(Q,M)}var Z=M.map||M.name||S.toString();K[Z]=Q;if(P.id!=null){if(P.id===M.name){W=Q;this.recordids[W]=I}}}if(W==null){W=T}U[N+T]=i.extend({},K);U[N+T].uid=W;this.originaldata[N+T]=i.extend({},U[T])}}this.records=U;this.cachedrecords=this.records},getvaluebytype:function(L,H){var J=L;if(L==null){return L}if(i.isArray(L)&&H.type!="array"){for(var I=0;I=L){return J}}return 0},toUpper:function(e){return e.split("\u00A0").join(" ").toUpperCase()},toUpperArray:function(e){var J=[];for(var I=0,H=e.length;I'+e+""}return''+e+""},formatemail:function(e){return''+e+""},formatNumber:function(e,I,H){return this.formatnumber(e,I,H)},formatnumber:function(T,S,O){if(O==undefined||O==null||O==""){O=this.defaultcalendar()}if(S===""||S===null){return T}if(!this.isNumber(T)){T*=1}var P;if(S.length>1){P=parseInt(S.slice(1),10)}var V={};var Q=S.charAt(0).toUpperCase();V.thousandsSeparator=O.thousandsseparator;V.decimalSeparator=O.decimalseparator;switch(Q){case"D":case"d":case"F":case"f":V.decimalPlaces=P;break;case"N":case"n":V.decimalPlaces=0;break;case"C":case"c":V.decimalPlaces=P;if(O.currencysymbolposition=="before"){V.prefix=O.currencysymbol}else{V.suffix=O.currencysymbol}break;case"P":case"p":V.suffix=O.percentsymbol;V.decimalPlaces=P;break;default:throw"Bad number format specifier: "+Q}if(this.isNumber(T)){var K=(T<0);var I=T+"";var R=(V.decimalSeparator)?V.decimalSeparator:".";var e;if(this.isNumber(V.decimalPlaces)){var L=V.decimalPlaces;var N=Math.pow(10,L);I=(T*N).toFixed(0)/N+"";e=I.lastIndexOf(".");if(L>0){if(e<0){I+=R;e=I.length-1}else{if(R!=="."){I=I.replace(".",R)}}while((I.length-1-e)0&&L==undefined){if(R!=="."){I=I.replace(".",R)}}}if(V.thousandsSeparator){var U=V.thousandsSeparator;e=I.lastIndexOf(R);e=(e>-1)?e:I.length;var J=I.substring(e);var H=-1;for(var M=e;M>0;M--){H++;if((H%3===0)&&(M!==e)&&(!K||(M>1))){J=U+J}J=I.charAt(M-1)+J}I=J}I=(V.prefix)?V.prefix+I:I;I=(V.suffix)?I+V.suffix:I;return I}else{return T}},tryparsedate:function(ai,aj){if(aj==undefined||aj==null){aj=this.defaultcalendar()}var O=this;if(ai==""){return null}if(ai!=null&&!ai.substring){ai=ai.toString()}if(ai!=null&&ai.substring(0,6)=="/Date("){var ar=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;var ap=new Date(+ai.replace(/\/Date\((\d+)\)\//,"$1"));if(ap=="Invalid Date"){var al=ai.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);var ap=null;if(al){ap=new Date(1*al[1]+3600000*al[2]+60000*al[3])}}if(ap==null||ap=="Invalid Date"||isNaN(ap)){var P=ar.exec(ai);if(P){var R=new Date(parseInt(P[1]));if(P[2]){var X=parseInt(P[3]);if(P[2]==="-"){X=-X}var T=R.getUTCMinutes();R.setUTCMinutes(T-X)}if(!isNaN(R.valueOf())){return R}}}return ap}patterns=aj.patterns;for(prop in patterns){ap=O.parsedate(ai,patterns[prop],aj);if(ap){if(prop=="ISO"){var aa=O.parsedate(ai,patterns.ISO2,aj);if(aa){return aa}}return ap}}if(ai!=null){var aa=null;var L=[":","/","-"];var an=true;for(var N=0;N=0){I=ai.substring(ai.indexOf(":")-2);I=ae.trim(I);W=ai.substring(0,ai.indexOf(":")-2)}else{if(ai.toUpperCase().indexOf("AM")>=0){I=ai.substring(ai.toUpperCase().indexOf("AM")-2);I=ae.trim(I);W=ai.substring(0,ai.toUpperCase().indexOf("AM")-2)}else{if(ai.toUpperCase().indexOf("PM")>=0){I=ai.substring(ai.toUpperCase().indexOf("PM")-2);I=ae.trim(I);W=ai.substring(0,ai.toUpperCase().indexOf("PM")-2)}}}var e=new Date();var ag=false;if(W){for(var ao=0;ao=0){L=W.split(ak[ao]);break}}var H=new Array();var U=new Array();var ac=new Array();var Q=null;var au=null;for(var ao=0;ao2){au=ao;break}}}for(var ao=0;ao0){e=am[0];ag=true}}if(I){var af=I.indexOf(":")>=0?I.split(":"):I;var K=ae.parsedate(I,"h:mm tt",aj)||ae.parsedate(I,"h:mm:ss tt",aj)||ae.parsedate(I,"HH:mm:ss.fff",aj)||ae.parsedate(I,"HH:mm:ss.ff",aj)||ae.parsedate(I,"HH:mm:ss.tttt",aj)||ae.parsedate(I,"HH:mm:ss",aj)||ae.parsedate(I,"HH:mm",aj)||ae.parsedate(I,"HH",aj);var V=0,J=0,Y=0,Z=0;if(K&&K.getTime()!=NaN){V=K.getHours();J=K.getMinutes();Y=K.getSeconds();Z=K.getMilliseconds()}else{if(af.length==1){V=parseInt(af[0])}if(af.length==2){V=parseInt(af[0]);J=parseInt(af[1])}if(af.length==3){V=parseInt(af[0]);J=parseInt(af[1]);if(af[2].indexOf(".")>=0){Y=parseInt(af[2].toString().split(".")[0]);Z=parseInt(af[2].toString().split(".")[1])}else{Y=parseInt(af[2])}}if(af.length==4){V=parseInt(af[0]);J=parseInt(af[1]);Y=parseInt(af[2]);Z=parseInt(af[3])}}if(e&&!isNaN(V)&&!isNaN(J)&&!isNaN(Y)&&!isNaN(Z)){e.setHours(V,J,Y,Z);ag=true}}if(ag){return e}}return null},getparseregexp:function(e,R){var T=e._parseRegExp;if(!T){e._parseRegExp=T={}}else{var K=T[R];if(K){return K}}var Q=this.expandFormat(e,R).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),O=["^"],H=[],N=0,J=0,W=this.getTokenRegExp(),L;while((L=W.exec(Q))!==null){var V=Q.slice(N,L.index);N=W.lastIndex;J+=this.appendPreOrPostMatch(V,O);if(J%2){O.push(L[0]);continue}var I=L[0],M=I.length,S;switch(I){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":S="(\\D+)";break;case"tt":case"t":S="(\\D*)";break;case"yyyy":case"fff":case"ff":case"f":S="(\\d{"+M+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":S="(\\d\\d?)";break;case"zzz":S="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":S="([+-]?\\d\\d?)";break;case"/":S="(\\"+e["/"]+")";break;default:throw"Invalid date format pattern '"+I+"'.";break}if(S){O.push(S)}H.push(L[0])}this.appendPreOrPostMatch(Q.slice(N),O);O.push("$");var U=O.join("").replace(/\s+/g,"\\s+"),P={regExp:U,groups:H};return T[R]=P},outOfRange:function(I,e,H){return IH},expandYear:function(L,J){var H=new Date(),e=this.getEra(H);if(J<100){var I=L.twoDigitYearMax;I=typeof I==="string"?new Date().getFullYear()%100+parseInt(I,10):I;var K=this.getEraYear(H,L,e);J+=K-(K%100);if(J>I){J-=100}}return J},parsedate:function(ab,ai,W){if(W==undefined||W==null){W=this.defaultcalendar()}ab=this.trim(ab);var T=W,an=this.getparseregexp(T,ai),N=new RegExp(an.regExp).exec(ab);if(N===null){return null}var aj=an.groups,Z=null,R=null,am=null,al=null,S=null,L=0,ae,ad=0,ak=0,e=0,I=null,U=false;for(var af=0,ah=aj.length;af1&&ah.length)<[^<]*)*<\/script>/gi,d=/([?&])_=[^&]*/,h=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,t=/\s+/,F=i.fn.load,G={},C={},q=["*/"]+["*"];try{E=location.href}catch(A){E=document.createElement("a");E.href="";E=E.href}l=h.exec(E.toLowerCase())||[];function r(e){return function(K,M){if(typeof K!=="string"){M=K;K="*"}var H,N,O,J=K.toLowerCase().split(t),I=0,L=J.length;if(i.isFunction(M)){for(;I0?4:0;if(al){aj=B(Q,W,al)}if(ak>=200&&ak<300||ak===304){if(Q.ifModified){an=W.getResponseHeader("Last-Modified");if(an){i.lastModified[P]=an}an=W.getResponseHeader("Etag");if(an){i.etag[P]=an}}if(ak===304){ah="notmodified";e=true}else{e=c(Q,aj);ah=e.state;ao=e.data;am=e.error;e=!am}}else{am=ah;if(!ah||ak){ah="error";if(ak<0){ak=0}}}W.status=ak;W.statusText=(ag||ah)+"";if(e){ae.resolveWith(af,[ao,ah,W])}else{ae.rejectWith(af,[W,ah,am])}W.statusCode(N);N=undefined;if(I){T.trigger("ajax"+(e?"Success":"Error"),[W,Q,e?ao:am])}aa.fireWith(af,[W,ah]);if(I){T.trigger("ajaxComplete",[W,Q]);if(!(--i.active)){i.event.trigger("ajaxStop")}}}ae.promise(W);W.success=W.done;W.error=W.fail;W.complete=aa.add;W.statusCode=function(ag){if(ag){var e;if(L<2){for(e in ag){N[e]=[N[e],ag[e]]}}else{e=ag[W.status];W.always(e)}}return this};Q.url=((M||Q.url)+"").replace(p,"").replace(o,l[1]+"//");Q.dataTypes=i.trim(Q.dataType||"*").toLowerCase().split(t);if(Q.crossDomain==null){V=h.exec(Q.url.toLowerCase());Q.crossDomain=!!(V&&(V[1]!==l[1]||V[2]!==l[2]||(V[3]||(V[1]==="http:"?80:443))!=(l[3]||(l[1]==="http:"?80:443))))}if(Q.data&&Q.processData&&typeof Q.data!=="string"){Q.data=i.param(Q.data,Q.traditional)}v(G,Q,J,W);if(L===2){return W}I=Q.global;Q.type=Q.type.toUpperCase();Q.hasContent=!j.test(Q.type);if(I&&i.active++===0){i.event.trigger("ajaxStart")}if(!Q.hasContent){if(Q.data){Q.url+=(k.test(Q.url)?"&":"?")+Q.data;delete Q.data}P=Q.url;if(Q.cache===false){var H=i.now(),ac=Q.url.replace(d,"$1_="+H);Q.url=ac+((ac===Q.url)?(k.test(Q.url)?"&":"?")+"_="+H:"")}}if(Q.data&&Q.hasContent&&Q.contentType!==false||J.contentType){W.setRequestHeader("Content-Type",Q.contentType)}if(Q.ifModified){P=P||Q.url;if(i.lastModified[P]){W.setRequestHeader("If-Modified-Since",i.lastModified[P])}if(i.etag[P]){W.setRequestHeader("If-None-Match",i.etag[P])}}W.setRequestHeader("Accept",Q.dataTypes[0]&&Q.accepts[Q.dataTypes[0]]?Q.accepts[Q.dataTypes[0]]+(Q.dataTypes[0]!=="*"?", "+q+"; q=0.01":""):Q.accepts["*"]);for(X in Q.headers){W.setRequestHeader(X,Q.headers[X])}if(Q.beforeSend&&(Q.beforeSend.call(af,W,Q)===false||L===2)){return W.abort()}O="abort";for(X in {success:1,error:1,complete:1}){W[X](Q[X])}Y=v(C,Q,J,W);if(!Y){S(-1,"No Transport")}else{W.readyState=1;if(I){T.trigger("ajaxSend",[W,Q])}if(Q.async&&Q.timeout>0){R=setTimeout(function(){W.abort("timeout")},Q.timeout)}try{L=1;Y.send(U,S)}catch(Z){if(L<2){S(-1,Z)}else{throw Z}}}return W},active:0,lastModified:{},etag:{}});function B(P,O,L){var K,M,J,e,H=P.contents,N=P.dataTypes,I=P.responseFields;for(M in I){if(M in L){O[I[M]]=L[M]}}while(N[0]==="*"){N.shift();if(K===undefined){K=P.mimeType||O.getResponseHeader("content-type")}}if(K){for(M in H){if(H[M]&&H[M].test(K)){N.unshift(M);break}}}if(N[0] in L){J=N[0]}else{for(M in L){if(!N[0]||P.converters[M+" "+N[0]]){J=M;break}if(!e){e=M}}J=J||e}if(J){if(J!==N[0]){N.unshift(J)}return L[J]}}function c(R,J){var P,H,N,L,O=R.dataTypes.slice(),I=O[0],Q={},K=0;if(R.dataFilter){J=R.dataFilter(J,R.dataType)}if(O[1]){for(P in R.converters){Q[P.toLowerCase()]=R.converters[P]}}for(;(N=O[++K]);){if(N!=="*"){if(I!=="*"&&I!==N){P=Q[I+" "+N]||Q["* "+N];if(!P){for(H in Q){L=H.split(" ");if(L[1]===N){P=Q[I+" "+L[0]]||Q["* "+L[0]];if(P){if(P===true){P=Q[H]}else{if(Q[H]!==true){N=L[0];O.splice(K--,0,N)}}break}}}}if(P!==true){if(P&&R["throws"]){J=P(J)}else{try{J=P(J)}catch(M){return{state:"parsererror",error:P?M:"No conversion from "+I+" to "+N}}}}}I=N}}return{state:"success",data:J}}var y=[],n=/\?/,D=/(=)\?(?=&|$)|\?\?/,z=i.now();i.jqx.data.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=y.pop()||(i.expando+"_"+(z++));this[e]=true;return e}});i.jqx.data.ajaxPrefilter("json jsonp",function(Q,L,P){var O,e,N,J=Q.data,H=Q.url,I=Q.jsonp!==false,M=I&&D.test(H),K=I&&!M&&typeof J==="string"&&!(Q.contentType||"").indexOf("application/x-www-form-urlencoded")&&D.test(J);if(Q.dataTypes[0]==="jsonp"||M||K){O=Q.jsonpCallback=i.isFunction(Q.jsonpCallback)?Q.jsonpCallback():Q.jsonpCallback;e=window[O];if(M){Q.url=H.replace(D,"$1"+O)}else{if(K){Q.data=J.replace(D,"$1"+O)}else{if(I){Q.url+=(n.test(H)?"&":"?")+Q.jsonp+"="+O}}}Q.converters["script json"]=function(){if(!N){i.error(O+" was not called")}return N[0]};Q.dataTypes[0]="json";window[O]=function(){N=arguments};P.always(function(){window[O]=e;if(Q[O]){Q.jsonpCallback=L.jsonpCallback;y.push(O)}if(N&&i.isFunction(e)){e(N[0])}N=e=undefined});return"script"}});i.jqx.data.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){i.globalEval(e);return e}}});i.jqx.data.ajaxPrefilter("script",function(e){if(e.cache===undefined){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});i.jqx.data.ajaxTransport("script",function(I){if(I.crossDomain){var e,H=document.head||document.getElementsByTagName("head")[0]||document.documentElement;return{send:function(J,K){e=document.createElement("script");e.async="async";if(I.scriptCharset){e.charset=I.scriptCharset}e.src=I.url;e.onload=e.onreadystatechange=function(M,L){if(L||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(H&&e.parentNode){H.removeChild(e)}e=undefined;if(!L){K(200,"success")}}};H.insertBefore(e,H.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var w,x=window.ActiveXObject?function(){for(var e in w){w[e](0,1)}}:false,m=0;function g(){try{return new window.XMLHttpRequest()}catch(H){}}function s(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(H){}}i.jqx.data.ajaxSettings.xhr=window.ActiveXObject?function(){return !this.isLocal&&g()||s()}:g;(function(e){i.extend(i.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(i.jqx.data.ajaxSettings.xhr());if(i.support.ajax){i.jqx.data.ajaxTransport(function(e){if(!e.crossDomain||i.support.cors){var H;return{send:function(N,I){var L,K,M=e.xhr();if(e.username){M.open(e.type,e.url,e.async,e.username,e.password)}else{M.open(e.type,e.url,e.async)}if(e.xhrFields){for(K in e.xhrFields){M[K]=e.xhrFields[K]}}if(e.mimeType&&M.overrideMimeType){M.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!N["X-Requested-With"]){N["X-Requested-With"]="XMLHttpRequest"}try{for(K in N){M.setRequestHeader(K,N[K])}}catch(J){}M.send((e.hasContent&&e.data)||null);H=function(W,Q){var R,P,O,U,T;try{if(H&&(Q||M.readyState===4)){H=undefined;if(L){M.onreadystatechange=i.noop;if(x){delete w[L]}}if(Q){if(M.readyState!==4){M.abort()}}else{R=M.status;O=M.getAllResponseHeaders();U={};T=M.responseXML;if(T&&T.documentElement){U.xml=T}try{U.text=M.responseText}catch(V){}try{P=M.statusText}catch(V){P=""}if(!R&&e.isLocal&&!e.crossDomain){R=U.text?200:404}else{if(R===1223){R=204}}}}}catch(S){if(!Q){I(-1,S)}}if(U){I(R,P,U,O)}};if(!e.async){H()}else{if(M.readyState===4){setTimeout(H,0)}else{L=++m;if(x){if(!w){w={};i(window).unload(x)}w[L]=H}M.onreadystatechange=H}}},abort:function(){if(H){H(0,1)}}}}})}i.jqx.filter=function(){this.operator="and";var M=0;var J=1;var P=["EMPTY","NOT_EMPTY","CONTAINS","CONTAINS_CASE_SENSITIVE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_CASE_SENSITIVE","STARTS_WITH","STARTS_WITH_CASE_SENSITIVE","ENDS_WITH","ENDS_WITH_CASE_SENSITIVE","EQUAL","EQUAL_CASE_SENSITIVE","NULL","NOT_NULL"];var R=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"];var S=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"];var L=["EQUAL","NOT_EQUAL"];var K=new Array();var Q=new Array();this.evaluate=function(X){var V=true;for(var W=0;WK.length){return null}return Q[U]};this.setoperatorat=function(V,U){if(V==undefined||V==null){return null}if(V<0||V>K.length){return null}Q[U]=U};this.getfilterat=function(U){if(U==undefined||U==null){return null}if(U<0||U>K.length){return null}return K[U]};this.setfilterat=function(U,V){if(U==undefined||U==null){return null}if(U<0||U>K.length){return null}V.key=O();K[U]=V};this.clear=function(){K=new Array();Q=new Array()};var T=function(V,U){this.filtervalue=V;this.comparisonoperator=U;this.type="stringfilter";this.evaluate=function(af){var ae=this.filtervalue;var al=this.comparisonoperator;if(af==null||af==undefined||af==""){if(al=="NULL"){return true}if(al=="EQUAL"&&af==ae){return true}if(al=="NOT_EQUAL"&&af!=ae){return true}if(al!="EMPTY"){return false}else{if(af==""){return true}}}var an="";try{an=af.toString()}catch(ag){return true}var am=function(ap,ao){switch(al){case"EQUAL":return i.jqx.string.equalsIgnoreCase(ap,ao);case"EQUAL_CASE_SENSITIVE":return i.jqx.string.equals(ap,ao);case"NOT_EQUAL":return !i.jqx.string.equalsIgnoreCase(ap,ao);case"NOT_EQUAL_CASE_SENSITIVE":return !i.jqx.string.equals(ap,ao);case"CONTAINS":return i.jqx.string.containsIgnoreCase(ap,ao);case"CONTAINS_CASE_SENSITIVE":return i.jqx.string.contains(ap,ao);case"DOES_NOT_CONTAIN":return !i.jqx.string.containsIgnoreCase(ap,ao);case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return !i.jqx.string.contains(ap,ao);case"EMPTY":return ap=="";case"NOT_EMPTY":return ap!="";case"NOT_NULL":return ap!=null;case"STARTS_WITH":return i.jqx.string.startsWithIgnoreCase(ap,ao);case"ENDS_WITH":return i.jqx.string.endsWithIgnoreCase(ap,ao);case"ENDS_WITH_CASE_SENSITIVE":return i.jqx.string.endsWith(ap,ao);case"STARTS_WITH_CASE_SENSITIVE":return i.jqx.string.startsWith(ap,ao);default:return false}};var Z=new Array();if(ae&&ae.indexOf){if(ae.indexOf("|")>=0||ae.indexOf(" AND ")>=0||ae.indexOf(" OR ")>=0||ae.indexOf(" and ")>=0||ae.indexOf(" or ")>=0){var aa=am(an,ae);if(aa){return aa}var ab=ae.indexOf(" AND ")>=0?ae.split(" AND "):new Array();var Y=ae.indexOf(" OR ")>=0?ae.split(" OR "):new Array();var X=ae.indexOf(" and ")>=0?ae.split(" and "):new Array();var ac=ae.indexOf(" or ")>=0?ae.split(" or "):new Array();var W=ae.indexOf("|")>=0?ae.split("|"):new Array();if(W.length>0){for(var ak=0;ak=0?ae.split(" "):new Array();if(aj.length>0){for(var ak=0;ak0){for(var ak=0;ak=0){Z.push(ab[ak])}}}if(Y.length>0){for(var ak=0;ak=0){Z.push(Y[ak])}}}var ai=undefined;for(var ah=0;ahao;case"GREATER_THAN_OR_EQUAL":return ap>=ao;case"LESS_THAN":return ap=0||af.indexOf(" AND ")>=0||af.indexOf(" OR ")>=0||af.indexOf(" and ")>=0||af.indexOf(" or ")>=0){var ab=am(an,af);if(ab){return ab}af=af.toString();var ac=af.indexOf(" AND ")>=0?af.split(" AND "):new Array();var Z=af.indexOf(" OR ")>=0?af.split(" OR "):new Array();var Y=af.indexOf(" and ")>=0?af.split(" and "):new Array();var ad=af.indexOf(" or ")>=0?af.split(" or "):new Array();ac=ac.concat(Y);Z=Z.concat(ad);var X=af.indexOf("|")>=0?af.split("|"):new Array();if(X.length>0){for(var ak=0;ak0){for(var ak=0;ak=0){aa.push(ac[ak])}}}if(Z.length>0){for(var ak=0;ak=0){aa.push(Z[ak])}}}var aj=undefined;for(var ai=0;ai=0){var W=ag.toString().split("..");if(W.length==2){ab=an>=W[0]&&an<=W[1]}}else{var ab=am(an,ag)}var ae=ai=0){aa=af.toString().split("..");if(aa.length==2){return an>=aa[0]&&an<=aa[1]}}return am(an,af)}};var H=function(X,V,W,ab){this.filtervalue=X;this.type="datefilter";var Z=this;if(W!=undefined&&ab!=undefined){var Y=i.jqx.dataFormat.parsedate(X,W,ab);if(Y!=null){this.filterdate=Y}else{var U=i.jqx.dataFormat.tryparsedate(X,ab);if(U!=null){this.filterdate=U}}}else{var aa=new Date(X);if(aa.toString()=="NaN"||aa.toString()=="Invalid Date"){this.filterdate=i.jqx.dataFormat.tryparsedate(X)}else{this.filterdate=aa}}if(!this.filterdate){var aa=new Date(X);if(aa.toString()=="NaN"||aa.toString()=="Invalid Date"){this.filterdate=i.jqx.dataFormat.tryparsedate(X)}else{this.filterdate=aa}}this.comparisonoperator=V;this.evaluate=function(ao){var an=this.filtervalue;var aw=this.comparisonoperator;if(ao==null||ao==undefined||ao==""){if(aw=="NOT_NULL"){return false}if(aw=="NULL"){return true}else{switch(aw){case"EQUAL":return ao==an;case"NOT_EQUAL":return ao!=an}return false}}else{if(aw=="NULL"){return false}if(aw=="NOT_NULL"){return true}}var ay=new Date();ay.setFullYear(1900,0,1);ay.setHours(12,0,0,0);try{var av=new Date(ao);if(av.toString()=="NaN"||av.toString()=="Invalid Date"){ao=i.jqx.dataFormat.tryparsedate(ao)}else{ao=av}ay=ao;var at=false;if(W!=undefined&&ab!=undefined){if(W.indexOf("t")>=0||W.indexOf("T")>=0||W.indexOf(":")>=0||W.indexOf("f")>=0){at=true;if(an&&an.toString().indexOf(":")==-1){var aj=i.jqx.dataFormat.tryparsedate(an.toString()+":00",ab);if(aj!=null){Z.filterdate=aj}}}}if(!at){ay.setHours(0);ay.setMinutes(0);ay.setSeconds(0)}}catch(ap){if(ao.toString()!=""){return false}}if(Z.filterdate!=null){an=Z.filterdate}else{if(an&&an.indexOf){if(an.indexOf(":")!=-1||!isNaN(parseInt(an))){var ai=new Date(ay);ai.setHours(12,0,0,0);var ah=an.split(":");for(var au=0;auaz;case"GREATER_THAN_OR_EQUAL":return aA>=az;case"LESS_THAN":return aA=0||an.indexOf(" AND ")>=0||an.indexOf(" OR ")>=0||an.indexOf(" and ")>=0||an.indexOf(" or ")>=0){var aj=ax(ay,an);if(aj){return aj}var ak=an.indexOf(" AND ")>=0?an.split(" AND "):new Array();var af=an.indexOf(" OR ")>=0?an.split(" OR "):new Array();var ae=an.indexOf(" and ")>=0?an.split(" and "):new Array();var al=an.indexOf(" or ")>=0?an.split(" or "):new Array();ak=ak.concat(ae);af=af.concat(al);var ad=an.indexOf("|")>=0?an.split("|"):new Array();if(ad.length>0){for(var au=0;au0){for(var au=0;au=0){ag.push(ak[au])}}}if(af.length>0){for(var au=0;au=0){ag.push(af[au])}}}var ar=undefined;for(var aq=0;aq=0){var ac=ao.toString().split("..");if(ac.length==2){aj=ay>=ac[0]&&ay<=ac[1]}}else{var aj=ax(ay,ao)}var am=aq=0){ag=an.toString().split("..");if(ag.length==2){return ay>=ag[0]&&ay<=ag[1]}}return ax(ay,an)}};var e=function(V,U,W){this.filtervalue=V;this.comparisonoperator=U;this.evaluate=function(Y,X){return W(this.filtervalue,Y,this.comparisonoperator)}}};i.jqx.longInt=function(){var H=this;H.longObj=new Object();var e=H.longObj;e.mathObj=new Object();e.mathObj.Long=new Object();e.mathObj.Long=function(I,J){this.lowBits=I|0;this.highBits=J|0};e.mathObj.Long.IntCache={};e.mathObj.Long.fromInt=function(I){if(-128<=I&&I<128){var K=e.mathObj.Long.IntCache[I];if(K){return K}}var J=new e.mathObj.Long(I|0,I<0?-1:0);if(-128<=I&&I<128){e.mathObj.Long.IntCache[I]=J}return J};e.mathObj.Long.fromNumber=function(I){if(isNaN(I)||!isFinite(I)){return e.mathObj.Long.ZERO}else{if(I<=-e.mathObj.Long.TWO_PWR_63_DBL_){return e.mathObj.Long.MIN_VALUE}else{if(I+1>=e.mathObj.Long.TWO_PWR_63_DBL_){return e.mathObj.Long.MAX_VALUE}else{if(I<0){return e.mathObj.Long.fromNumber(-I).negate()}else{return new e.mathObj.Long((I%e.mathObj.Long.TWO_PWR_32_DBL_)|0,(I/e.mathObj.Long.TWO_PWR_32_DBL_)|0)}}}}};e.mathObj.Long.fromBits=function(I,J){return new e.mathObj.Long(I,J)};e.mathObj.Long.fromString=function(K,N){if(K.length===0){throw new Error("number format error: empty string")}var L=N||10;if(L<2||36=0){throw new Error('number format error: interior "-" character: '+K)}}var O=e.mathObj.Long.fromNumber(Math.pow(L,8));var Q=e.mathObj.Long.ZERO;for(var J=0;J=0)?this.lowBits:e.mathObj.Long.TWO_PWR_32_DBL_+this.lowBits};e.mathObj.Long.prototype.getNumBitsAbs=function(){if(this.isNegative()){if(this.equals(e.mathObj.Long.MIN_VALUE)){return 64}else{return this.negate().getNumBitsAbs()}}else{var J=this.highBits!==0?this.highBits:this.lowBits;for(var I=31;I>0;I--){if((J&(1<0};e.mathObj.Long.prototype.greaterThanOrEqual=function(I){return this.compare(I)>=0};e.mathObj.Long.prototype.compare=function(J){if(this.equals(J)){return 0}var I=this.isNegative();var K=J.isNegative();if(I&&!K){return -1}if(!I&&K){return 1}if(this.subtract(J).isNegative()){return -1}else{return 1}};e.mathObj.Long.prototype.negate=function(){if(this.equals(e.mathObj.Long.MIN_VALUE)){return e.mathObj.Long.MIN_VALUE}else{return this.not().add(e.mathObj.Long.ONE)}};e.mathObj.Long.prototype.add=function(P){var N=this.highBits>>>16;var J=this.highBits&65535;var Q=this.lowBits>>>16;var K=this.lowBits&65535;var S=P.highBits>>>16;var L=P.highBits&65535;var T=P.lowBits>>>16;var M=P.lowBits&65535;var U=0,O=0,I=0,R=0;R+=K+M;I+=R>>>16;R&=65535;I+=Q+T;O+=I>>>16;I&=65535;O+=J+L;U+=O>>>16;O&=65535;U+=N+S;U&=65535;return e.mathObj.Long.fromBits((I<<16)|R,(U<<16)|O)};e.mathObj.Long.prototype.subtract=function(I){return this.add(I.negate())};e.mathObj.Long.prototype.multiply=function(P){if(this.isZero()){return e.mathObj.Long.ZERO}else{if(P.isZero()){return e.mathObj.Long.ZERO}}if(this.equals(e.mathObj.Long.MIN_VALUE)){return P.isOdd()?e.mathObj.Long.MIN_VALUE:e.mathObj.Long.ZERO}else{if(P.equals(e.mathObj.Long.MIN_VALUE)){return this.isOdd()?e.mathObj.Long.MIN_VALUE:e.mathObj.Long.ZERO}}if(this.isNegative()){if(P.isNegative()){return this.negate().multiply(P.negate())}else{return this.negate().multiply(P).negate()}}else{if(P.isNegative()){return this.multiply(P.negate()).negate()}}if(this.lessThan(e.mathObj.Long.TWO_PWR_24_)&&P.lessThan(e.mathObj.Long.TWO_PWR_24_)){return e.mathObj.Long.fromNumber(this.toNumber()*P.toNumber())}var N=this.highBits>>>16;var J=this.highBits&65535;var Q=this.lowBits>>>16;var K=this.lowBits&65535;var S=P.highBits>>>16;var L=P.highBits&65535;var T=P.lowBits>>>16;var M=P.lowBits&65535;var U=0,O=0,I=0,R=0;R+=K*M;I+=R>>>16;R&=65535;I+=Q*M;O+=I>>>16;I&=65535;I+=K*T;O+=I>>>16;I&=65535;O+=J*M;U+=O>>>16;O&=65535;O+=Q*T;U+=O>>>16;O&=65535;O+=K*L;U+=O>>>16;O&=65535;U+=N*M+J*T+Q*L+K*S;U&=65535;return e.mathObj.Long.fromBits((I<<16)|R,(U<<16)|O)};e.mathObj.Long.prototype.div=function(K){if(K.isZero()){throw new Error("division by zero")}else{if(this.isZero()){return e.mathObj.Long.ZERO}}var N,P;if(this.equals(e.mathObj.Long.MIN_VALUE)){if(K.equals(e.mathObj.Long.ONE)||K.equals(e.mathObj.Long.NEG_ONE)){return e.mathObj.Long.MIN_VALUE}else{if(K.equals(e.mathObj.Long.MIN_VALUE)){return e.mathObj.Long.ONE}else{var I=this.shiftRight(1);N=I.div(K).shiftLeft(1);if(N.equals(e.mathObj.Long.ZERO)){return K.isNegative()?e.mathObj.Long.ONE:e.mathObj.Long.NEG_ONE}else{P=this.subtract(K.multiply(N));var R=N.add(P.div(K));return R}}}}else{if(K.equals(e.mathObj.Long.MIN_VALUE)){return e.mathObj.Long.ZERO}}if(this.isNegative()){if(K.isNegative()){return this.negate().div(K.negate())}else{return this.negate().div(K).negate()}}else{if(K.isNegative()){return this.div(K.negate()).negate()}}var L=e.mathObj.Long.ZERO;P=this;while(P.greaterThanOrEqual(K)){N=Math.max(1,Math.floor(P.toNumber()/K.toNumber()));var Q=Math.ceil(Math.log(N)/Math.LN2);var O=(Q<=48)?1:Math.pow(2,Q-48);var J=e.mathObj.Long.fromNumber(N);var M=J.multiply(K);while(M.isNegative()||M.greaterThan(P)){N-=O;J=e.mathObj.Long.fromNumber(N);M=J.multiply(K)}if(J.isZero()){J=e.mathObj.Long.ONE}L=L.add(J);P=P.subtract(M)}return L};e.mathObj.Long.prototype.modulo=function(I){return this.subtract(this.div(I).multiply(I))};e.mathObj.Long.prototype.not=function(){return e.mathObj.Long.fromBits(~this.lowBits,~this.highBits)};e.mathObj.Long.prototype.and=function(I){return e.mathObj.Long.fromBits(this.lowBits&I.lowBits,this.highBits&I.highBits)};e.mathObj.Long.prototype.or=function(I){return e.mathObj.Long.fromBits(this.lowBits|I.lowBits,this.highBits|I.highBits)};e.mathObj.Long.prototype.xor=function(I){return e.mathObj.Long.fromBits(this.lowBits^I.lowBits,this.highBits^I.highBits)};e.mathObj.Long.prototype.shiftLeft=function(K){K&=63;if(K===0){return this}else{var I=this.lowBits;if(K<32){var J=this.highBits;return e.mathObj.Long.fromBits(I<>>(32-K)))}else{return e.mathObj.Long.fromBits(0,I<<(K-32))}}};e.mathObj.Long.prototype.shiftRight=function(K){K&=63;if(K===0){return this}else{var J=this.highBits;if(K<32){var I=this.lowBits;return e.mathObj.Long.fromBits((I>>>K)|(J<<(32-K)),J>>K)}else{return e.mathObj.Long.fromBits(J>>(K-32),J>=0?0:-1)}}};e.mathObj.Long.prototype.shiftRightUnsigned=function(K){K&=63;if(K===0){return this}else{var J=this.highBits;if(K<32){var I=this.lowBits;return e.mathObj.Long.fromBits((I>>>K)|(J<<(32-K)),J>>>K)}else{if(K===32){return e.mathObj.Long.fromBits(J,0)}else{return e.mathObj.Long.fromBits(J>>>(K-32),0)}}}};return e};i.jqx.math=function(){var H=new Object();var e=new i.jqx.longInt();H.getDecimalNotation=function(M,K){if(K==="decimal"){return M}M=M.toString();function I(T){var S="-0123456789";var Q="⁻⁰¹²³⁴⁵⁶⁷⁸⁹";var P="";for(var R=0;R=0){R=R.toFixed(Q)}var P=R+"×10"+I((parseInt(T,10)-S).toString());return P}var N=O(M);if(K==="scientific"){return L(N)}else{if(K==="engineering"){return J(N)}else{return N}}};i.extend(H,e.mathObj.Long);return H}})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxdropdownlist.js b/static/js/jqxdropdownlist.js
new file mode 100644
index 0000000..a6b59e0
--- /dev/null
+++ b/static/js/jqxdropdownlist.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.jqx.jqxWidget("jqxDropDownList","",{});a.extend(a.jqx._jqxDropDownList.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,items:new Array(),selectedIndex:-1,source:null,scrollBarSize:15,arrowSize:19,enableHover:true,enableSelection:true,visualItems:new Array(),groups:new Array(),equalItemsWidth:true,itemHeight:-1,visibleItems:new Array(),emptyGroupText:"Group",checkboxes:false,openDelay:250,closeDelay:300,animationType:"default",autoOpen:false,dropDownWidth:"auto",dropDownHeight:"200px",autoDropDownHeight:false,keyboardSelection:true,enableBrowserBoundsDetection:false,dropDownHorizontalAlignment:"left",displayMember:"",valueMember:"",groupMember:"",searchMember:"",searchMode:"startswithignorecase",incrementalSearch:true,incrementalSearchDelay:700,renderer:null,placeHolder:"Please Choose:",promptText:"Please Choose:",emptyString:"",rtl:false,selectionRenderer:null,listBox:null,popupZIndex:9999999999999,renderMode:"default",touchMode:"auto",_checkForHiddenParent:true,autoBind:true,focusable:true,filterable:false,filterHeight:27,filterPlaceHolder:"Looking for",filterDelay:100,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","select","unselect","change","checkChange","bindingComplete"]};a.extend(true,this,b);return b},createInstance:function(b){this.render()},render:function(){var q=this;if(!q.width){q.width=200}if(!q.height){q.height=25}var o=q.element.nodeName.toLowerCase();if(o=="select"||o=="ul"||o=="ol"){q.field=q.element;if(q.field.className){q._className=q.field.className}var k={title:q.field.title};if(q.field.id.length){k.id=q.field.id.replace(/[^\w]/g,"_")+"_jqxDropDownList"}else{k.id=a.jqx.utilities.createId()+"_jqxDropDownList"}var c=a("",k);if(!q.width){q.width=a(q.field).width()}if(!q.height){q.height=a(q.field).outerHeight()}a(q.field).hide().after(c);var i=q.host.data();q.host=c;q.host.data(i);q.element=c[0];q.element.id=q.field.id;q.field.id=k.id;if(q._className){q.host.addClass(q._className);a(q.field).removeClass(q._className)}if(q.field.tabIndex){var f=q.field.tabIndex;q.field.tabIndex=-1;q.element.tabIndex=f}var r=a.jqx.parseSourceTag(q.field);q.source=r.items;if(q.selectedIndex==-1){q.selectedIndex=r.index}}q.element.innerHTML="";q.isanimating=false;q.id=q.element.id||a.jqx.utilities.createId();q.host.attr("role","combobox");a.jqx.aria(q,"aria-autocomplete","both");a.jqx.aria(q,"aria-readonly",false);var g="";if(a.jqx._jqxListBox==null||a.jqx._jqxListBox==undefined){throw new Error("jqxDropDownList: Missing reference to jqxlistbox.js.")}if(q.host.attr("tabindex")){q.host.attr("tabindex",q.host.attr("tabindex"));q.host.removeAttr("tabindex")}else{q.host.attr("tabindex",0)}var l=q;q.touch=a.jqx.mobile.isTouchDevice();q.comboStructure=g;q.element.innerHTML=g;q.dropdownlistWrapper=a(q.element.firstChild.firstChild);q.dropdownlistArrow=a(q.dropdownlistWrapper[0].firstChild.nextSibling);q.arrow=a(q.dropdownlistArrow[0].firstChild);q.dropdownlistContent=a(q.dropdownlistWrapper[0].firstChild);q.dropdownlistContent.addClass(q.toThemeProperty("jqx-dropdownlist-content jqx-disableselect"));if(q.rtl){q.dropdownlistContent.addClass(q.toThemeProperty("jqx-rtl jqx-dropdownlist-content-rtl"))}q.addHandler(q.dropdownlistWrapper,"selectstart",function(){return false});q.dropdownlistWrapper[0].id="dropdownlistWrapper"+q.element.id;q.dropdownlistArrow[0].id="dropdownlistArrow"+q.element.id;q.dropdownlistContent[0].id="dropdownlistContent"+q.element.id;q._addInput();if(q.promptText!="Please Choose:"){q.placeHolder=q.promptText}var n=q.toThemeProperty("jqx-widget")+" "+q.toThemeProperty("jqx-dropdownlist-state-normal")+" "+q.toThemeProperty("jqx-rc-all")+" "+q.toThemeProperty("jqx-fill-state-normal");q.element.className+=" "+n;q._firstDiv=a(q.element.firstChild);try{var p="listBox"+q.id;var h=a(a.find("#"+p));if(h.length>0){h.remove()}a.jqx.aria(q,"aria-owns",p);a.jqx.aria(q,"aria-haspopup",true);var b=a("");b.hide();b.appendTo(document.body);q.container=b;q.listBoxContainer=a(a.find("#innerListBox"+q.id));var d=q.width;if(q.dropDownWidth!="auto"){d=q.dropDownWidth}if(d==null){d=q.host.width();if(d==0){d=q.dropDownWidth}}if(q.dropDownHeight==null){q.dropDownHeight=200}var l=q;q.container.width(parseInt(d)+25);q.container.height(parseInt(q.dropDownHeight)+25);q.addHandler(q.listBoxContainer,"bindingComplete",function(e){if(!q.listBox){q.listBox=a.data(q.listBoxContainer[0],"jqxListBox").instance}q._raiseEvent("6")});q.listBoxContainer.jqxListBox({filterHeight:q.filterHeight,filterPlaceHolder:q.filterPlaceHolder,filterDelay:q.filterDelay,filterable:q.filterable,allowDrop:false,allowDrag:false,autoBind:q.autoBind,_checkForHiddenParent:false,focusable:q.focusable,touchMode:q.touchMode,checkboxes:q.checkboxes,rtl:q.rtl,_renderOnDemand:true,emptyString:q.emptyString,itemHeight:q.itemHeight,width:d,searchMode:q.searchMode,incrementalSearch:q.incrementalSearch,incrementalSearchDelay:q.incrementalSearchDelay,groupMember:q.groupMember,searchMember:q.searchMember,displayMember:q.displayMember,valueMember:q.valueMember,height:q.dropDownHeight,autoHeight:q.autoDropDownHeight,scrollBarSize:q.scrollBarSize,selectedIndex:q.selectedIndex,source:q.source,theme:q.theme,rendered:function(){if(q.selectedIndex!=q.listBoxContainer.jqxListBox("selectedIndex")){q.listBox=a.data(q.listBoxContainer[0],"jqxListBox").instance;q.listBoxContainer.jqxListBox({selectedIndex:q.selectedIndex});q.renderSelection("mouse")}else{q.renderSelection("mouse")}},renderer:q.renderer});q.listBoxContainer.css({position:"absolute",zIndex:q.popupZIndex,top:0,left:0});q.listBox=a.data(q.listBoxContainer[0],"jqxListBox").instance;q.listBox.enableSelection=q.enableSelection;q.listBox.enableHover=q.enableHover;q.listBox.equalItemsWidth=q.equalItemsWidth;q.listBox.selectIndex(q.selectedIndex);q.listBox._arrange();q.listBoxContainer.addClass(q.toThemeProperty("jqx-popup"));if(a.jqx.browser.msie){q.listBoxContainer.addClass(q.toThemeProperty("jqx-noshadow"))}q.addHandler(q.listBoxContainer,"unselect",function(e){q._raiseEvent("3",{index:e.args.index,type:e.args.type,item:e.args.item})});q.addHandler(q.listBoxContainer,"change",function(e){if(e.args){if(e.args.type!="keyboard"){q._raiseEvent("4",{index:e.args.index,type:e.args.type,item:e.args.item})}else{if(e.args.type=="keyboard"){if(!q.isOpened()){q._raiseEvent("4",{index:q.selectedIndex,type:"keyboard",item:q.getItem(q.selectedIndex)})}}}}});if(q.animationType=="none"){q.container.css("display","none")}else{q.container.hide()}}catch(j){if(console){console.log(j)}}var q=q;q.propertyChangeMap.disabled=function(e,t,s,u){if(u){e.host.addClass(q.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(q.toThemeProperty("jqx-fill-state-disabled"));e.dropdownlistContent.addClass(q.toThemeProperty("jqx-dropdownlist-content-disabled"))}else{e.host.removeClass(q.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.removeClass(q.toThemeProperty("jqx-fill-state-disabled"));e.dropdownlistContent.removeClass(q.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(q.disabled){q.host.addClass(q.toThemeProperty("jqx-dropdownlist-state-disabled"));q.host.addClass(q.toThemeProperty("jqx-fill-state-disabled"));q.dropdownlistContent.addClass(q.toThemeProperty("jqx-dropdownlist-content-disabled"))}q.arrow.addClass(q.toThemeProperty("jqx-icon-arrow-down"));q.arrow.addClass(q.toThemeProperty("jqx-icon"));if(q.renderMode==="simple"){q.arrow.remove();q.host.removeClass(q.toThemeProperty("jqx-fill-state-normal"));q.host.removeClass(q.toThemeProperty("jqx-rc-all"))}q._updateHandlers();q._setSize();q._arrange();if(q.listBox){q.renderSelection()}if(a.jqx.browser.msie&&a.jqx.browser.version<8){if(q.host.parents(".jqx-window").length>0){var m=q.host.parents(".jqx-window").css("z-index");b.css("z-index",m+10);q.listBoxContainer.css("z-index",m+10)}}},resize:function(c,b){this.width=c;this.height=b;this._setSize();this._arrange()},val:function(c){if(!this.dropdownlistContent){return""}var d=function(f){for(var e in f){if(f.hasOwnProperty(e)){return false}}if(typeof c=="number"){return false}if(typeof c=="date"){return false}if(typeof c=="boolean"){return false}if(typeof c=="string"){return false}return true};if(this.input&&(d(c)||arguments.length==0)){return this.input.val()}var b=this.getItemByValue(c);if(b!=null){this.selectItem(b)}if(this.input){return this.input.val()}},focus:function(){try{var d=this;var c=function(){d.host.focus();if(d._firstDiv){d._firstDiv.focus()}};c();setTimeout(function(){c()},10)}catch(b){}},_addInput:function(){var b=this.host.attr("name");this.input=a("");this.host.append(this.input);if(b){this.input.attr("name",b)}},getItems:function(){if(!this.listBox){return new Array()}return this.listBox.items},getVisibleItems:function(){return this.listBox.getVisibleItems()},_setSize:function(){if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.host.width(this.width)}else{if(this.width!=undefined&&!isNaN(this.width)){this.host.width(this.width)}}if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.host.height(this.height)}else{if(this.height!=undefined&&!isNaN(this.height)){this.host.height(this.height)}}var e=false;if(this.width!=null&&this.width.toString().indexOf("%")!=-1){e=true;this.host.width(this.width)}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){e=true;this.host.height(this.height)}var c=this;var d=function(){c._arrange();if(c.dropDownWidth=="auto"){var f=c.host.width();c.listBoxContainer.jqxListBox({width:f});c.container.width(parseInt(f)+25)}};if(e){var b=this.host.width();if(this.dropDownWidth!="auto"){b=this.dropDownWidth}this.listBoxContainer.jqxListBox({width:b});this.container.width(parseInt(b)+25)}a.jqx.utilities.resize(this.host,function(){d()},false,this._checkForHiddenParent)},isOpened:function(){var c=this;var b=a.data(document.body,"openedJQXListBox"+this.id);if(b!=null&&b==c.listBoxContainer){return true}return false},_updateHandlers:function(){var c=this;var d=false;this.removeHandlers();if(!this.touch){this.addHandler(this.host,"mouseenter",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){d=true;c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-hover"));c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down-hover"));c.host.addClass(c.toThemeProperty("jqx-fill-state-hover"))}});this.addHandler(this.host,"mouseleave",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-hover"));c.host.removeClass(c.toThemeProperty("jqx-fill-state-hover"));c.arrow.removeClass(c.toThemeProperty("jqx-icon-arrow-down-hover"));d=false}})}if(this.host.parents()){this.addHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id,function(e){var f=c.isOpened();if(f){c.close()}})}var b="mousedown";if(this.touch){b=a.jqx.mobile.getTouchEventName("touchstart")}this.addHandler(this.dropdownlistWrapper,b,function(f){if(!c.disabled){var e=c.container.css("display")=="block";if(!c.isanimating){if(e){c.hideListBox();return false}else{c.showListBox();if(!c.focusable){if(f.preventDefault){f.preventDefault()}}else{c.focus()}}}}});if(c.autoOpen){this.addHandler(this.host,"mouseenter",function(){var e=c.isOpened();if(!e&&c.autoOpen){c.open();c.host.focus()}});a(document).on("mousemove."+c.id,function(h){var g=c.isOpened();if(g&&c.autoOpen){var l=c.host.coord();var k=l.top;var j=l.left;var i=c.container.coord();var e=i.left;var f=i.top;canClose=true;if(h.pageY>=k&&h.pageY<=k+c.host.height()){if(h.pageX>=j&&h.pageX=f&&h.pageY<=f+c.container.height()){if(h.pageX>=e&&h.pageX0){r=v[0]}else{r=null}}if(r==null){var j=a('');j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget"));j.addClass(this.toThemeProperty("jqx-listitem-state-normal"));j.addClass(this.toThemeProperty("jqx-item"));a.jqx.utilities.html(j,this.placeHolder);var s=this.dropdownlistContent.css("padding-top");var x=this.dropdownlistContent.css("padding-bottom");j.css("padding-top",s);j.css("padding-bottom",x);var q=j.outerHeight();j.remove();j.removeClass();a.jqx.utilities.html(this.dropdownlistContent,j);var h=this.host.height();if(this.height!=null&&this.height!=undefined){if(this.height.toString().indexOf("%")===-1){h=parseInt(this.height)}}var f=parseInt((parseInt(h)-parseInt(q))/2);if(f>0){this.dropdownlistContent.css("margin-top",f+"px");this.dropdownlistContent.css("margin-bottom",f+"px")}if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,-1,"",""));this.dropdownlistContent.css("margin-top","0px");this.dropdownlistContent.css("margin-bottom","0px");this._updateInputSelection()}else{this._updateInputSelection()}this.selectedIndex=this.listBox.selectedIndex;if(this.width==="auto"){this._arrange()}if(this.focusable&&this.isOpened()){this.focus()}return}this.selectedIndex=this.listBox.selectedIndex;var j=a(document.createElement("span"));j[0].setAttribute("unselectable","on");try{j[0].style.color="inherit"}catch(t){}j[0].style.borderWidth="0px";j[0].style.backgroundColor="transparent";j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget jqx-listitem-state-normal jqx-item"));var p=false;try{if(r.html!=undefined&&r.html!=null&&r.html.toString().length>0){a.jqx.utilities.html(j,r.html)}else{if(r.label!=undefined&&r.label!=null&&r.label.toString().length>0){a.jqx.utilities.html(j,r.label)}else{if(r.label===null||r.label===""){p=true;a.jqx.utilities.html(j,"")}else{if(r.value!=undefined&&r.value!=null&&r.value.toString().length>0){a.jqx.utilities.html(j,r.value)}else{if(r.title!=undefined&&r.title!=null&&r.title.toString().length>0){a.jqx.utilities.html(j,r.title)}else{if(r.label==""||r.label==null){p=true;a.jqx.utilities.html(j,"")}}}}}}}catch(n){var m=n}var s=this.dropdownlistContent[0].style.paddingTop;var x=this.dropdownlistContent[0].style.paddingBottom;if(s===""){s="0px"}if(x===""){x="0px"}j[0].style.paddingTop=s;j[0].style.paddingBottom=x;var q=j.outerHeight();if(q===0){q=16}if((r.label==""||r.label==null)&&p){a.jqx.utilities.html(j,"")}var c=this.width&&this.width.toString().indexOf("%")<=0;j.remove();j.removeClass();if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,r.index,r.label,r.value));if(this.focusable&&this.isOpened()){this.focus()}}else{if(this.checkboxes){var g=this.getCheckedItems();var k="";for(var o=0;o0){this.dropdownlistContent[0].style.marginTop=f+"px";this.dropdownlistContent[0].style.marginBottom=f+"px"}if(this.selectionRenderer){this.dropdownlistContent[0].style.marginTop="0px";this.dropdownlistContent[0].style.marginBottom="0px"}if(this.dropdownlistContent&&this.input){this._updateInputSelection()}if(this.listBox&&this.listBox._activeElement){a.jqx.aria(this,"aria-activedescendant",this.listBox._activeElement.id)}if(this.width==="auto"){this._arrange()}},_updateInputSelection:function(){if(this.input){var c=new Array();if(this.selectedIndex==-1){this.input.val("")}else{var f=this.getSelectedItem();if(f!=null){this.input.val(f.value);c.push(f.value)}else{this.input.val(this.dropdownlistContent.text())}}if(this.checkboxes){var b=this.getCheckedItems();var g="";if(b!=null){for(var d=0;d=0;if(this.selected){a(this).attr("selected",true)}})}else{a.each(this.items,function(h,i){a(this.originalItem.originalItem).removeAttr("data-selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this.originalItem.originalItem).attr("data-selected",true)}})}}},setContent:function(b){a.jqx.utilities.html(this.dropdownlistContent,b);this._updateInputSelection()},dataBind:function(){this.listBoxContainer.jqxListBox({source:this.source});this.renderSelection("mouse");if(this.source==null){this.clearSelection()}},clear:function(){this.listBoxContainer.jqxListBox({source:null});this.clearSelection()},clearSelection:function(b){this.selectedIndex=-1;this._updateInputSelection();this.listBox.clearSelection();this.renderSelection();if(!this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.placeHolder)}},unselectIndex:function(b,c){if(isNaN(b)){return}this.listBox.unselectIndex(b,c);this.renderSelection()},selectIndex:function(b,d,e,c){this.listBox.selectIndex(b,d,e,c,"api")},getSelectedIndex:function(){return this.selectedIndex},getSelectedItem:function(){return this.listBox.getVisibleItem(this.selectedIndex)},getCheckedItems:function(){return this.listBox.getCheckedItems()},checkIndex:function(b){this.listBox.checkIndex(b)},uncheckIndex:function(b){this.listBox.uncheckIndex(b)},indeterminateIndex:function(b){this.listBox.indeterminateIndex(b)},checkAll:function(){this.listBox.checkAll();this.renderSelection("mouse")},uncheckAll:function(){this.listBox.uncheckAll();this.renderSelection("mouse")},addItem:function(b){return this.listBox.addItem(b)},insertAt:function(c,b){if(c==null){return false}return this.listBox.insertAt(c,b)},removeAt:function(c){var b=this.listBox.removeAt(c);this.renderSelection("mouse");return b},removeItem:function(c){var b=this.listBox.removeItem(c);this.renderSelection("mouse");return b},updateItem:function(c,d){var b=this.listBox.updateItem(c,d);this.renderSelection("mouse");return b},updateAt:function(d,c){var b=this.listBox.updateAt(d,c);this.renderSelection("mouse");return b},ensureVisible:function(b){return this.listBox.ensureVisible(b)},disableAt:function(b){return this.listBox.disableAt(b)},enableAt:function(b){return this.listBox.enableAt(b)},disableItem:function(b){return this.listBox.disableItem(b)},enableItem:function(b){return this.listBox.enableItem(b)},_findPos:function(c){while(c&&(c.type=="hidden"||c.nodeType!=1||a.expr.filters.hidden(c))){c=c.nextSibling}var b=a(c).coord(true);return[b.left,b.top]},testOffset:function(h,f,c){var g=h.outerWidth();var j=h.outerHeight();var i=a(window).width()+a(window).scrollLeft();var e=a(window).height()+a(window).scrollTop();if(f.left+g>i){if(g>this.host.width()){var d=this.host.coord().left;var b=g-this.host.width();f.left=d-b+2}}if(f.left<0){f.left=parseInt(this.host.coord().left)+"px"}f.top-=Math.min(f.top,(f.top+j>e&&e>j)?Math.abs(j+c+22):0);return f},open:function(){this.showListBox()},close:function(){this.hideListBox()},_getBodyOffset:function(){var c=0;var b=0;if(a("body").css("border-top-width")!="0px"){c=parseInt(a("body").css("border-top-width"));if(isNaN(c)){c=0}}if(a("body").css("border-left-width")!="0px"){b=parseInt(a("body").css("border-left-width"));if(isNaN(b)){b=0}}return{left:b,top:c}},showListBox:function(){a.jqx.aria(this,"aria-expanded",true);if(this.listBox._renderOnDemand){this.listBoxContainer.jqxListBox({_renderOnDemand:false})}if(this.dropDownWidth=="auto"&&this.width!=null&&this.width.indexOf&&(this.width.indexOf("%")!=-1||this.width.indexOf("auto")!=-1)){if(this.listBox.host.width()!=this.host.width()){var c=this.host.width();this.listBoxContainer.jqxListBox({width:c});this.container.width(parseInt(c)+25)}}var p=this;var d=this.listBoxContainer;var j=this.listBox;var m=a(window).scrollTop();var h=a(window).scrollLeft();var k=parseInt(this._findPos(this.host[0])[1])+parseInt(this.host.outerHeight())-1+"px";var f,g=parseInt(Math.round(this.host.coord(true).left));f=g+"px";var o=a.jqx.mobile.isSafariMobileBrowser()||a.jqx.mobile.isWindowsPhone();if(this.listBox==null){return}this.ishiding=false;if(!this.keyboardSelection){this.listBox.selectIndex(this.selectedIndex);this.listBox.ensureVisible(this.selectedIndex)}this.tempSelectedIndex=this.selectedIndex;if(this.autoDropDownHeight){this.container.height(this.listBoxContainer.height()+25)}if((o!=null&&o)){f=a.jqx.mobile.getLeftPos(this.element);k=a.jqx.mobile.getTopPos(this.element)+parseInt(this.host.outerHeight());if(a("body").css("border-top-width")!="0px"){k=parseInt(k)-this._getBodyOffset().top+"px"}if(a("body").css("border-left-width")!="0px"){f=parseInt(f)-this._getBodyOffset().left+"px"}}d.stop();if(this.renderMode!=="simple"){this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-selected"));this.host.addClass(this.toThemeProperty("jqx-fill-state-pressed"));this.arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-selected"))}this.container.css("left",f);this.container.css("top",k);j._arrange();var e=true;var q=false;if(this.dropDownHorizontalAlignment=="right"||this.rtl){var l=this.container.outerWidth();var b=Math.abs(l-this.host.width());if(l>this.host.width()){this.container.css("left",25+parseInt(Math.round(g))-b+"px")}else{this.container.css("left",25+parseInt(Math.round(g))+b+"px")}}if(this.enableBrowserBoundsDetection){var i=this.testOffset(d,{left:parseInt(this.container.css("left")),top:parseInt(k)},parseInt(this.host.outerHeight()));if(parseInt(this.container.css("top"))!=i.top){q=true;d.css("top",23);d.addClass(this.toThemeProperty("jqx-popup-up"))}else{d.css("top",0)}this.container.css("top",i.top);if(parseInt(this.container.css("left"))!=i.left){this.container.css("left",i.left)}}if(this.animationType=="none"){this.container.css("display","block");a.data(document.body,"openedJQXListBoxParent",p);a.data(document.body,"openedJQXListBox"+this.id,d);d.css("margin-top",0);d.css("opacity",1);j._renderItems();p._raiseEvent("0",j)}else{this.container.css("display","block");p.isanimating=true;if(this.animationType=="fade"){d.css("margin-top",0);d.css("opacity",0);d.animate({opacity:1},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",p);a.data(document.body,"openedJQXListBox"+p.id,d);p.ishiding=false;p.isanimating=false;j._renderItems();p._raiseEvent("0",j)})}else{d.css("opacity",1);var n=d.outerHeight();if(q){d.css("margin-top",n)}else{d.css("margin-top",-n)}d.animate({"margin-top":0},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",p);a.data(document.body,"openedJQXListBox"+p.id,d);p.ishiding=false;p.isanimating=false;j._renderItems();p._raiseEvent("0",j)})}}if(!q){this.host.addClass(this.toThemeProperty("jqx-rc-b-expanded"));d.addClass(this.toThemeProperty("jqx-rc-t-expanded"))}else{this.host.addClass(this.toThemeProperty("jqx-rc-t-expanded"));d.addClass(this.toThemeProperty("jqx-rc-b-expanded"))}if(this.renderMode!=="simple"){d.addClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-focus"));this.host.addClass(this.toThemeProperty("jqx-fill-state-focus"))}},hideListBox:function(){a.jqx.aria(this,"aria-expanded",false);var f=this.listBoxContainer;var g=this.listBox;var c=this.container;var d=this;a.data(document.body,"openedJQXListBox"+this.id,null);if(this.animationType=="none"){this.container.css("display","none")}else{if(!d.ishiding){f.stop();var b=f.outerHeight();f.css("margin-top",0);d.isanimating=true;var e=-b;if(parseInt(this.container.coord().top)0&&h.width!=="auto"){h.dropdownlistContent[0].style.width=b+"px"}else{if(b<=0){h.dropdownlistContent[0].style.width="0px"}}if(h.width==="auto"){h.dropdownlistContent.css("width","auto");d=h.dropdownlistContent.width()+g+2*i;h.host.width(d)}h.dropdownlistContent[0].style.height=j+"px";h.dropdownlistContent[0].style.left="0px";h.dropdownlistContent[0].style.top="0px";h.dropdownlistArrow[0].style.width=g+"px";if(h.width&&h.width.toString().indexOf("%")>=0){var e=(g*100)/d;var c=(b*100)/d;h.dropdownlistArrow[0].style.width=e+"%";h.dropdownlistContent[0].style.width=c+"%"}h.dropdownlistArrow[0].style.height=j+"px";if(h.rtl){h.dropdownlistArrow.css("float","left");h.dropdownlistContent.css("float","right")}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBoxContainer,"unselect");this.removeHandler(this.listBoxContainer,"change");this.removeHandler(this.dropdownlistWrapper,"selectstart");this.removeHandler(this.dropdownlistWrapper,"mousedown");this.removeHandler(this.host,"keydown");this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBox.content,"click");this.removeHandler(this.listBoxContainer,"bindingComplete");if(this.host.parents()){this.removeHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id)}this.removeHandlers();this.listBoxContainer.jqxListBox("destroy");this.listBoxContainer.remove();this.host.removeClass();this.removeHandler(a(document),"mousedown."+this.id,this.closeOpenedListBox);if(this.touch){this.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+this.id)}this.dropdownlistArrow.remove();delete this.dropdownlistArrow;delete this.dropdownlistWrapper;delete this.listBoxContainer;delete this.input;delete this.arrow;delete this.dropdownlistContent;delete this.listBox;delete this._firstDiv;this.container.remove();delete this.container;var b=a.data(this.element,"jqxDropDownList");if(b){delete b.instance}this.host.removeData();this.host.remove();delete this.comboStructure;delete this.host;delete this.element},_raiseEvent:function(f,c){if(c==undefined){c={owner:null}}var d=this.events[f];args=c;args.owner=this;var e=new a.Event(d);e.owner=this;if(f==2||f==3||f==4||f==5){e.args=c}var b=this.host.trigger(e);return b},propertyChangedHandler:function(b,c,f,e){if(b.isInitialized==undefined||b.isInitialized==false){return}if(c=="filterable"){b.listBoxContainer.jqxListBox({filterable:e})}if(c=="filterHeight"){b.listBoxContainer.jqxListBox({filterHeight:e})}if(c=="filterPlaceHolder"){b.listBoxContainer.jqxListBox({filterPlaceHolder:e})}if(c=="filterDelay"){b.listBoxContainer.jqxListBox({filterDelay:e})}if(c=="enableSelection"){b.listBoxContainer.jqxListBox({enableSelection:e})}if(c=="enableHover"){b.listBoxContainer.jqxListBox({enableHover:e})}if(c=="autoOpen"){b._updateHandlers()}if(c=="emptyString"){b.listBox.emptyString=b.emptyString}if(c=="itemHeight"){b.listBoxContainer.jqxListBox({itemHeight:e})}if(c=="renderer"){b.listBoxContainer.jqxListBox({renderer:e})}if(c=="rtl"){if(e){b.dropdownlistArrow.css("float","left");b.dropdownlistContent.css("float","right")}else{b.dropdownlistArrow.css("float","right");b.dropdownlistContent.css("float","left")}b.listBoxContainer.jqxListBox({rtl:b.rtl})}if(c=="source"){b.listBoxContainer.jqxListBox({source:b.source});b.listBox.selectedIndex=-1;b.listBox.selectIndex(this.selectedIndex);b.renderSelection();if(e==null){b.clear()}}if(c=="displayMember"||c=="valueMember"){b.listBoxContainer.jqxListBox({displayMember:b.displayMember,valueMember:b.valueMember});b.renderSelection()}if(c=="placeHolder"){b.renderSelection()}if(c=="theme"&&e!=null){b.listBoxContainer.jqxListBox({theme:e});b.listBoxContainer.addClass(b.toThemeProperty("jqx-popup"));a.jqx.utilities.setTheme(f,e,b.host)}if(c=="autoDropDownHeight"){b.listBoxContainer.jqxListBox({autoHeight:b.autoDropDownHeight});if(b.autoDropDownHeight){b.container.height(b.listBoxContainer.height()+25)}else{b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}b.listBox._arrange();b.listBox._updatescrollbars()}if(c=="searchMode"){b.listBoxContainer.jqxListBox({searchMode:b.searchMode})}if(c=="incrementalSearch"){b.listBoxContainer.jqxListBox({incrementalSearch:b.incrementalSearch})}if(c=="incrementalSearchDelay"){b.listBoxContainer.jqxListBox({incrementalSearchDelay:b.incrementalSearchDelay})}if(c=="dropDownHeight"){if(!b.autoDropDownHeight){b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}}if(c=="dropDownWidth"||c=="scrollBarSize"){var d=b.width;if(b.dropDownWidth!="auto"){d=b.dropDownWidth}b.listBoxContainer.jqxListBox({width:d,scrollBarSize:b.scrollBarSize});b.container.width(parseInt(d)+25)}if(c=="width"||c=="height"){if(e!=f){this.refresh();if(c=="width"){if(b.dropDownWidth=="auto"){var d=b.host.width();b.listBoxContainer.jqxListBox({width:d});b.container.width(parseInt(d)+25)}}}}if(c=="checkboxes"){b.listBoxContainer.jqxListBox({checkboxes:b.checkboxes})}if(c=="selectedIndex"){if(b.listBox!=null){b.listBox.selectIndex(parseInt(e));b.renderSelection()}}}})})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxgrid.columnsresize.js b/static/js/jqxgrid.columnsresize.js
new file mode 100644
index 0000000..0c9f3ac
--- /dev/null
+++ b/static/js/jqxgrid.columnsresize.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.extend(a.jqx._jqxGrid.prototype,{autoresizecolumns:function(z,g){if(z!="cells"&&z!="all"&&z!="column"){z="all"}var A=this.that;var n=this.getrows();if(this.pageable){n=this.dataview.rows;if(this.groupable){n=this.dataview.records}}if(g==undefined){g=0}else{g=parseInt(g)}var e=n.length;if(e==undefined&&n!=undefined){var t=new Array();a.each(n,function(i){t.push(this)});n=t;e=n.length}var w=a("");w.addClass(this.toThemeProperty("jqx-widget"));w.addClass(this.toThemeProperty("jqx-grid-cell"));a(document.body).append(w);var c=[];var f=[];var b=[];var q=[];var o=A.host.width();if(A.vScrollBar[0].style.visibility!="hidden"){o-=this.scrollbarsize+5}if(o<0){o=0}for(var x=0;x0&&v<=this.groups.length-1){continue}if(f[d.displayfield]==undefined){f[d.displayfield]=0}if(b[d.displayfield]==undefined){b[d.displayfield]=""}var r=k[d.displayfield];if(d.cellsformat!=""){if(a.jqx.dataFormat){if(a.jqx.dataFormat.isDate(r)){r=a.jqx.dataFormat.formatdate(r,d.cellsformat,this.gridlocalization)}else{if(a.jqx.dataFormat.isNumber(r)){r=a.jqx.dataFormat.formatnumber(r,d.cellsformat,this.gridlocalization)}}}}else{if(d.cellsrenderer){var s=A._defaultcellsrenderer(r,d);var p=d.cellsrenderer(x,d.datafield,r,s,d.getcolumnproperties(),k);if(p!=undefined){r=a(p).text()}}}if(z==undefined||z=="cells"||z=="all"){if(r!=null){var c=r.toString().length;var u=r.toString();var B=u.replace(/[^A-Z]/g,"").length;if(c>f[d.displayfield]){f[d.displayfield]=c;b[d.displayfield]=r;q[d.displayfield]=B}if(c>0&&c>=B){var m=B*20+(c-B)*15;var l=q[d.displayfield]*20+(f[d.displayfield]-q[d.displayfield])*15;if(m>l&&m>0&&l>0){f[d.displayfield]=c;b[d.displayfield]=r;q[d.displayfield]=B}}}}if(z=="column"||z=="all"){if(d.text.toString().length>f[d.displayfield]){b[d.displayfield]=d.text;f[d.displayfield]=d.text.length;var u=d.text.toString();var B=u.replace(/[^A-Z]/g,"").length;q[d.displayfield]=B}var r=d.text;var c=r.toString().length;var u=r.toString();var B=u.replace(/[^A-Z]/g,"").length;if(c>0&&c>=B){var m=B*20+(c-B)*15;var l=q[d.displayfield]*20+(f[d.displayfield]-q[d.displayfield])*15;if(m>l&&m>0&&l>0){f[d.displayfield]=c;b[d.displayfield]=r;q[d.displayfield]=B}}}}}if(!this.columns.records){return}for(var v=0;v=0){w.removeClass(this.toThemeProperty("jqx-grid-column-header"))}if(b[d.displayfield]==d.text){w.addClass(this.toThemeProperty("jqx-grid-column-header"))}w[0].innerHTML=b[d.displayfield].toString();var y=w.outerWidth()+10;if(w.children().length>0){y=w.children().outerWidth()+10}if(a.jqx.browser.msie&&a.jqx.browser.version<8){y+=10}if(this.filterable&&this.showfilterrow){y+=5}y+=g;if(y>d.maxwidth){y=d.maxwidth}if(d._width!=undefined){d.__width=d._width}d._width=null;if(d.maxwidth=="auto"||y<=d.maxwidth){var h=d.width;if(y");s.addClass(this.toThemeProperty("jqx-widget"));s.addClass(this.toThemeProperty("jqx-grid-cell"));a(document.body).append(s);var f=0;var b="";var o=0;var w=this.that;var m=w.host.width();if(w.vScrollBar[0].style.visibility!="hidden"){m-=this.scrollbarsize+5}if(m<0){m=0}if(v==undefined||v=="cells"||v=="all"){for(var t=0;tf){f=c;b=q;o=x}if(c>0&&c>=x){var k=x*20+(c-x)*15;var j=o*20+(f-o)*15;if(k>j&&k>0&&j>0){f=c;b=q;o=x}}}}}if(v=="column"||v=="all"){if(d.text.toString().length>f){b=d.text}var q=d.text.toString();var c=q.toString().length;var r=q.toString();var x=r.replace(/[^A-Z]/g,"").length;if(c>0&&c>=x){var k=x*20+(c-x)*15;var j=o*20+(f-o)*15;if(k>j&&k>0&&j>0){f=c;b=q;o=x}}}if(b==undefined){b=d.text}s[0].innerHTML=b;if(b==d.text){s.addClass(this.toThemeProperty("jqx-grid-column-header"))}var u=s.outerWidth()+10;if(a.jqx.browser.msie&&a.jqx.browser.version<8){u+=5}if(this.filterable&&this.showfilterrow){u+=5}u+=g;s.remove();if(u>d.maxwidth){u=d.maxwidth}if(d.maxwidth=="auto"||u<=d.maxwidth){var h=d.width;if(u0?v+l:0;var o=l==0?true:j._startcolumnwidth+q-v=p.left&&q>=k){if(u!=0&&m.pageX=p.left&&q<=p.left+j.host.width()){j.resizeline.css("left",q);if(i){return false}}}}}}if(!i&&j.resizablecolumn!=null){return false}});this.removeHandler(a(document),c);this.addHandler(a(document),c,function(p){var o=a.data(document.body,"contextmenu"+j.element.id);if(o!=null&&j.autoshowcolumnsmenubutton){return true}if(j.resizablecolumn!=null&&!j.disabled){var k=j.resizablecolumn.columnelement;if(k.coord().top+k.height()+5p.pageY){j.resizablecolumn=null;return}j._startcolumnwidth=j.resizablecolumn.column.width;j.resizablecolumn.column._width=null;a(document.body).addClass("jqx-disableselect");a(document.body).addClass("jqx-position-reset");j.host.addClass("jqx-disableselect");j.content.addClass("jqx-disableselect");j._mouseDownResize=new Date();j.resizing=true;if(j._lastmouseDownResize&&j.columnsautoresize){if(j._lastmouseDownResize-j._mouseDownResize<300&&j._lastmouseDownResize-j._mouseDownResize>-500){var n=j.resizablecolumn.column;if(n.resizable){var m=j.resizablecolumn.column.width;var l=j.hScrollBar[0].style.visibility;j._resizecolumn=null;j.resizeline.hide();j.resizestartline.hide();j.resizebackground.remove();j.resizablecolumn=null;j.autoresizecolumn(n.displayfield,"all");if(l!=j.hScrollBar[0].style.visibility){j.hScrollInstance.setPosition(0)}if(j.rtl){j._arrange()}if(j.autosavestate){if(j.savestate){j.savestate()}}p.stopPropagation();j.suspendClick=true;setTimeout(function(){j.suspendClick=false},100);return false}}}j._lastmouseDownResize=new Date();j._resizecolumn=j.resizablecolumn.column;j.resizeline=j.resizeline||a('');j.resizestartline=j.resizestartline||a('');j.resizebackground=j.resizebackground||a('');j.resizebackground.css("opacity",0.01);j.resizebackground.css("cursor","col-resize");j.resizeline.css("cursor","col-resize");j.resizestartline.css("cursor","col-resize");j.resizeline.addClass(j.toThemeProperty("jqx-grid-column-resizeline"));j.resizestartline.addClass(j.toThemeProperty("jqx-grid-column-resizestartline"));a(document.body).append(j.resizeline);a(document.body).append(j.resizestartline);a(document.body).append(j.resizebackground);var q=j.resizablecolumn.columnelement.coord();j.resizebackground.css("left",j.host.coord().left);j.resizebackground.css("top",j.host.coord().top);j.resizebackground.width(j.host.width());j.resizebackground.height(j.host.height());j.resizebackground.css("z-index",9999);var r=function(t){if(!j.rtl){t.css("left",parseInt(q.left)+j._startcolumnwidth)}else{t.css("left",parseInt(q.left))}var w=j._groupsheader();var v=w?j.groupsheader.height():0;var y=j.showtoolbar?j.toolbarheight:0;v+=y;var s=j.showstatusbar?j.statusbarheight:0;v+=s;var u=0;if(j.pageable){u=j.pagerheight}var x=j.hScrollBar.css("visibility")=="visible"?17:0;t.css("top",parseInt(q.top));t.css("z-index",99999);if(j.columngroups){t.height(j.host.height()+j.resizablecolumn.columnelement.height()-u-v-x-j.columngroupslevel*j.columnsheight)}else{t.height(j.host.height()-u-v-x)}if(j.enableanimations){t.show("fast")}else{t.show()}};r(j.resizeline);r(j.resizestartline);j.dragmousedown=null}});var e=function(){a(document.body).removeClass("jqx-disableselect");a(document.body).removeClass("jqx-position-reset");if(j.showfilterrow||j.showstatusbar||j.showtoolbar||j.enablebrowserselection){j.host.removeClass("jqx-disableselect");j.content.removeClass("jqx-disableselect")}if(!j.resizing){return}j._mouseUpResize=new Date();var r=j._mouseUpResize-j._mouseDownResize;if(r<200){j.resizing=false;if(j._resizecolumn!=null&&j.resizeline!=null&&j.resizeline.css("display")=="block"){j._resizecolumn=null;j.resizeline.hide();j.resizestartline.hide();j.resizebackground.remove()}return}j.resizing=false;if(j.disabled){return}var p=j.host.width();if(j.vScrollBar[0].style.visibility!="hidden"){p-=20}if(p<0){p=0}if(j._resizecolumn!=null&&j.resizeline!=null&&j.resizeline.css("display")=="block"){var s=parseInt(j.resizeline.css("left"));var o=parseInt(j.resizestartline.css("left"));var l=j._startcolumnwidth+s-o;if(j.rtl){var l=j._startcolumnwidth-s+o}var q=j._resizecolumn.width;j._closemenu();if(l=m&&m>=g){d=u;break}}if(h!=null){var c=this._getcolumnat(d);if(!(q.indexOf("jqx-grid-group-expand")!=-1||q.indexOf("jqx-grid-group-collapse")!=-1)){if(h.boundindex!=-1){n.begincelledit(n.getboundindex(h),c.datafield,c.defaulteditorvalue)}}}},_getpreveditablecolumn:function(c){var b=this;while(c>0){c--;var d=b.getcolumnat(c);if(!d){return null}if(!d.editable){continue}if(!d.hidden){return d}}return null},_getnexteditablecolumn:function(c){var b=this;while(c=33&&J<=40&&y.selectionmode=="multiplecellsadvanced"){var i=this.editcell.columntype=="textbox"||this.editcell.columntype==null?this.editcell.editor:this.editcell.editor.find("input");var K=y._selection(i);var z=i.val().length;if(K.length>0&&this.editcell.columntype!="datetimeinput"){y._cancelkeydown=true}if(K.start>0&&J==37){y._cancelkeydown=true}if(K.start=this.pagesize){this.clearselection(false);var G=this.dataview.loadedrecords[x];this.selectcell(this.getboundindex(G),c.datafield)}}}}}}}}}}return false}else{if(J==27){this.endcelledit(this.editcell.row,this.editcell.column,true,true);return false}}}}else{var A=false;if(J==113){A=true}if(!E.ctrlKey&&!E.altKey&&!E.metaKey){if(J>=48&&J<=57){this.editchar=String.fromCharCode(J);A=true}if(J>=65&&J<=90){this.editchar=String.fromCharCode(J);var t=false;if(E.shiftKey){t=E.shiftKey}else{if(E.modifiers){t=!!(E.modifiers&4)}}if(!t){this.editchar=this.editchar.toLowerCase()}A=true}else{if(J>=96&&J<=105){this.editchar=J-96;this.editchar=this.editchar.toString();A=true}}var s=a(".jqx-grid").length;A=A&&(s==1||(s>1&&y.focused));var l=a.data(document.body,"jqxgrid.edit");if(l!==undefined&&l!==""){if(J===13||A){if(l!=y.element.id){return true}}}}if(J==13||A){if(y.getselectedrowindex){var h=y.getselectedrowindex();switch(y.selectionmode){case"singlerow":case"multiplerows":case"multiplerowsextended":if(h>=0){var w="";for(var C=0;C0){for(var r=0;r=0){return}if(this.groups.indexOf(f.displayfield)>=0){return}}if(this.editrow!=undefined){return}if(this.editcell){if(this.editcell.row==n&&this.editcell.column==e){return true}if(this.editmode==="selectedrow"){if(this.editcell.row==n){return}}var d=this.endcelledit(this.editcell.row,this.editcell.column,false,true,false);if(false==d){return}}var i=f.columntype=="checkbox"||f.columntype=="button";this.host.removeClass("jqx-disableselect");this.content.removeClass("jqx-disableselect");if(f.editable){if(f.cellbeginedit){var k=this.getcell(n,e);var m=f.cellbeginedit(n,e,f.columntype,k!=null?k.value:null);if(m==false){return}}var j=this.getrowvisibleindex(n);this.editcell=this.getcell(n,e);if(this.editcell){this.editcell.visiblerowindex=j;if(!this.editcell.editing){if(!i){this.editcell.editing=true}this.editcell.columntype=f.columntype;this.editcell.defaultvalue=l;if(f.defaultvalue!=undefined){this.editcell.defaultvalue=f.defaultvalue}this.editcell.init=true;if(f.columntype!="checkbox"&&this.editmode!="selectedrow"){var h=this.getrowdata(n);this._raiseEvent(17,{rowindex:n,row:h,datafield:f.datafield,value:this.editcell.value,columntype:f.columntype})}a.data(document.body,"jqxgrid.edit",this.element.id);if(!i){var b=this.getrowvisibleindex(n);if(g!==false){this.ensurecellvisible(b,f.datafield)}if(c!==false){this._renderrows(this.virtualsizeinfo)}}if(this.editcell){this.editcell.init=false;return true}}}}else{if(!this.editcell){return}this.editcell.editor=null;this.editcell.editing=false;if(c!==false){this._renderrows(this.virtualsizeinfo)}this.editcell=null}},getScrollTop:function(){if(this._py){return pageYOffset}this._py=typeof pageYOffset!="undefined";if(this._py){return pageYOffset}else{var c=document.body;var b=document.documentElement;b=(b.clientHeight)?b:c;return b.scrollTop}},getScrollLeft:function(){if(typeof pageXOffset!="undefined"){return pageXOffset}else{var c=document.body;var b=document.documentElement;b=(b.clientHeight)?b:c;return b.scrollLeft}},endcelledit:function(h,n,j,e,o){if(h==undefined||n==undefined){if(this.editcell){h=this.editcell.row;n=this.editcell.column}if(j==undefined){j=true}}if(!this.editcell){return}var d=this.getcolumn(n);var u=this;if(u.editmode==="selectedrow"){this.endrowedit(h,j);return}var t=function(){if(o!=false){if(u.isTouchDevice()){return}if(!u.isNestedGrid){var v=u.getScrollTop();var x=u.getScrollLeft();try{u.element.focus();u.content.focus();if(v!=u.getScrollTop()){window.scrollTo(x,v)}setTimeout(function(){u.element.focus();u.content.focus();if(v!=u.getScrollTop()){window.scrollTo(x,v)}},10)}catch(w){}}}};if(d.columntype=="checkbox"||d.columntype=="button"){if(this.editcell){this.editcell.editor=null;this.editcell.editing=false;this.editcell=null}return true}var i=this._geteditorvalue(d);var g=function(w){w._hidecelleditor();if(d.cellendedit){d.cellendedit(h,n,d.columntype,w.editcell.value,i)}w.editchar=null;if(d.displayfield!=d.datafield){var v=w.getcellvalue(w.editcell.row,d.displayfield);var x=w.editcell.value;oldvalue={value:x,label:v}}else{oldvalue=w.editcell.value}var y=w.getrowdata(h);w._raiseEvent(18,{rowindex:h,row:y,datafield:n,displayfield:d.displayfield,oldvalue:i,value:i,columntype:d.columntype});w.editcell.editor=null;w.editcell.editing=false;w.editcell=null;if(e||e==undefined){w._renderrows(w.virtualsizeinfo)}t();if(!w.enablebrowserselection){w.host.addClass("jqx-disableselect");w.content.addClass("jqx-disableselect")}};if(j){g(this);return false}if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}if(d.cellvaluechanging){var b=d.cellvaluechanging(h,n,d.columntype,this.editcell.value,i);if(b!=undefined){i=b}}if(d.validation){var c=this.getcell(h,n);try{var p=d.validation(c,i);var l=this.gridlocalization.validationstring;if(p.message!=undefined){l=p.message}var m=typeof p=="boolean"?p:p.result;if(!m){if(p.showmessage==undefined||p.showmessage==true){this._showvalidationpopup(h,n,l)}this.editcell.validated=false;return false}}catch(r){this._showvalidationpopup(h,n,this.gridlocalization.validationstring);this.editcell.validated=false;return false}}if(d.displayfield!=d.datafield){var k=this.getcellvalue(this.editcell.row,d.displayfield);var q=this.editcell.value;oldvalue={value:q,label:k}}else{oldvalue=this.editcell.value}var f=this.getrowdata(h);if(d.cellendedit){var s=d.cellendedit(h,n,d.columntype,this.editcell.value,i);if(s==false){this._raiseEvent(18,{rowindex:h,row:f,datafield:n,displayfield:d.displayfield,oldvalue:oldvalue,value:oldvalue,columntype:d.columntype});g(this);return false}}this._raiseEvent(18,{rowindex:h,row:f,datafield:n,displayfield:d.displayfield,oldvalue:oldvalue,value:i,columntype:d.columntype});this._hidecelleditor(false);if(this.editcell!=undefined){this.editcell.editor=null;this.editcell.editing=false}this.editcell=null;this.editchar=null;this.setcellvalue(h,n,i,e);if(!this.enablebrowserselection){this.host.addClass("jqx-disableselect");this.content.addClass("jqx-disableselect")}if(!a.jqx.browser.msie){t()}a.data(document.body,"jqxgrid.edit","");return true},beginrowedit:function(e){var d=this;var f=-1;d._oldselectedrow=e;this._cellscache=new Array();var c=false;if(this.editmode!="selectedrow"){c=true}if(c){var b=this.editmode;this.editmode="selectedrow"}a.each(this.columns.records,function(h,j){if(d.editable&&this.editable){var g=d.getcell(e,this.datafield);d.begincelledit(e,this.datafield,null,false,false);var i=d.getrowdata(e);d._raiseEvent(17,{rowindex:e,row:i,datafield:this.datafield,value:g.value,columntype:this.columntype})}});if(d.editcell){d.editcell.init=true}this._renderrows(this.virtualsizeinfo);if(c){this.editmode=b}},endrowedit:function(k,o){var D=this;if(!this.editcell){return false}if(this.editcell.editor==undefined){return false}var C=function(){if(focus!=false){if(D.isTouchDevice()){return}if(!D.isNestedGrid){var i=D.getScrollTop();var F=D.getScrollLeft();try{D.element.focus();D.content.focus();if(i!=D.getScrollTop()){window.scrollTo(F,i)}setTimeout(function(){D.element.focus();D.content.focus();if(i!=D.getScrollTop()){window.scrollTo(F,i)}},10)}catch(E){}}}};var p=false;if(this.editmode!="selectedrow"){p=true}if(p){var v=this.editmode;this.editmode="selectedrow"}var h=false;var d={};if(this.validationpopup){this.validationpopup.hide();this.validationpopuparrow.hide()}for(var B=0;B "):k;d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(k==undefined){d.prependTo(this.table);d[0].id="dropdownlisteditor"+this.element.id+D;var f=this.source._source?true:false;var x=null;if(!f){x=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[A],async:false,autoSort:true,autoSortField:A})}else{var p={localdata:this.source.records,datatype:this.source.datatype,async:false};x=new a.jqx.dataAdapter(p,{autoBind:false,async:false,uniqueDataFields:[A],autoSort:true,autoSortField:A})}var u=!G.createeditor?true:false;d.jqxDropDownList({enableBrowserBoundsDetection:true,keyboardSelection:false,source:x,rtl:this.rtl,autoDropDownHeight:u,theme:this.theme,width:g.width()-2,height:g.height()-2,displayMember:A,valueMember:E});this.editors["dropdownlist_"+D]=d;if(G.createeditor){G.createeditor(q,I,d)}}if(G._requirewidthupdate){d.jqxDropDownList({width:g.width()-2})}var c=d.jqxDropDownList("listBox").visibleItems;if(!G.createeditor){if(c.length<8){d.jqxDropDownList("autoDropDownHeight",true)}else{d.jqxDropDownList("autoDropDownHeight",false)}}var I=this.getcellvalue(q,A);var z=this.findRecordIndex(I,A,c);if(K){if(I!=""){d.jqxDropDownList("selectIndex",z,true)}else{d.jqxDropDownList("selectIndex",-1)}}if(!this.editcell){return}if(this.editcell.defaultvalue!=undefined){d.jqxDropDownList("selectIndex",this.editcell.defaultvalue,true)}if(w){d.jqxDropDownList("focus")}}break;case"combobox":if(this.host.jqxComboBox){n.innerHTML="";var D=a.trim(G.datafield).split(" ").join("");var A=a.trim(G.displayfield).split(" ").join("");if(D.indexOf(".")!=-1){D=D.replace(".","")}if(A.indexOf(".")!=-1){A=A.replace(".","")}var r=this.editors["combobox_"+D];d=r==undefined?a(""):r;d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(r==undefined){d.prependTo(this.table);d[0].id="comboboxeditor"+this.element.id+D;var f=this.source._source?true:false;var x=null;if(!f){x=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[A],async:false,autoSort:true,autoSortField:A})}else{var p={localdata:this.source.records,datatype:this.source.datatype,async:false};x=new a.jqx.dataAdapter(p,{autoBind:false,async:false,uniqueDataFields:[A],autoSort:true,autoSortField:A})}var u=!G.createeditor?true:false;d.jqxComboBox({enableBrowserBoundsDetection:true,keyboardSelection:false,source:x,rtl:this.rtl,autoDropDownHeight:u,theme:this.theme,width:g.width()-2,height:g.height()-2,displayMember:A,valueMember:E});d.removeAttr("tabindex");d.find("div").removeAttr("tabindex");this.editors["combobox_"+D]=d;if(G.createeditor){G.createeditor(q,I,d)}}if(G._requirewidthupdate){d.jqxComboBox({width:g.width()-2})}var c=d.jqxComboBox("listBox").visibleItems;if(!G.createeditor){if(c.length<8){d.jqxComboBox("autoDropDownHeight",true)}else{d.jqxComboBox("autoDropDownHeight",false)}}var I=this.getcellvalue(q,A);var z=this.findRecordIndex(I,A,c);if(K){if(I!=""){d.jqxComboBox("selectIndex",z,true);d.jqxComboBox("val",I)}else{d.jqxComboBox("selectIndex",-1);d.jqxComboBox("val",I)}}if(!this.editcell){return}if(this.editcell.defaultvalue!=undefined){d.jqxComboBox("selectIndex",this.editcell.defaultvalue,true)}if(this.editchar&&this.editchar.length>0){d.jqxComboBox("input").val(this.editchar)}if(w){setTimeout(function(){l(d.jqxComboBox("input"));if(d){d.jqxComboBox("_setSelection",0,0);if(s.editchar){d.jqxComboBox("_setSelection",1,1);s.editchar=null}else{if(d.jqxComboBox("input")){var P=d.jqxComboBox("input").val();d.jqxComboBox("_setSelection",0,P.length)}}}},10)}}break;case"datetimeinput":if(this.host.jqxDateTimeInput){n.innerHTML="";var D=a.trim(G.datafield).split(" ").join("");if(D.indexOf(".")!=-1){D=D.replace(".","")}var v=this.editors["datetimeinput_"+D];d=v==undefined?a(""):v;d.show();d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(v==undefined){d.prependTo(this.table);d[0].id="datetimeeditor"+this.element.id+D;var F={calendar:this.gridlocalization};d.jqxDateTimeInput({enableBrowserBoundsDetection:true,localization:F,_editor:true,theme:this.theme,rtl:this.rtl,width:g.width(),height:g.height(),formatString:G.cellsformat});this.editors["datetimeinput_"+D]=d;if(G.createeditor){G.createeditor(q,I,d)}}if(G._requirewidthupdate){d.jqxDateTimeInput({width:g.width()-2})}if(K){if(I!=""&&I!=null){var L=new Date(I);if(L=="Invalid Date"){if(this.source.getvaluebytype){L=this.source.getvaluebytype(I,{name:G.datafield,type:"date"})}}d.jqxDateTimeInput("setDate",L)}else{d.jqxDateTimeInput("setDate",null)}if(this.editcell.defaultvalue!=undefined){d.jqxDateTimeInput("setDate",this.editcell.defaultvalue)}}if(w){setTimeout(function(){l(d.jqxDateTimeInput("dateTimeInput"))},10)}}break;case"numberinput":if(this.host.jqxNumberInput){n.innerHTML="";var D=a.trim(G.datafield).split(" ").join("");if(D.indexOf(".")!=-1){D=D.replace(".","")}var N=this.editors["numberinput_"+D];d=N==undefined?a(""):N;d.show();d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(N==undefined){d.prependTo(this.table);d[0].id="numbereditor"+this.element.id+D;var m="";var y="left";var M=2;if(G.cellsformat){if(G.cellsformat.indexOf("c")!=-1){m=this.gridlocalization.currencysymbol;y=this.gridlocalization.currencysymbolposition;if(y=="before"){y="left"}else{y="right"}if(G.cellsformat.length>1){M=parseInt(G.cellsformat.substring(1),10)}}else{if(G.cellsformat.indexOf("p")!=-1){m=this.gridlocalization.percentsymbol;y="right";if(G.cellsformat.length>1){M=parseInt(G.cellsformat.substring(1),10)}}}}else{M=0}d.jqxNumberInput({decimalSeparator:this.gridlocalization.decimalseparator,decimalDigits:M,inputMode:"simple",theme:this.theme,rtl:this.rtl,width:g.width()-1,height:g.height()-1,spinButtons:true,symbol:m,symbolPosition:y});this.editors["numberinput_"+D]=d;if(G.createeditor){G.createeditor(q,I,d)}}if(G._requirewidthupdate){d.jqxNumberInput({width:g.width()-2})}if(K){if(I!=""&&I!=null){var O=I;d.jqxNumberInput("setDecimal",O)}else{d.jqxNumberInput("setDecimal",0)}if(this.editcell.defaultvalue!=undefined){d.jqxNumberInput("setDecimal",this.editcell.defaultvalue)}if(this.editchar&&this.editchar.length>0){var o=parseInt(this.editchar);if(!isNaN(o)){d.jqxNumberInput("setDecimal",o)}}if(w){setTimeout(function(){l(d.jqxNumberInput("numberInput"));d.jqxNumberInput("_setSelectionStart",0);if(s.editchar){if(G.cellsformat.length>0){d.jqxNumberInput("_setSelectionStart",2)}else{d.jqxNumberInput("_setSelectionStart",1)}s.editchar=null}else{var P=d.jqxNumberInput("spinButtons");if(P){var Q=d.jqxNumberInput("numberInput").val();s._setSelection(d.jqxNumberInput("numberInput")[0],Q.length,Q.length)}else{var Q=d.jqxNumberInput("numberInput").val();s._setSelection(d.jqxNumberInput("numberInput")[0],0,Q.length)}}d.jqxNumberInput("selectAll")},10)}}}break;case"custom":n.innerHTML="";var D=a.trim(G.datafield).split(" ").join("");if(D.indexOf(".")!=-1){D=D.replace(".","")}var B=this.editors["customeditor_"+D+"_"+q];d=B==undefined?a(""):B;d.show();d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(B==undefined){d.prependTo(this.table);d[0].id="customeditor"+this.element.id+D+"_"+q;this.editors["customeditor_"+D+"_"+q]=d;var b=g.width()-1;var e=g.height()-1;d.width(b);d.height(e);if(G.createeditor){G.createeditor(q,I,d,C,b,e,this.editchar)}}if(G._requirewidthupdate){d.width(g.width()-2)}break;case"template":n.innerHTML="";var D=a.trim(G.datafield).split(" ").join("");if(D.indexOf(".")!=-1){D=D.replace(".","")}var h=this.editors["templateeditor_"+D];d=h==undefined?a(""):h;d.show();d.css("top",a(n).parent().position().top);if(this.oldhscroll){d.css("left",-i+parseInt(a(n).position().left))}else{d.css("left",parseInt(a(n).position().left))}if(G.pinned){d.css("left",i+parseInt(a(n).position().left))}if(h==undefined){d.prependTo(this.table);d[0].id="templateeditor"+this.element.id+D;this.editors["templateeditor_"+D]=d;var b=g.width()-1;var e=g.height()-1;d.width(b);d.height(e);if(G.createeditor){G.createeditor(q,I,d,C,b,e,this.editchar)}}if(G._requirewidthupdate){d.width(g.width()-2)}break;case"textbox":default:n.innerHTML="";d=this.editors["textboxeditor_"+G.datafield]||a("");d[0].id="textboxeditor"+this.element.id+G.datafield;d.appendTo(g);if(this.rtl){d.css("direction","rtl")}if(K||d[0].className==""){d.addClass(this.toThemeProperty("jqx-input"));d.addClass(this.toThemeProperty("jqx-widget-content"));if(this.editchar&&this.editchar.length>0){d.val(this.editchar)}else{if(G.cellsformat!=""){I=this.getcelltext(q,E)}if(I==undefined){I=""}d.val(I)}if(this.editcell.defaultvalue!=undefined){d.val(this.editcell.defaultvalue)}d.width(g.width()+1);d.height(g.height()+1);if(G.createeditor){G.createeditor(q,I,d)}if(G.cellsformat!=""){if(G.cellsformat.indexOf("p")!=-1||G.cellsformat.indexOf("c")!=-1||G.cellsformat.indexOf("n")!=-1||G.cellsformat.indexOf("f")!=-1){if(!this.editors["textboxeditor_"+G.datafield]){d.keydown(function(Q){var W=Q.charCode?Q.charCode:Q.keyCode?Q.keyCode:0;var T=String.fromCharCode(W);var U=parseInt(T);if(isNaN(U)){return true}if(s._selection(d).length>0){return true}var S="";var R=d.val();if(G.cellsformat.length>1){var V=parseInt(G.cellsformat.substring(1));if(isNaN(V)){V=0}}else{var V=0}if(V>0){if(R.indexOf(s.gridlocalization.decimalseparator)!=-1){if(s._selection(d).start>R.indexOf(s.gridlocalization.decimalseparator)){return true}}}for(var X=0;X=11){return false}})}}}}this.editors["textboxeditor_"+G.datafield]=d;if(K){if(w){setTimeout(function(){l(d);if(s.editchar){s._setSelection(d[0],1,1);s.editchar=null}else{s._setSelection(d[0],0,d.val().length)}},25)}}break}if(d){d[0].style.zIndex=1+n.style.zIndex;if(a.jqx.browser.msie&&a.jqx.browser.version<8){d[0].style.zIndex=1+this.columns.records.length+n.style.zIndex}d.css("display","block");this.editcell.editor=d;if(!this.editcell[E]){this.editcell[E]={};this.editcell[E].editor=d}else{this.editcell[E].editor=d}}if(K){if(G.initeditor){G.initeditor(q,I,d,C,this.editchar)}}if(s.isTouchDevice()){return}setTimeout(function(){if(s.content){s.content[0].scrollTop=0;s.content[0].scrollLeft=0}if(s.gridcontent){s.gridcontent[0].scrollLeft=0;s.gridcontent[0].scrollTop=0}},10)},_setSelection:function(d,g,b){try{if("selectionStart" in d){d.setSelectionRange(g,b)}else{var c=d.createTextRange();c.collapse(true);c.moveEnd("character",b);c.moveStart("character",g);c.select()}}catch(e){var f=e}},_hideeditors:function(){if(this.editcells!=null){var b=this;for(var c in this.editcells){b.editcell=b.editcells[c];b._hidecelleditor()}}},_hidecelleditor:function(b){if(!this.editcell){return}if(this.editmode==="selectedrow"){for(var c=0;c-1){o=o.replace(this.gridlocalization.currencysymbol,"")}var m=function(w,u,v){var s=w;if(u==v){return w}var t=s.indexOf(u);while(t!=-1){s=s.replace(u,v);t=s.indexOf(u)}return s};var k=o;k=new Number(k);if(!isNaN(k)){return k}o=m(o,this.gridlocalization.thousandsseparator,"");o=o.replace(this.gridlocalization.decimalseparator,".");if(o.indexOf(this.gridlocalization.percentsymbol)>-1){o=o.replace(this.gridlocalization.percentsymbol,"")}var d="";for(var r=0;r");var r=a("");g.html(h);r.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));g.addClass(this.toThemeProperty("jqx-grid-validation"));g.addClass(this.toThemeProperty("jqx-rc-all"));g.prependTo(this.table);r.prependTo(this.table);var l=this.hScrollInstance;var n=l.value;var d=parseInt(n);var b=this.getcolumn(j).uielement;var p=null;for(var o=0;o=this._gettableheight()){r.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));r.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));k=parseInt(c.position().top)-this.rowsheight-5;if(k<0){k=0;this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));q=true}g.css("top",k+"px");r.css("top",k+g.outerHeight()-9)}var t=-d+parseInt(a(b).position().left);r.css("left",d+t+30);var m=g.width();if(m+t>this.host.width()-20){var e=m+t-this.host.width()+40;t-=e}if(!q){g.css("left",d+t)}else{g.css("left",d+parseInt(a(b).position().left)-g.outerWidth())}g.show();r.show();if(!this.popups){this.popups=new Array()}this.popups[this.popups.length]={validation:g,validationrow:r}},_showvalidationpopup:function(p,e,q){var c=this.editcell;var k=this.editcell.editor;if(this.editmode=="selectedrow"){var c=this.editcell[e];if(c&&c.editor){k=c.editor;c.element=k}}if(!k){return}if(this.validationpopup&&a.jqx.isHidden(this.validationpopup)){if(this.validationpopup.remove){this.validationpopup.remove();this.validationpopuparrow.remove()}this.validationpopup=null;this.validationpopuparrow=null;if(e===undefined&&q===undefined&&this.editors&&this.editors.length===0){return}}if(!this.validationpopup){var n=a("");var m=a("");n.html(q);m.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));n.addClass(this.toThemeProperty("jqx-grid-validation"));n.addClass(this.toThemeProperty("jqx-rc-all"));n.prependTo(this.table);m.prependTo(this.table);this.validationpopup=n;this.validationpopuparrow=m}else{this.validationpopup.html(q)}var h=this.hScrollInstance;var j=h.value;var g=parseInt(j);if(this.editmode=="selectedrow"){if(this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]){this.validationpopup.css("top",this.visiblerows[this.editcell.visiblerowindex].top+(this.rowsheight+5)+"px")}else{this.validationpopup.css("top",parseInt(a(c.editor).position().top)+(this.rowsheight+5)+"px")}}else{this.validationpopup.css("top",parseInt(a(c.element).parent().position().top)+(this.rowsheight+5)+"px")}var b=parseInt(this.validationpopup.css("top"));this.validationpopuparrow.css("top",b-11);this.validationpopuparrow.removeClass();this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));var o=this._gettableheight();var f=false;if(b>=o){this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-up"));this.validationpopuparrow.addClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));b=parseInt(a(c.element).parent().position().top)-this.rowsheight-5;if(this.editmode=="selectedrow"){if(this.visiblerows&&this.visiblerows[this.editcell.visiblerowindex]){b=this.visiblerows[this.editcell.visiblerowindex].top-this.rowsheight-5}else{b=parseInt(a(c.editor).position().top)-this.rowsheight-5}}if(b<0){b=0;this.validationpopuparrow.removeClass(this.toThemeProperty("jqx-grid-validation-arrow-down"));f=true}this.validationpopup.css("top",b+"px");this.validationpopuparrow.css("top",b+this.validationpopup.outerHeight()-9)}var l=-g+parseInt(a(c.element).position().left);this.validationpopuparrow.css("left",g+l+30);var d=this.validationpopup.width();if(d+l>this.host.width()-20){var i=d+l-this.host.width()+40;l-=i}if(!f){this.validationpopup.css("left",g+l)}else{this.validationpopup.css("left",g+parseInt(a(c.element).position().left)-this.validationpopup.outerWidth())}if(this.editcell.editor.css("display")=="none"){this.validationpopup.hide();this.validationpopuparrow.hide()}else{this.validationpopup.show();this.validationpopuparrow.show()}}})})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxgrid.filter.js b/static/js/jqxgrid.filter.js
new file mode 100644
index 0000000..f53ab94
--- /dev/null
+++ b/static/js/jqxgrid.filter.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(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;ig.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);k[0].left=e;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]);j.width(c-10);j.attr("disabled",n.disabled)};switch(g.filtertype){case"number":case"input":a(k.children()[0]).width(c);k.find("input").width(c-30);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)},clearfilterrow:function(d){this._disablefilterrow=true;if(!this.columns.records){return}var l=this.columns.records.length;var e=0;for(var h=0;h=0){G=G.replace(D.gridlocalization.decimalseparator,".")}}}if(L!="stringfilter"){var K=0;if(G.indexOf(">")!=-1){J="greater_than";K=1}if(G.indexOf("<")!=-1){J="less_than";K=1}if(G.indexOf("=")!=-1){if(J=="greater_than"){J="greater_than_or_equal";K=2}else{if(J=="less_than"){J="less_than_or_equal";K=2}else{J="equal";K=1}}}if(K!=0){G=G.substring(K);if(G.length<1){return false}}}if(j.filtercondition!=undefined){J=j.filtercondition}if(L=="datefilter"){var H=I.createfilter(L,G,J,null,j.cellsformat,D.gridlocalization)}else{var H=I.createfilter(L,G,J)}I.addfilter(l,H)}else{i=false}}return i};switch(u.filtertype){case"range":case"date":if(u._filterwidget.jqxDateTimeInput){if(u.filtertype=="range"){var p=u._filterwidget.jqxDateTimeInput("getRange");if(p!=null&&p.from!=null&&p.to!=null){var o="GREATER_THAN_OR_EQUAL";var r=new Date(0);r.setHours(0);r.setMinutes(0);r.setFullYear(p.from.getFullYear(),p.from.getMonth(),p.from.getDate());var q=new Date(0);q.setHours(0);q.setMinutes(0);q.setFullYear(p.to.getFullYear(),p.to.getMonth(),p.to.getDate());q.setHours(p.to.getHours());q.setMinutes(p.to.getMinutes());q.setSeconds(p.to.getSeconds());var y=k.createfilter(d,r,o);k.addfilter(0,y);var c="LESS_THAN_OR_EQUAL";var x=k.createfilter(d,q,c);k.addfilter(0,x)}else{E=false}}else{var p=u._filterwidget.jqxDateTimeInput("getDate");if(p!=null){var r=new Date(0);r.setHours(0);r.setMinutes(0);r.setFullYear(p.getFullYear(),p.getMonth(),p.getDate());var y=k.createfilter(d,r,"EQUAL");k.addfilter(0,y)}else{E=false}}}else{E=B(u,d,k)}break;case"input":if(u._filterwidget){var p=u._filterwidget.find("input").val();var h=u._filterwidget.find(".filter").jqxDropDownList("selectedIndex");var w=k.getoperatorsbyfiltertype(d)[h];if(D.updatefilterconditions){var F=D.updatefilterconditions(d,k.getoperatorsbyfiltertype(d));if(F!=undefined){k.setoperatorsbyfiltertype(d,F)}var w=k.getoperatorsbyfiltertype(d)[h]}var n=w=="NULL"||w=="NOT_NULL";var s=w=="EMPTY"||w=="NOT_EMPTY";if(p!=undefined&&p.length>0||n||s){y=k.createfilter(d,p,w,null,u.cellsformat,D.gridlocalization);k.addfilter(0,y)}else{E=false}}else{E=false}break;case"number":if(u._filterwidget){var p=u._filterwidget.find("input").val();if(D.gridlocalization.decimalseparator==","){if(p.indexOf(D.gridlocalization.decimalseparator)>=0){p=p.replace(D.gridlocalization.decimalseparator,".")}}var h=u._filterwidget.find(".filter").jqxDropDownList("selectedIndex");var w=k.getoperatorsbyfiltertype(d)[h];if(D.updatefilterconditions){var F=D.updatefilterconditions(d,k.getoperatorsbyfiltertype(d));if(F!=undefined){k.setoperatorsbyfiltertype(d,F)}var w=k.getoperatorsbyfiltertype(d)[h]}var n=w=="NULL"||w=="NOT_NULL";var s=w=="EMPTY"||w=="NOT_EMPTY";if(p!=undefined&&p.length>0||n||s){y=k.createfilter(d,new Number(p),w,null,u.cellsformat,D.gridlocalization);k.addfilter(0,y)}else{E=false}}else{E=false}break;case"textbox":case"default":E=B(u,d,k);break;case"bool":case"boolean":if(u._filterwidget.jqxCheckBox){var p=u._filterwidget.jqxCheckBox("checked");if(p!=null){var o="equal";var m=k.createfilter(d,p,o);k.addfilter(l,m)}else{E=false}}else{E=B(u,d,k)}break;case"list":var g=u._filterwidget.jqxDropDownList("listBox");if(g.selectedIndex>0){var b=g.getItem(g.selectedIndex);var p=b.label;var A=b.value;var o="equal";if(p===""){o="NULL"}var m=k.createfilter(d,p,o);k.addfilter(l,m);if(A!==p){m.data=A}}else{E=false}break;case"checkedlist":if(u._filterwidget.jqxDropDownList){var g=u._filterwidget.jqxDropDownList("listBox");var C=g.getCheckedItems();if(C.length==0){for(var v=1;v');var f=0;var o=this.columns.records.length;var m=this.toThemeProperty("jqx-grid-cell");m+=" "+this.toThemeProperty("jqx-grid-cell-pinned");m+=" "+this.toThemeProperty("jqx-grid-cell-filter-row");var r=o+10;var s=new Array();var n=this.that;this.filterrow[0].cells=s;b.height(this.filterrowheight);this.filterrow.children().detach();this.filterrow.append(b);if(!this._filterrowcache){this._filterrowcache=new Array()}this._initcolumntypes();var g=false;var d=new Array();var q=document.createDocumentFragment();for(var h=0;he.maxwidth){c=e.maxwidth}var l=document.createElement("div");l.style.overflow="hidden";l.style.position="absolute";l.style.height="100%";l.className=m;l=a(l);q.appendChild(l[0]);l[0].style.left=f+"px";if(this.rtl){l.css("z-index",r++);l.css("border-left-width","1px")}else{l.css("z-index",r--)}if(c=="auto"){c=0}l[0].style.width=parseFloat(c)+"px";l[0].left=f;if(!(e.hidden&&e.hideable)){f+=c}else{l.css("display","none")}s[s.length]=l[0];var k=true;if(!this.rtl){if(this.groupable){var p=(this.showrowdetailscolumn&&this.rowdetails)?1:0;if(this.groups.length+p>h){k=false}}if(this.showrowdetailscolumn&&this.rowdetails&&h==0){k=false}}else{if(this.groupable){var p=(this.showrowdetailscolumn&&this.rowdetails)?1:0;if(this.groups.length+p+h>o-1){k=false}}if(this.showrowdetailscolumn&&this.rowdetails&&h==o-1){k=false}}if(k){if(e.filtertype=="custom"&&e.createfilterwidget){var i=function(){n._applyfilterfromfilterrow()};e.createfilterwidget(e,l,i)}else{if(e.filterable){if(this._filterrowcache[e.datafield]){g=true;l.append(this._filterrowcache[e.datafield]);e._filterwidget=this._filterrowcache[e.datafield]}else{this._addfilterwidget(e,l,c);d[e.datafield]=e._filterwidget}}}}}b[0].appendChild(q);this._filterrowcache=d;if(a.jqx.browser.msie&&a.jqx.browser.version<8){b.css("z-index",r--)}b.width(parseFloat(f)+2);this.filterrow.addClass(m);this.filterrow.css("border-top-width","1px");this.filterrow.css("border-right-width","0px");if(g){this._updatefilterrowui(true)}},_addfilterwidget:function(C,d,A){var H=this.that;var z="";var E="";for(var F=0;F');f[0].id=a.jqx.utilities.createId();f.addClass(I.toThemeProperty("jqx-widget"));f.addClass(I.toThemeProperty("jqx-input"));f.addClass(I.toThemeProperty("jqx-rc-all"));f.addClass(I.toThemeProperty("jqx-widget-content"));if(I.rtl){f.css("direction","rtl")}if(I.disabled){f.attr("disabled",true)}f.attr("disabled",false);f.appendTo(J);f.width(A-10);f.height(I.filterrowheight-10);f.css("margin","4px");if(C.createfilterwidget){C.createfilterwidget(C,J,f)}C._filterwidget=f;f.focus(function(){I.content[0].scrollLeft=0;setTimeout(function(){I.content[0].scrollLeft=0},10);I.focusedfilter=f;f.addClass(I.toThemeProperty("jqx-fill-state-focus"));return false});f.blur(function(){f.removeClass(I.toThemeProperty("jqx-fill-state-focus"))});f.keydown(function(K){if(K.keyCode=="13"){I._applyfilterfromfilterrow()}if(f[0]._writeTimer){clearTimeout(f[0]._writeTimer)}f[0]._writeTimer=setTimeout(function(){if(!I._loading){if(!I["_oldWriteText"+f[0].id]){I["_oldWriteText"+f[0].id]=""}if(I["_oldWriteText"+f[0].id]!=f.val()){I._applyfilterfromfilterrow();I["_oldWriteText"+f[0].id]=f.val()}}},C.filterdelay);I.focusedfilter=f});I.host.removeClass("jqx-disableselect");I.content.removeClass("jqx-disableselect");f.val(z)};if(C.datatype!=null){if(C.filtertype=="number"){if(C.datatype=="string"||C.datatype=="date"||C.datatype=="bool"){C.filtertype="textbox"}}if(C.filtertype=="date"){if(C.datatype=="string"||C.datatype=="number"||C.datatype=="bool"){C.filtertype="textbox"}}if(C.filtertype=="bool"){if(C.datatype=="string"||C.datatype=="number"||C.datatype=="date"){C.filtertype="textbox"}}}switch(C.filtertype){case"number":case"input":var m=a("");m.width(d.width());m.height(this.filterrowheight);d.append(m);var A=d.width()-20;var s=function(J,K,f){var I=a('');if(H.rtl){I.css("float","right");I.css("direction","rtl")}I[0].id=a.jqx.utilities.createId();I.addClass(H.toThemeProperty("jqx-widget jqx-input jqx-rc-all jqx-widget-content"));I.appendTo(J);I.width(K-10);if(H.disabled){I.attr("disabled",true)}I.attr("disabled",false);I.height(H.filterrowheight-10);I.css("margin","4px");I.css("margin-right","2px");I.focus(function(){H.focusedfilter=I;I.addClass(H.toThemeProperty("jqx-fill-state-focus"))});I.blur(function(){I.removeClass(H.toThemeProperty("jqx-fill-state-focus"))});I.keydown(function(L){if(L.keyCode=="13"){H._applyfilterfromfilterrow()}if(I[0]._writeTimer){clearTimeout(I[0]._writeTimer)}I[0]._writeTimer=setTimeout(function(){if(!H._loading){if(H["_oldWriteText"+I[0].id]!=I.val()){H._applyfilterfromfilterrow();H["_oldWriteText"+I[0].id]=I.val()}}},C.filterdelay);H.focusedfilter=I});I.val(z);return I};s(m,A);var B=H._getfiltersbytype(C.filtertype=="number"?"number":"string");var t=a("");t.css("margin-top","4px");t.appendTo(m);if(H.rtl){t.css("float","right")}var h=0;if(C.filtercondition!=null){var F=new a.jqx.filter();var r=F.getoperatorsbyfiltertype(C.filtertype=="number"?"numericfilter":"stringfilter");var e=r.indexOf(C.filtercondition.toUpperCase());if(e!=-1){h=e}}var D=170;if(C.filtertype=="input"){D=240;if(h==0){var e=B.indexOf("contains");if(e!=-1&&C.filtercondition==null){h=e}}}t.jqxDropDownList({disabled:H.disabled,touchMode:H.touchmode,rtl:H.rtl,dropDownHorizontalAlignment:"right",enableBrowserBoundsDetection:true,selectedIndex:h,width:18,height:21,dropDownHeight:150,dropDownWidth:D,source:B,theme:H.theme});t.jqxDropDownList({selectionRenderer:function(f){return""}});t.jqxDropDownList("setContent","");t.find(".jqx-dropdownlist-content").hide();if(C.createfilterwidget){C.createfilterwidget(C,d,m)}C._filterwidget=m;var j=null;this.addHandler(t,"select",function(){var f=t.jqxDropDownList("getSelectedItem").label;if(C._filterwidget.find("input").val().length>0&&!H.refreshingfilter){H._applyfilterfromfilterrow()}if(C.filtertype=="input"&&!H.refreshingfilter){H._applyfilterfromfilterrow()}else{if(C._filterwidget.find("input").val().length==0&&!H.refreshingfilter){if(j=="null"||j=="not null"||f=="null"||f=="not null"){H._applyfilterfromfilterrow()}}}j=f});break;case"textbox":case"default":default:g(this,d);break;case"none":break;case"date":case"range":if(this.host.jqxDateTimeInput){var b=a("");b.css("margin","4px");b.appendTo(d);var n={calendar:this.gridlocalization,todayString:this.gridlocalization.todaystring,clearString:this.gridlocalization.clearstring};b.jqxDateTimeInput({readonly:true,disabled:H.disabled,localization:n,rtl:H.rtl,showFooter:true,formatString:C.cellsformat,selectionMode:C.filtertype,value:null,theme:this.theme,width:A-10,height:this.filterrowheight-10});if(C.createfilterwidget){C.createfilterwidget(C,d,b)}if(z&&z.toString().length>1){b.val(z)}C._filterwidget=b;this.addHandler(b,"valueChanged",function(f){if(!H.refreshingfilter){H._applyfilterfromfilterrow();H.focusedfilter=null}})}else{g(this,d)}break;case"list":case"checkedlist":if(this.host.jqxDropDownList){var q=this._getfilterdataadapter(C);var l=false;var t=a("");t.css("margin","4px");var u=C.datafield;var v=C.filtertype=="checkedlist"?true:false;var D=A<150?220:"auto";q.dataBind();var p=q.records;var k=p.length<8?true:false;l=k;t.appendTo(d);t.jqxDropDownList({placeHolder:H.gridlocalization.filterchoosestring,disabled:H.disabled,touchMode:H.touchmode,rtl:H.rtl,checkboxes:v,dropDownWidth:D,source:q.records,autoDropDownHeight:k,theme:this.theme,width:A-10,height:this.filterrowheight-10,displayMember:C.displayfield,valueMember:u});if(C.createfilterwidget){C.createfilterwidget(C,d,t)}var c=t.jqxDropDownList("listBox");if(v){t.jqxDropDownList({selectionRenderer:function(){var f=''+H.gridlocalization.filterselectstring+"";return f}});var y=a(''+H.gridlocalization.filterselectstring+"");y.addClass(this.toThemeProperty("jqx-item"));if(c!=undefined){if(!l){c.host.height(200)}c.insertAt(H.gridlocalization.filterselectallstring,0);t.jqxDropDownList("setContent",y);var i=true;var G=new Array();c.checkAll(false);H.addHandler(c.host,"checkChange",function(J){t[0]._selectionChanged=true;if(!i){return}if(J.args.label!=H.gridlocalization.filterselectallstring){i=false;c.host.jqxListBox("checkIndex",0,true,false);var f=c.host.jqxListBox("getCheckedItems");var I=c.host.jqxListBox("getItems");if(f.length==1){c.host.jqxListBox("uncheckIndex",0,true,false)}else{if(I.length!=f.length){c.host.jqxListBox("indeterminateIndex",0,true,false)}}i=true}else{i=false;if(J.args.checked){c.host.jqxListBox("checkAll",false)}else{c.host.jqxListBox("uncheckAll",false)}i=true}})}}else{c.insertAt({label:this.gridlocalization.filterchoosestring,value:""},0);t.jqxDropDownList({selectedIndex:0})}C._filterwidget=t;var o=t.jqxDropDownList("dropdownlistWrapper");if(C.filtertype=="list"){this.addHandler(t,"select",function(f){if(!H.refreshingfilter){if(f.args&&f.args.type!="none"){H._applyfilterfromfilterrow();H.focusedfilter=null}}})}else{this.addHandler(t,"close",function(f){if(t[0]._selectionChanged){H._applyfilterfromfilterrow();H.focusedfilter=null;t[0]._selectionChanged=false}})}}else{g(this,d)}break;case"bool":case"boolean":if(this.host.jqxCheckBox){var w=a('');w.appendTo(d);w.jqxCheckBox({disabled:H.disabled,enableContainerClick:false,animationShowDelay:0,animationHideDelay:0,hasThreeStates:true,theme:this.theme,checked:null});if(C.createfilterwidget){C.createfilterwidget(C,d,w)}if(z===true||z=="true"){w.jqxCheckBox({checked:true})}else{if(z===false||z=="false"){w.jqxCheckBox({checked:false})}}C._filterwidget=w;this.addHandler(w,"change",function(f){if(!H.refreshingfilter){if(f.args){H.focusedfilter=null;H._applyfilterfromfilterrow()}}})}else{g(this,d)}break}},_getfilterdataadapter:function(b){var c=this.source._source?true:false;if(!c){dataadapter=new a.jqx.dataAdapter(this.source,{autoBind:false,uniqueDataFields:[b.displayfield],autoSort:true,autoSortField:b.displayfield,async:false})}else{var e={localdata:this.source.records,datatype:this.source.datatype,async:false};var d=this;dataadapter=new a.jqx.dataAdapter(e,{autoBind:false,autoSort:true,autoSortField:b.displayfield,async:false,uniqueDataFields:[b.displayfield],beforeLoadComplete:function(f){var k=new Array();if(b.cellsformat){var j=d._getcolumntypebydatafield(b);for(var g=0;g0){var e={localdata:b.filteritems,datatype:this.source.datatype,async:false};dataadapter=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 dataadapter},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;d0){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'+this.gridlocalization.filterselectstring+"");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;s0){b.host.jqxListBox("indeterminateIndex",0,true,false)}}}else{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;s0||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=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=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._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()}}else{this._rowdetailscache=new Array();this._render(true,true,false,false,false);if(this.showfilterrow){this._updatefocusedfilter()}this._updatecolumnwidths();this._updatecellwidths();this._renderrows(this.virtualsizeinfo)}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;b0&&b.length>0){f.removeClass();b.removeClass();f.remove();b.remove()}if(e.length>0){e.jqxButton("destroy");d.jqxButton("destroy");this.removeHandler(e,"click");this.removeHandler(d,"click")}if(h.length>0){h.jqxDropDownList("destroy")}if(c.length>0){c.jqxDropDownList("destroy")}if(g.length>0){g.jqxDropDownList("destroy")}var h=a(a.find("#filter1"+this.element.id+"ex"));var c=a(a.find("#filter2"+this.element.id+"ex"));var g=a(a.find("#filter3"+this.element.id+"ex"));if(h.length>0){h.jqxDropDownList("destroy")}if(c.length>0){c.jqxDropDownList("destroy")}if(g.length>0){g.jqxDropDownList("destroy")}},_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","175px");if(E.createfilterpanel&&!E.filterpanel){var K=a("");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("");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,localization:i,rtl:s.rtl,width:s._filterpanelwidth-15,height:20,value:null,formatString:E.cellsformat,theme:s.theme})};n(b);var b=a("");d.append(b);n(b)}else{s._showwhere.text(s.gridlocalization.filtershowrowstring);var b=a("");e.append(b);var n=function(c){c.addClass(s.toThemeProperty("jqx-input"));c.addClass(s.toThemeProperty("jqx-widget-content"));c.addClass(s.toThemeProperty("jqx-rc-all"));c.width(s._filterpanelwidth-15)};n(b);var b=a("");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;O0){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");b.append(t);var n=a("");n.text(z.gridlocalization.filtershowrowstring);this._showwhere=n;var o=w?"ex":"";var v=a("");var h=a("");var s=a("");var e=z._getcolumntypebydatafield(c);if(!v.jqxDropDownList){throw new Error("jqxGrid: jqxdropdownlist.js is not loaded.");return}var q=z._getfiltersbytype(e);this._hasdatefilter=false;this._filterpanelwidth=p;if(this.columns&&this.columns.records){for(var u=0;u");var m=k.find("input");m.addClass(this.toThemeProperty("jqx-input"));m.addClass(this.toThemeProperty("jqx-widget-content"));m.addClass(this.toThemeProperty("jqx-rc-all"));m.width(p-15);var l=a("");var j=l.find("input");j.addClass(this.toThemeProperty("jqx-input"));j.addClass(this.toThemeProperty("jqx-widget-content"));j.addClass(this.toThemeProperty("jqx-rc-all"));j.width(p-15);if(z.rtl){m.css("direction","rtl");j.css("direction","rtl")}var g=a("");var f=a(''+z.gridlocalization.filterstring+"");g.append(f);var x=a(''+z.gridlocalization.filterclearstring+"");g.append(x);f.jqxButton({height:20,theme:z.theme});x.jqxButton({height:20,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","1px");A.css("position","relative");return A}return""};if(this.filtermode==="default"&&!w){t.append(n);t.append(v);v.jqxDropDownList({_checkForHiddenParent:false,rtl:z.rtl,enableBrowserBoundsDetection:false,selectedIndex:2,width:p-15,height:20,dropDownHeight:150,dropDownWidth:p-15,selectionRenderer:y,source:q,theme:z.theme});t.append(k);var r=new Array();r[0]=z.gridlocalization.filterandconditionstring;r[1]=z.gridlocalization.filterorconditionstring;h.jqxDropDownList({_checkForHiddenParent:false,rtl:z.rtl,enableBrowserBoundsDetection:false,autoDropDownHeight:true,selectedIndex:0,width:60,height:20,source:r,selectionRenderer:y,theme:z.theme});t.append(h);s.jqxDropDownList({_checkForHiddenParent:false,rtl:z.rtl,enableBrowserBoundsDetection:false,selectedIndex:2,width:p-15,height:20,dropDownHeight:150,dropDownWidth:p-15,selectionRenderer:y,source:q,theme:z.theme});t.append(s);t.append(l)}else{if(this.filtermode==="excel"||w){t.append(n);t.append(v);v.attr("tabindex",0);v.jqxListBox({rtl:z.rtl,_checkForHiddenParent:false,checkboxes:true,selectedIndex:2,width:p-15,height:120,theme:z.theme});var d=true;z.addHandler(v,"checkChange",function(B){if(!d){return}if(B.args.label!=z.gridlocalization.filterselectallstring){d=false;v.jqxListBox("checkIndex",0,true,false);var i=v.jqxListBox("getCheckedItems");var A=v.jqxListBox("getItems");if(i.length==1){v.jqxListBox("uncheckIndex",0,true,false)}else{if(A.length!=i.length){v.jqxListBox("indeterminateIndex",0,true,false)}}d=true}else{d=false;if(B.args.checked){v.jqxListBox("checkAll",false)}else{v.jqxListBox("uncheckAll",false)}d=true}})}}t.append(g);if(z.updatefilterpanel){z.updatefilterpanel(v,s,h,k,l,f,x,null,null,q)}}})})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxgrid.js b/static/js/jqxgrid.js
new file mode 100644
index 0000000..605cf30
--- /dev/null
+++ b/static/js/jqxgrid.js
@@ -0,0 +1,13340 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(b) {
+ b.jqx.jqxWidget("jqxGrid", "", {});
+ b.extend(b.jqx._jqxGrid.prototype, {
+ defineInstance: function() {
+ var d = {
+ disabled: false,
+ width: 600,
+ height: 400,
+ pagerheight: 28,
+ groupsheaderheight: 34,
+ pagesize: 10,
+ pagesizeoptions: ["5", "10", "20"],
+ rowsheight: 25,
+ columnsheight: 25,
+ filterrowheight: 31,
+ groupindentwidth: 30,
+ rowdetails: false,
+ enablerowdetailsindent: true,
+ enablemousewheel: true,
+ initrowdetails: null,
+ layoutrowdetails: null,
+ editable: false,
+ editmode: "selectedcell",
+ pageable: false,
+ pagermode: "default",
+ pagerbuttonscount: 5,
+ groupable: false,
+ sortable: false,
+ filterable: false,
+ filtermode: "default",
+ autoshowfiltericon: true,
+ showfiltercolumnbackground: true,
+ showpinnedcolumnbackground: true,
+ showsortcolumnbackground: true,
+ altrows: false,
+ altstart: 1,
+ altstep: 1,
+ showrowdetailscolumn: true,
+ showtoolbar: false,
+ toolbarheight: 34,
+ showstatusbar: false,
+ statusbarheight: 34,
+ enableellipsis: true,
+ groups: [],
+ groupsrenderer: null,
+ groupcolumnrenderer: null,
+ groupsexpandedbydefault: false,
+ pagerrenderer: null,
+ touchmode: "auto",
+ columns: [],
+ selectedrowindex: -1,
+ selectedrowindexes: new Array(),
+ selectedcells: new Array(),
+ autobind: true,
+ selectedcell: null,
+ tableZIndex: 799,
+ headerZIndex: 299,
+ updatefilterconditions: null,
+ showaggregates: false,
+ showfilterrow: false,
+ showeverpresentrow: false,
+ everpresentrowposition: "top",
+ everpresentrowactions: "add reset",
+ everpresentrowactionsmode: "buttons",
+ everpresentrowheight: 30,
+ autorowheight: false,
+ autokoupdates: true,
+ handlekeyboardnavigation: null,
+ showsortmenuitems: true,
+ showfiltermenuitems: true,
+ showgroupmenuitems: true,
+ enablebrowserselection: false,
+ enablekeyboarddelete: true,
+ clipboard: true,
+ clipboardbegin: null,
+ clipboardend: null,
+ copytoclipboardwithheaders: false,
+ copytoclipboardhiddencolumns: false,
+ ready: null,
+ updatefilterpanel: null,
+ autogeneratecolumns: false,
+ rowdetailstemplate: null,
+ scrollfeedback: null,
+ rendertoolbar: null,
+ renderstatusbar: null,
+ rendered: null,
+ multipleselectionbegins: null,
+ columngroups: null,
+ cellhover: null,
+ source: {
+ beforeprocessing: null,
+ beforesend: null,
+ loaderror: null,
+ localdata: null,
+ data: null,
+ datatype: "array",
+ datafields: [],
+ url: "",
+ root: "",
+ record: "",
+ id: "",
+ totalrecords: 0,
+ recordstartindex: 0,
+ recordendindex: 0,
+ loadallrecords: true,
+ sortcolumn: null,
+ sortdirection: null,
+ sort: null,
+ filter: null,
+ sortcomparer: null
+ },
+ dataview: null,
+ updatedelay: null,
+ autoheight: false,
+ autowidth: false,
+ showheader: true,
+ showgroupsheader: true,
+ closeablegroups: true,
+ scrollbarsize: b.jqx.utilities.scrollBarSize,
+ touchscrollbarsize: b.jqx.utilities.touchScrollBarSize,
+ scrollbarautoshow: b.jqx.utilities.scrollBarAutoShow,
+ virtualmode: false,
+ sort: null,
+ columnsmenu: true,
+ columnsresize: false,
+ columnsautoresize: true,
+ columnsreorder: false,
+ columnsmenuwidth: 15,
+ autoshowcolumnsmenubutton: true,
+ popupwidth: "auto",
+ popupheight: "auto",
+ columnmenuopening: null,
+ columnmenuclosing: null,
+ sorttogglestates: 2,
+ rendergridrows: null,
+ enableanimations: true,
+ enablecolumnsvirtualization: true,
+ enabletooltips: false,
+ selectionmode: "singlerow",
+ enablehover: true,
+ loadingerrormessage: "The data is still loading. When the data binding is completed, the Grid raises the 'bindingcomplete' event. Call this function in the 'bindingcomplete' event handler.",
+ verticalscrollbarstep: 25,
+ verticalscrollbarlargestep: 400,
+ horizontalscrollbarstep: 10,
+ horizontalscrollbarlargestep: 50,
+ keyboardnavigation: true,
+ touchModeStyle: "auto",
+ autoshowloadelement: true,
+ showdefaultloadelement: true,
+ showemptyrow: true,
+ autosavestate: false,
+ autoloadstate: false,
+ _updating: false,
+ _pagescache: new Array(),
+ _pageviews: new Array(),
+ _cellscache: new Array(),
+ _rowdetailscache: new Array(),
+ _rowdetailselementscache: new Array(),
+ _requiresupdate: false,
+ _hasOpenedMenu: false,
+ scrollmode: "physical",
+ deferreddatafields: null,
+ localization: null,
+ rtl: false,
+ menuitemsarray: [],
+ events: ["initialized", "rowClick", "rowSelect", "rowUnselect", "groupExpand", "groupCollapse", "sort", "columnClick", "cellClick", "pageChanged", "pageSizeChanged", "bindingComplete", "groupsChanged", "filter", "columnResized", "cellSelect", "cellUnselect", "cellBeginEdit", "cellEndEdit", "cellValueChanged", "rowExpand", "rowCollapse", "rowDoubleClick", "cellDoubleClick", "columnReordered", "pageChanging"]
+ };
+ b.extend(true, this, d);
+ return d
+ },
+ createInstance: function(i) {
+ this.that = this;
+ var h = this;
+ h.pagesize = parseInt(h.pagesize);
+ h.toolbarheight = parseInt(h.toolbarheight);
+ h.columnsheight = parseInt(h.columnsheight);
+ h.filterrowheight = parseInt(h.filterrowheight);
+ h.statusbarheight = parseInt(h.statusbarheight);
+ h.groupsheaderheight = parseInt(h.groupsheaderheight);
+ h.savedArgs = i && i.length > 0 ? i[0] : null;
+ var g = "";
+ h.element.innerHTML = "";
+ if (b.jqx.utilities.scrollBarSize != 15) {
+ h.scrollbarsize = b.jqx.utilities.scrollBarSize
+ }
+ if (h.source) {
+ if (!h.source.dataBind) {
+ if (!b.jqx.dataAdapter) {
+ throw new Error("jqxGrid: Missing reference to jqxdata.js")
+ }
+ h.source = new b.jqx.dataAdapter(h.source)
+ }
+ var d = h.source._source.datafields;
+ if (d && d.length > 0) {
+ h.editmode = h.editmode.toLowerCase();
+ h.selectionmode = h.selectionmode.toLowerCase()
+ }
+ }
+ h.host.attr("role", "grid");
+ h.host.attr("align", "left");
+ h.element.innerHTML = g;
+ h.host.addClass(h.toTP("jqx-grid"));
+ h.host.addClass(h.toTP("jqx-reset"));
+ h.host.addClass(h.toTP("jqx-rc-all"));
+ h.host.addClass(h.toTP("jqx-widget"));
+ h.host.addClass(h.toTP("jqx-widget-content"));
+ h.wrapper = h.host.find("#wrapper" + h.element.id);
+ h.content = h.host.find("#content" + h.element.id);
+ h.content.addClass(h.toTP("jqx-reset"));
+ var k = h.host.find("#verticalScrollBar" + h.element.id);
+ var o = h.host.find("#horizontalScrollBar" + h.element.id);
+ h.bottomRight = h.host.find("#bottomRight").addClass(h.toTP("jqx-grid-bottomright")).addClass(h.toTP("jqx-scrollbar-state-normal"));
+ if (!k.jqxScrollBar) {
+ throw new Error("jqxGrid: Missing reference to jqxscrollbar.js");
+ return
+ }
+ h.editors = new Array();
+ h.vScrollBar = k.jqxScrollBar({
+ vertical: true,
+ rtl: h.rtl,
+ touchMode: h.touchmode,
+ step: h.verticalscrollbarstep,
+ largestep: h.verticalscrollbarlargestep,
+ theme: h.theme,
+ _triggervaluechanged: false
+ });
+ h.hScrollBar = o.jqxScrollBar({
+ vertical: false,
+ rtl: h.rtl,
+ touchMode: h.touchmode,
+ step: h.horizontalscrollbarstep,
+ largestep: h.horizontalscrollbarlargestep,
+ theme: h.theme,
+ _triggervaluechanged: false
+ });
+ h.addnewrow = h.host.find("#addrow");
+ h.addnewrow[0].id = "addrow" + h.element.id;
+ h.addnewrow.addClass(h.toTP("jqx-widget-header"));
+ h.pager = h.host.find("#pager");
+ h.pager[0].id = "pager" + h.element.id;
+ h.toolbar = h.host.find("#toolbar");
+ h.toolbar[0].id = "toolbar" + h.element.id;
+ h.toolbar.addClass(h.toTP("jqx-grid-toolbar"));
+ h.toolbar.addClass(h.toTP("jqx-widget-header"));
+ h.statusbar = h.host.find("#statusbar");
+ h.statusbar[0].id = "statusbar" + h.element.id;
+ h.statusbar.addClass(h.toTP("jqx-grid-statusbar"));
+ h.statusbar.addClass(h.toTP("jqx-widget-header"));
+ h.pager.addClass(h.toTP("jqx-grid-pager"));
+ h.pager.addClass(h.toTP("jqx-widget-header"));
+ h.groupsheader = h.host.find("#groupsheader");
+ h.groupsheader.addClass(h.toTP("jqx-grid-groups-header"));
+ h.groupsheader.addClass(h.toTP("jqx-widget-header"));
+ h.groupsheader[0].id = "groupsheader" + h.element.id;
+ h.vScrollBar.css("visibility", "hidden");
+ h.hScrollBar.css("visibility", "hidden");
+ h.vScrollInstance = b.data(h.vScrollBar[0], "jqxScrollBar").instance;
+ h.hScrollInstance = b.data(h.hScrollBar[0], "jqxScrollBar").instance;
+ h.gridtable = null;
+ h.isNestedGrid = h.host.parent() ? h.host.parent().css("z-index") == 9999 : false;
+ h.touchdevice = h.isTouchDevice();
+ if (h.localizestrings) {
+ h.localizestrings();
+ if (h.localization != null) {
+ h.localizestrings(h.localization, false)
+ }
+ }
+ if (h.rowdetailstemplate) {
+ if (undefined == h.rowdetailstemplate.rowdetails) {
+ h.rowdetailstemplate.rowdetails = ""
+ }
+ if (undefined == h.rowdetailstemplate.rowdetailsheight) {
+ h.rowdetailstemplate.rowdetailsheight = 200
+ }
+ if (undefined == h.rowdetailstemplate.rowdetailshidden) {
+ h.rowdetailstemplate.rowdetailshidden = true
+ }
+ }
+ if (h.showfilterrow && !h.filterable) {
+ throw new Error('jqxGrid: "showfilterrow" requires setting the "filterable" property to true!');
+ h.host.remove();
+ return
+ }
+ if (h.autorowheight && !h.autoheight && !h.pageable) {
+ //throw new Error('jqxGrid: "autorowheight" requires setting the "autoheight" or "pageable" property to true!');
+ //h.host.remove();
+ //return
+ }
+ if (h.virtualmode && h.rendergridrows == null) {
+ throw new Error('jqxGrid: "virtualmode" requires setting the "rendergridrows"!');
+ h.host.remove();
+ return
+ }
+ if (h.virtualmode && !h.pageable && h.groupable) {
+ throw new Error('jqxGrid: "grouping" in "virtualmode" without paging is not supported!');
+ h.host.remove();
+ return
+ }
+ if (h._testmodules()) {
+ return
+ }
+ h._builddataloadelement();
+ h._cachedcolumns = h.columns;
+ if (h.columns && h.columns.length > 299) {
+ h.headerZIndex = h.columns.length + 100
+ }
+ if (h.rowsheight != 25) {
+ h._measureElement("cell")
+ }
+ if (h.columnsheight != 25 || h.columngroups) {
+ h._measureElement("column")
+ }
+ if (h.source) {
+ var d = h.source.datafields;
+ if (d == null && h.source._source) {
+ d = h.source._source.datafields
+ }
+ if (d) {
+ for (var e = 0; e < h.columns.length; e++) {
+ var f = h.columns[e];
+ if (f && f.cellsformat && f.cellsformat.length > 2) {
+ for (var n = 0; n < d.length; n++) {
+ if (d[n].name == f.datafield && !d[n].format) {
+ d[n].format = f.cellsformat;
+ break
+ }
+ }
+ }
+ }
+ }
+ }
+ h.databind(h.source);
+ if (h.showtoolbar) {
+ h.toolbar.css("visibility", "inherit")
+ }
+ if (h.showstatusbar) {
+ h.statusbar.css("visibility", "inherit")
+ }
+ h._arrange();
+ if (h.pageable && h._initpager) {
+ h._initpager()
+ }
+ h.tableheight = null;
+ var j = h.that;
+ var l = function() {
+ if (j.content) {
+ j.content[0].scrollTop = 0;
+ j.content[0].scrollLeft = 0
+ }
+ if (j.gridcontent) {
+ j.gridcontent[0].scrollLeft = 0;
+ j.gridcontent[0].scrollTop = 0
+ }
+ };
+ h.addHandler(h.content, "mousedown",
+ function() {
+ l()
+ });
+ h.addHandler(h.content, "scroll",
+ function(m) {
+ l();
+ return false
+ });
+ if (!h.showfilterrow) {
+ if (!h.showstatusbar && !h.showtoolbar) {
+ h.host.addClass("jqx-disableselect")
+ }
+ h.content.addClass("jqx-disableselect")
+ }
+ if (h.enablebrowserselection) {
+ h.content.removeClass("jqx-disableselect");
+ h.host.removeClass("jqx-disableselect")
+ }
+ h._resizeWindow();
+ if (h.disabled) {
+ h.host.addClass(h.toThemeProperty("jqx-fill-state-disabled"))
+ }
+ h.hasTransform = b.jqx.utilities.hasTransform(h.host);
+ if (h.scrollmode == "logical") {
+ h.vScrollInstance.thumbStep = h.rowsheight;
+ h.vScrollInstance.step = h.rowsheight
+ }
+ if (!b.jqx.isHidden(h.host)) {
+ if (h.filterable || h.groupable || h.sortable) {
+ h._initmenu()
+ }
+ }
+ },
+ _resizeWindow: function() {
+ var e = this.that;
+ if ((this.width != null && this.width.toString().indexOf("%") != -1) || (this.height != null && this.height.toString().indexOf("%") != -1)) {
+ this._updatesizeonwindowresize = true;
+ b.jqx.utilities.resize(this.host,
+ function(j) {
+ var i = b(window).width();
+ var g = b(window).height();
+ var h = e.host.width();
+ var k = e.host.height();
+ if (e.autoheight) {
+ e._lastHostWidth = g
+ }
+ if (e._lastHostWidth != h || e._lastHostHeight != k) {
+ if (e.touchdevice && e.editcell && j !== "orientationchange") {
+ return
+ }
+ e._updatesize(e._lastHostWidth != h, e._lastHostHeight != k)
+ }
+ e._lastWidth = i;
+ e._lastHeight = g;
+ e._lastHostWidth = h;
+ e._lastHostHeight = k
+ });
+ var d = e.host.width();
+ var f = e.host.height();
+ e._lastHostWidth = d;
+ e._lastHostHeight = f
+ }
+ },
+ _builddataloadelement: function() {
+ if (this.dataloadelement) {
+ this.dataloadelement.remove()
+ }
+ this.dataloadelement = b('');
+ if (this.showdefaultloadelement) {
+ var d = b('' + this.gridlocalization.loadtext + " ");
+ d.addClass(this.toTP("jqx-rc-all"));
+ this.dataloadelement.addClass(this.toTP("jqx-rc-all"));
+ d.addClass(this.toTP("jqx-fill-state-normal"));
+ this.dataloadelement.append(d)
+ } else {
+ this.dataloadelement.addClass(this.toTP("jqx-grid-load"))
+ }
+ this.dataloadelement.width(this.width);
+ this.dataloadelement.height(this.height);
+ this.host.prepend(this.dataloadelement)
+ },
+ _measureElement: function(e) {
+ var d = b("measure Text");
+ d.addClass(this.toTP("jqx-widget"));
+ b(document.body).append(d);
+ if (e == "cell") {
+ this._cellheight = d.height()
+ } else {
+ this._columnheight = d.height()
+ }
+ d.remove()
+ },
+ _measureMenuElement: function() {
+ var e = b("measure Text");
+ e.addClass(this.toTP("jqx-widget"));
+ e.addClass(this.toTP("jqx-menu"));
+ e.addClass(this.toTP("jqx-menu-item-top"));
+ e.addClass(this.toTP("jqx-fill-state-normal"));
+ b(document.body).append(e);
+ var d = e.outerHeight();
+ e.remove();
+ return d
+ },
+ _measureElementWidth: function(f) {
+ var e = b("" + f + "");
+ e.addClass(this.toTP("jqx-widget"));
+ e.addClass(this.toTP("jqx-grid"));
+ e.addClass(this.toTP("jqx-grid-column-header"));
+ e.addClass(this.toTP("jqx-widget-header"));
+ b(document.body).append(e);
+ var d = e.outerWidth() + 20;
+ e.remove();
+ return d
+ },
+ _getBodyOffset: function() {
+ var e = 0;
+ var d = 0;
+ if (b("body").css("border-top-width") != "0px") {
+ e = parseInt(b("body").css("border-top-width"));
+ if (isNaN(e)) {
+ e = 0
+ }
+ }
+ if (b("body").css("border-left-width") != "0px") {
+ d = parseInt(b("body").css("border-left-width"));
+ if (isNaN(d)) {
+ d = 0
+ }
+ }
+ return {
+ left: d,
+ top: e
+ }
+ },
+ _testmodules: function() {
+ var k = "";
+ var h = this.that;
+ var d = function() {
+ if (k.length != "") {
+ k += ","
+ }
+ };
+ if (this.columnsmenu && !this.host.jqxMenu && (this.sortable || this.groupable || this.filterable)) {
+ d();
+ k += " jqxmenu.js"
+ }
+ if (!this.host.jqxScrollBar) {
+ d();
+ k += " jqxscrollbar.js"
+ }
+ if (!this.host.jqxButton) {
+ d();
+ k += " jqxbuttons.js"
+ }
+ if (!b.jqx.dataAdapter) {
+ d();
+ k += " jqxdata.js"
+ }
+ if (this.pageable && !this.gotopage) {
+ d();
+ k += "jqxgrid.pager.js"
+ }
+ if (this.filterable && !this.applyfilters) {
+ d();
+ k += " jqxgrid.filter.js"
+ }
+ if (this.groupable && !this._initgroupsheader) {
+ d();
+ k += " jqxgrid.grouping.js"
+ }
+ if (this.columnsresize && !this.autoresizecolumns) {
+ d();
+ k += " jqxgrid.columnsresize.js"
+ }
+ if (this.columnsreorder && !this.setcolumnindex) {
+ d();
+ k += " jqxgrid.columnsreorder.js"
+ }
+ if (this.sortable && !this.sortby) {
+ d();
+ k += " jqxgrid.sort.js"
+ }
+ if (this.editable && !this.begincelledit) {
+ d();
+ k += " jqxgrid.edit.js"
+ }
+ if (this.showaggregates && !this.getcolumnaggregateddata) {
+ d();
+ k += " jqxgrid.aggregates.js"
+ }
+ if (this.keyboardnavigation && !this.selectrow) {
+ d();
+ k += " jqxgrid.selection.js"
+ }
+ if (k != "" || this.editable || this.filterable || this.pageable) {
+ var f = [];
+ var j = function(i) {
+ switch (i) {
+ case "checkbox":
+ if (!h.host.jqxCheckBox && !f.checkbox) {
+ f.checkbox = true;
+ d();
+ k += " jqxcheckbox.js"
+ }
+ break;
+ case "numberinput":
+ if (!h.host.jqxNumberInput && !f.numberinput) {
+ f.numberinput = true;
+ d();
+ k += " jqxnumberinput.js"
+ }
+ break;
+ case "datetimeinput":
+ if (!h.host.jqxDateTimeInput && !f.datetimeinput) {
+ d();
+ f.datetimeinput = true;
+ k += " jqxdatetimeinput.js(requires: jqxcalendar.js)"
+ } else {
+ if (!h.host.jqxCalendar && !f.calendar) {
+ d();
+ k += " jqxcalendar.js"
+ }
+ }
+ break;
+ case "combobox":
+ if (!h.host.jqxComboBox && !f.combobox) {
+ d();
+ f.combobox = true;
+ k += " jqxcombobox.js(requires: jqxlistbox.js)"
+ } else {
+ if (!h.host.jqxListBox && !f.listbox) {
+ d();
+ f.listbox = true;
+ k += " jqxlistbox.js"
+ }
+ }
+ break;
+ case "dropdownlist":
+ if (!h.host.jqxDropDownList && !f.dropdownlist) {
+ d();
+ f.dropdownlist = true;
+ k += " jqxdropdownlist.js(requires: jqxlistbox.js)"
+ } else {
+ if (!h.host.jqxListBox && !f.listbox) {
+ d();
+ f.listbox = true;
+ k += " jqxlistbox.js"
+ }
+ }
+ break
+ }
+ };
+ if (this.filterable || this.pageable) {
+ j("dropdownlist")
+ }
+ for (var e = 0; e < this.columns.length; e++) {
+ if (this.columns[e] == undefined) {
+ continue
+ }
+ var g = this.columns[e].columntype;
+ j(g);
+ if (this.filterable && this.showfilterrow) {
+ var g = this.columns[e].filtertype;
+ if (g == "checkedlist" || g == "bool") {
+ j("checkbox")
+ }
+ if (g == "date") {
+ j("datetimeinput")
+ }
+ }
+ }
+ if (k != "") {
+ throw new Error("jqxGrid: Missing references to the following module(s): " + k);
+ this.host.remove();
+ return true
+ }
+ }
+ return false
+ },
+ focus: function() {
+ try {
+ this.wrapper.focus();
+ var e = this.that;
+ setTimeout(function() {
+ e.wrapper.focus()
+ },
+ 25);
+ this.focused = true
+ } catch(d) {}
+ },
+ hiddenParent: function() {
+ return b.jqx.isHidden(this.host)
+ },
+ resize: function(e, d) {
+ this.width = e;
+ this.height = d;
+ this._updatesize(true, true)
+ },
+ _updatesize: function(i, h) {
+ if (this._loading) {
+ return
+ }
+ var f = this.that;
+ f._newmax = null;
+ var g = f.host.width();
+ var e = f.host.height();
+ if (!f._oldWidth) {
+ f._oldWidth = g
+ }
+ if (!f._oldHeight) {
+ f._oldHeight = e
+ }
+ if (f._resizeTimer) {
+ clearTimeout(f._resizeTimer)
+ }
+ var d = 5;
+ f._resizeTimer = setTimeout(function() {
+ f.resizingGrid = true;
+ if (b.jqx.isHidden(f.host)) {
+ return
+ }
+ if (f.editcell) {
+ f.endcelledit(f.editcell.row, f.editcell.column, true, true);
+ f._oldselectedcell = null
+ }
+ if (j != f._oldHeight || h == true) {
+ var k = f.groupable && f.groups.length > 0;
+ var p = f.vScrollBar.css("visibility");
+ if (!f.autoheight) {
+ if (f.virtualmode) {
+ f._pageviews = new Array()
+ }
+ if (!k && !f.rowdetails && !f.pageable) {
+ f._arrange();
+ f.virtualsizeinfo = f._calculatevirtualheight();
+ var j = Math.round(f.host.height()) + 2 * f.rowsheight;
+ if (parseInt(j) >= parseInt(f._oldHeight)) {
+ f.prerenderrequired = true
+ }
+ f._renderrows(f.virtualsizeinfo);
+ if (f.rtl) {
+ f._updatecolumnwidths();
+ if (f.table) {
+ f.table.width(f.columnsheader.width())
+ }
+ f._updatecellwidths()
+ }
+ } else {
+ f._arrange();
+ f.prerenderrequired = true;
+ var j = Math.round(f.host.height()) + 2 * f.rowsheight;
+ realheight = f._gettableheight();
+ var r = Math.round(j / f.rowsheight);
+ var m = Math.max(f.dataview.totalrows, f.dataview.totalrecords);
+ if (f.pageable) {
+ m = f.pagesize;
+ if (f.pagesize > Math.max(f.dataview.totalrows, f.dataview.totalrecords) && f.autoheight) {
+ m = Math.max(f.dataview.totalrows, f.dataview.totalrecords)
+ } else {
+ if (!f.autoheight) {
+ if (f.dataview.totalrows < f.pagesize) {
+ m = Math.max(f.dataview.totalrows, f.dataview.totalrecords)
+ }
+ }
+ }
+ }
+ var o = m * f.rowsheight;
+ var l = f._getpagesize();
+ if (!f.pageable && f.autoheight) {
+ r = m
+ }
+ if (f.virtualsizeinfo) {
+ f.virtualsizeinfo.visiblerecords = r
+ }
+ f.rendergridcontent(true, false);
+ f._renderrows(f.virtualsizeinfo)
+ }
+ if (p != f.vScrollBar.css("visibility")) {
+ f.vScrollInstance.setPosition(0);
+ f._arrange();
+ f._updatecolumnwidths();
+ if (f.table) {
+ f.table.width(f.columnsheader.width())
+ }
+ f._updatecellwidths()
+ }
+ }
+ }
+ if (g != f._oldWidth || i == true) {
+ var q = false;
+ if (f.editcell && f.editcell.editor) {
+ switch (f.editcell.columntype) {
+ case "dropdownlist":
+ q = f.editcell.editor.jqxDropDownList("isOpened") || (f.editcell.editor.jqxDropDownList("isanimating") && !f.editcell.editor.jqxDropDownList("ishiding"));
+ if (q) {
+ f.editcell.editor.jqxDropDownList({
+ openDelay: 0
+ });
+ f.editcell.editor.jqxDropDownList("open");
+ f.editcell.editor.jqxDropDownList({
+ openDelay: 250
+ });
+ return
+ }
+ break;
+ case "combobox":
+ q = f.editcell.editor.jqxComboBox("isOpened") || (f.editcell.editor.jqxComboBox("isanimating") && !f.editcell.editor.jqxComboBox("ishiding"));
+ if (q) {
+ f.editcell.editor.jqxComboBox({
+ openDelay: 0
+ });
+ f.editcell.editor.jqxComboBox("open");
+ f.editcell.editor.jqxComboBox({
+ openDelay: 250
+ });
+ return
+ }
+ break;
+ case "datetimeinput":
+ if (q) {
+ q = f.editcell.editor.jqxDateTimeInput("isOpened") || (f.editcell.editor.jqxDateTimeInput("isanimating") && !f.editcell.editor.jqxDateTimeInput("ishiding"));
+ f.editcell.editor.jqxDateTimeInput({
+ openDelay: 0
+ });
+ f.editcell.editor.jqxDateTimeInput("open");
+ f.editcell.editor.jqxDateTimeInput({
+ openDelay: 250
+ });
+ return
+ }
+ break
+ }
+ }
+ var n = f.hScrollBar.css("visibility");
+ f._arrange();
+ f._updatecolumnwidths();
+ if (f.table) {
+ f.table.width(f.columnsheader.width())
+ }
+ f._updatecellwidths();
+ if (! (i == false && f._oldWidth > g)) {
+ if (!h || f.dataview.rows.length == 0) {
+ f._renderrows(f.virtualsizeinfo)
+ }
+ }
+ if (n != f.hScrollBar.css("visibility")) {
+ f.hScrollInstance.setPosition(0)
+ }
+ }
+ f._oldWidth = g;
+ f._oldHeight = j;
+ f.resizingGrid = false
+ },
+ d)
+ },
+ getTouches: function(d) {
+ return b.jqx.mobile.getTouches(d)
+ },
+ _updateTouchScrolling: function() {
+ var e = this.that;
+ if (e.isTouchDevice()) {
+ e.scrollmode = "logical";
+ e.vScrollInstance.thumbStep = e.rowsheight;
+ var g = b.jqx.mobile.getTouchEventName("touchstart");
+ var f = b.jqx.mobile.getTouchEventName("touchend");
+ var d = b.jqx.mobile.getTouchEventName("touchmove");
+ e.enablehover = false;
+ if (e.gridcontent) {
+ e.removeHandler(e.gridcontent, g + ".touchScroll");
+ e.removeHandler(e.gridcontent, d + ".touchScroll");
+ e.removeHandler(e.gridcontent, f + ".touchScroll");
+ e.removeHandler(e.gridcontent, "touchcancel.touchScroll");
+ b.jqx.mobile.touchScroll(e.gridcontent[0], e.vScrollInstance.max,
+ function(j, i) {
+ if (e.vScrollBar.css("visibility") == "visible") {
+ var h = e.vScrollInstance.value;
+ e.vScrollInstance.setPosition(h + i)
+ }
+ if (e.hScrollBar.css("visibility") == "visible") {
+ var h = e.hScrollInstance.value;
+ e.hScrollInstance.setPosition(h + j)
+ }
+ e.vScrollInstance.thumbCapture = true;
+ e._lastScroll = new Date()
+ },
+ this.element.id, this.hScrollBar, this.vScrollBar);
+ if (e._overlayElement) {
+ e.removeHandler(e._overlayElement, g + ".touchScroll");
+ e.removeHandler(e._overlayElement, d + ".touchScroll");
+ e.removeHandler(e._overlayElement, f + ".touchScroll");
+ e.removeHandler(e._overlayElement, "touchcancel.touchScroll");
+ b.jqx.mobile.touchScroll(e._overlayElement[0], e.vScrollInstance.max,
+ function(j, i) {
+ if (e.vScrollBar.css("visibility") == "visible") {
+ var h = e.vScrollInstance.value;
+ e.vScrollInstance.setPosition(h + i)
+ }
+ if (e.hScrollBar.css("visibility") == "visible") {
+ var h = e.hScrollInstance.value;
+ e.hScrollInstance.setPosition(h + j)
+ }
+ e.vScrollInstance.thumbCapture = true;
+ e._lastScroll = new Date()
+ },
+ this.element.id, this.hScrollBar, this.vScrollBar);
+ this.addHandler(this.host, g,
+ function() {
+ if (!e.editcell) {
+ e._overlayElement.css("visibility", "visible")
+ } else {
+ e._overlayElement.css("visibility", "hidden")
+ }
+ });
+ this.addHandler(this.host, f,
+ function() {
+ if (!e.editcell) {
+ e._overlayElement.css("visibility", "visible")
+ } else {
+ e._overlayElement.css("visibility", "hidden")
+ }
+ })
+ }
+ }
+ }
+ },
+ isTouchDevice: function() {
+ if (this.touchDevice != undefined) {
+ return this.touchDevice
+ }
+ var d = b.jqx.mobile.isTouchDevice();
+ this.touchDevice = d;
+ if (this.touchmode == true) {
+ if (b.jqx.browser.msie && b.jqx.browser.version < 9) {
+ this.enablehover = false;
+ return false
+ }
+ d = true;
+ b.jqx.mobile.setMobileSimulator(this.element);
+ this.touchDevice = d
+ } else {
+ if (this.touchmode == false) {
+ d = false
+ }
+ }
+ if (d && this.touchModeStyle != false) {
+ this.touchDevice = true;
+ this.host.addClass(this.toThemeProperty("jqx-touch"));
+ this.host.find("jqx-widget-content").addClass(this.toThemeProperty("jqx-touch"));
+ this.host.find("jqx-widget-header").addClass(this.toThemeProperty("jqx-touch"));
+ this.scrollbarsize = this.touchscrollbarsize
+ }
+ return d
+ },
+ toTP: function(d) {
+ return this.toThemeProperty(d)
+ },
+ localizestrings: function(d, e) {
+ this._cellscache = new Array();
+ if (b.jqx.dataFormat) {
+ b.jqx.dataFormat.cleardatescache()
+ }
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ if (d != null) {
+ for (var f in d) {
+ if (f.toLowerCase() !== f) {
+ d[f.toLowerCase()] = d[f]
+ }
+ }
+ if (d.pagergotopagestring) {
+ this.gridlocalization.pagergotopagestring = d.pagergotopagestring
+ }
+ if (d.pagershowrowsstring) {
+ this.gridlocalization.pagershowrowsstring = d.pagershowrowsstring
+ }
+ if (d.pagerrangestring) {
+ this.gridlocalization.pagerrangestring = d.pagerrangestring
+ }
+ if (d.pagernextbuttonstring) {
+ this.gridlocalization.pagernextbuttonstring = d.pagernextbuttonstring
+ }
+ if (d.pagerpreviousbuttonstring) {
+ this.gridlocalization.pagerpreviousbuttonstring = d.pagerpreviousbuttonstring
+ }
+ if (d.pagerfirstbuttonstring) {
+ this.gridlocalization.pagerfirstbuttonstring = d.pagerfirstbuttonstring
+ }
+ if (d.pagerlastbuttonstring) {
+ this.gridlocalization.pagerlastbuttonstring = d.pagerlastbuttonstring
+ }
+ if (d.groupsheaderstring) {
+ this.gridlocalization.groupsheaderstring = d.groupsheaderstring
+ }
+ if (d.sortascendingstring) {
+ this.gridlocalization.sortascendingstring = d.sortascendingstring
+ }
+ if (d.sortdescendingstring) {
+ this.gridlocalization.sortdescendingstring = d.sortdescendingstring
+ }
+ if (d.sortremovestring) {
+ this.gridlocalization.sortremovestring = d.sortremovestring
+ }
+ if (d.groupbystring) {
+ this.gridlocalization.groupbystring = d.groupbystring
+ }
+ if (d.groupremovestring) {
+ this.gridlocalization.groupremovestring = d.groupremovestring
+ }
+ if (d.firstDay) {
+ this.gridlocalization.firstDay = d.firstDay
+ }
+ if (d.days) {
+ this.gridlocalization.days = d.days
+ }
+ if (d.months) {
+ this.gridlocalization.months = d.months
+ }
+ if (d.AM) {
+ this.gridlocalization.AM = d.AM
+ }
+ if (d.PM) {
+ this.gridlocalization.PM = d.PM
+ }
+ if (d.patterns) {
+ this.gridlocalization.patterns = d.patterns
+ }
+ if (d.percentsymbol) {
+ this.gridlocalization.percentsymbol = d.percentsymbol
+ }
+ if (d.currencysymbol) {
+ this.gridlocalization.currencysymbol = d.currencysymbol
+ }
+ if (d.currencysymbolposition) {
+ this.gridlocalization.currencysymbolposition = d.currencysymbolposition
+ }
+ if (d.decimalseparator != undefined) {
+ this.gridlocalization.decimalseparator = d.decimalseparator
+ }
+ if (d.thousandsseparator != undefined) {
+ this.gridlocalization.thousandsseparator = d.thousandsseparator
+ }
+ if (d.filterclearstring) {
+ this.gridlocalization.filterclearstring = d.filterclearstring
+ }
+ if (d.filterstring) {
+ this.gridlocalization.filterstring = d.filterstring
+ }
+ if (d.filtershowrowstring) {
+ this.gridlocalization.filtershowrowstring = d.filtershowrowstring
+ }
+ if (d.filtershowrowdatestring) {
+ this.gridlocalization.filtershowrowdatestring = d.filtershowrowdatestring
+ }
+ if (d.filterselectallstring) {
+ this.gridlocalization.filterselectallstring = d.filterselectallstring
+ }
+ if (d.filterchoosestring) {
+ this.gridlocalization.filterchoosestring = d.filterchoosestring
+ }
+ if (d.filterorconditionstring) {
+ this.gridlocalization.filterorconditionstring = d.filterorconditionstring
+ }
+ if (d.filterandconditionstring) {
+ this.gridlocalization.filterandconditionstring = d.filterandconditionstring
+ }
+ if (d.filterstringcomparisonoperators) {
+ this.gridlocalization.filterstringcomparisonoperators = d.filterstringcomparisonoperators
+ }
+ if (d.filternumericcomparisonoperators) {
+ this.gridlocalization.filternumericcomparisonoperators = d.filternumericcomparisonoperators
+ }
+ if (d.filterdatecomparisonoperators) {
+ this.gridlocalization.filterdatecomparisonoperators = d.filterdatecomparisonoperators
+ }
+ if (d.filterbooleancomparisonoperators) {
+ this.gridlocalization.filterbooleancomparisonoperators = d.filterbooleancomparisonoperators
+ }
+ if (d.emptydatastring) {
+ this.gridlocalization.emptydatastring = d.emptydatastring
+ }
+ if (d.filterselectstring) {
+ this.gridlocalization.filterselectstring = d.filterselectstring
+ }
+ if (d.todaystring) {
+ this.gridlocalization.todaystring = d.todaystring
+ }
+ if (d.clearstring) {
+ this.gridlocalization.clearstring = d.clearstring
+ }
+ if (d.validationstring) {
+ this.gridlocalization.validationstring = d.validationstring
+ }
+ if (d.loadtext) {
+ this.gridlocalization.loadtext = d.loadtext
+ }
+ if (d.addrowstring) {
+ this.gridlocalization.addrowstring = d.addrowstring
+ }
+ if (d.udpaterowstring) {
+ this.gridlocalization.udpaterowstring = d.udpaterowstring
+ }
+ if (d.deleterowstring) {
+ this.gridlocalization.deleterowstring = d.deleterowstring
+ }
+ if (d.resetrowstring) {
+ this.gridlocalization.resetrowstring = d.resetrowstring
+ }
+ if (d.everpresentrowplaceholder) {
+ this.gridlocalization.everpresentrowplaceholder = d.everpresentrowplaceholder
+ }
+ if (e !== false) {
+ if (this._initpager) {
+ this._initpager()
+ }
+ if (this._initgroupsheader) {
+ this._initgroupsheader()
+ }
+ if (this._initmenu) {
+ this._initmenu()
+ }
+ this._builddataloadelement();
+ b(this.dataloadelement).css("visibility", "hidden");
+ b(this.dataloadelement).css("display", "none");
+ if (this.filterable && this.showfilterrow) {
+ if (this._updatefilterrow) {
+ for (var f in this._filterrowcache) {
+ b(this._filterrowcache[f]).remove()
+ }
+ this._filterrowcache = [];
+ this._updatefilterrow()
+ }
+ }
+ if (this.showaggregates && this.refresheaggregates) {
+ this.refresheaggregates()
+ }
+ this._renderrows(this.virtualsizeinfo)
+ }
+ } else {
+ this.gridlocalization = {
+ "/": "/",
+ ":": ":",
+ firstDay: 0,
+ days: {
+ names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+ namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
+ namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+ },
+ months: {
+ names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
+ namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""]
+ },
+ AM: ["AM", "am", "AM"],
+ PM: ["PM", "pm", "PM"],
+ eras: [{
+ name: "A.D.",
+ start: null,
+ offset: 0
+ }],
+ twoDigitYearMax: 2029,
+ patterns: {
+ d: "M/d/yyyy",
+ D: "dddd, MMMM dd, yyyy",
+ t: "h:mm tt",
+ T: "h:mm:ss tt",
+ f: "dddd, MMMM dd, yyyy h:mm tt",
+ F: "dddd, MMMM dd, yyyy h:mm:ss tt",
+ M: "MMMM dd",
+ Y: "yyyy MMMM",
+ S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss",
+ ISO: "yyyy-MM-dd hh:mm:ss",
+ ISO2: "yyyy-MM-dd HH:mm:ss",
+ d1: "dd.MM.yyyy",
+ d2: "dd-MM-yyyy",
+ d3: "dd-MMMM-yyyy",
+ d4: "dd-MM-yy",
+ d5: "H:mm",
+ d6: "HH:mm",
+ d7: "HH:mm tt",
+ d8: "dd/MMMM/yyyy",
+ d9: "MMMM-dd",
+ d10: "MM-dd",
+ d11: "MM-dd-yyyy"
+ },
+ percentsymbol: "%",
+ currencysymbol: "$",
+ currencysymbolposition: "before",
+ decimalseparator: ".",
+ thousandsseparator: ",",
+ pagergotopagestring: "Go to page:",
+ pagershowrowsstring: "Show rows:",
+ pagerrangestring: " of ",
+ pagerpreviousbuttonstring: "previous",
+ pagernextbuttonstring: "next",
+ pagerfirstbuttonstring: "first",
+ pagerlastbuttonstring: "last",
+ groupsheaderstring: "Drag a column and drop it here to group by that column",
+ sortascendingstring: "Sort Ascending",
+ sortdescendingstring: "Sort Descending",
+ sortremovestring: "Remove Sort",
+ groupbystring: "Group By this column",
+ groupremovestring: "Remove from groups",
+ filterclearstring: "Clear",
+ filterstring: "Filter",
+ filtershowrowstring: "Show rows where:",
+ filtershowrowdatestring: "Show rows where date:",
+ filterorconditionstring: "Or",
+ filterandconditionstring: "And",
+ filterselectallstring: "(Select All)",
+ filterchoosestring: "Please Choose:",
+ filterstringcomparisonoperators: ["empty", "not empty", "contains", "contains(match case)", "does not contain", "does not contain(match case)", "starts with", "starts with(match case)", "ends with", "ends with(match case)", "equal", "equal(match case)", "null", "not null"],
+ filternumericcomparisonoperators: ["equal", "not equal", "less than", "less than or equal", "greater than", "greater than or equal", "null", "not null"],
+ filterdatecomparisonoperators: ["equal", "not equal", "less than", "less than or equal", "greater than", "greater than or equal", "null", "not null"],
+ filterbooleancomparisonoperators: ["equal", "not equal"],
+ validationstring: "Entered value is not valid",
+ emptydatastring: "No data to display",
+ filterselectstring: "Select Filter",
+ loadtext: "Loading...",
+ clearstring: "Clear",
+ todaystring: "Today",
+ addrowstring: "Add",
+ udpaterowstring: "Update",
+ deleterowstring: "Delete",
+ resetrowstring: "Reset",
+ everpresentrowplaceholder: "Enter "
+ }
+ }
+ },
+ _getmenudefaultheight: function() {
+ var f = this;
+ var e = 0;
+ if (this.sortable && this._togglesort && this.showsortmenuitems) {
+ e = 3
+ }
+ if (this.groupable && this._initgroupsheader && this.showgroupmenuitems) {
+ e += 2
+ }
+ var d = f._measureMenuElement();
+ var g = e * d + 9;
+ if (f.filterable && !f.showfilterrow && f.showfiltermenuitems) {
+ g += 180;
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ g += 20
+ }
+ }
+ return g
+ },
+ _initmenu: function() {
+ var r = this.that;
+ if (this.host.jqxMenu) {
+ if (this.gridmenu) {
+ if (this._hasOpenedMenu) {
+ return
+ }
+ if (this.filterable) {
+ if (this._destroyfilterpanel) {
+ this._destroyfilterpanel()
+ }
+ }
+ this.removeHandler(this.gridmenu, "keydown");
+ this.removeHandler(this.gridmenu, "closed");
+ this.removeHandler(this.gridmenu, "itemclick");
+ this.gridmenu.jqxMenu("destroy");
+ this.gridmenu.removeData();
+ this.gridmenu.remove()
+ }
+ this.menuitemsarray = new Array();
+ this.gridmenu = b('');
+ this.host.append(this.gridmenu);
+ var w = b("");
+ var i = '';
+ var t = b("" + i + this.gridlocalization.sortascendingstring + "");
+ var A = '';
+ var x = b("" + A + this.gridlocalization.sortdescendingstring + "");
+ var n = '';
+ var k = b("" + n + this.gridlocalization.sortremovestring + "");
+ var j = '';
+ var q = b("" + j + this.gridlocalization.groupbystring + "");
+ var f = b("" + j + this.gridlocalization.groupremovestring + "");
+ var d = b('');
+ var v = b('');
+ var m = this.gridlocalization.sortascendingstring.length;
+ var s = this.gridlocalization.sortascendingstring;
+ if (this.gridlocalization.sortdescendingstring.length > m) {
+ m = this.gridlocalization.sortdescendingstring.length;
+ s = this.gridlocalization.sortdescendingstring
+ }
+ if (this.gridlocalization.sortremovestring.length > m) {
+ m = this.gridlocalization.sortremovestring.length;
+ s = this.gridlocalization.sortremovestring
+ }
+ if (this.groupable && this._initgroupsheader && this.showgroupmenuitems) {
+ if (this.gridlocalization.groupbystring.length > m) {
+ m = this.gridlocalization.groupbystring.length;
+ s = this.gridlocalization.groupbystring
+ }
+ if (this.gridlocalization.groupremovestring.length > m) {
+ m = this.gridlocalization.groupremovestring.length;
+ s = this.gridlocalization.groupremovestring
+ }
+ }
+ var y = 200;
+ s = b.trim(s).replace(/\ \;/ig, "").replace(/\ \;/ig, "");
+ var g = b("" + s + "");
+ g.addClass(this.toThemeProperty("jqx-menu-item"));
+ this.host.append(g);
+ y = g.outerWidth() + 60;
+ g.remove();
+ var e = 0;
+ if (this.sortable && this._togglesort && this.showsortmenuitems) {
+ w.append(t);
+ this.menuitemsarray[0] = t[0];
+ w.append(x);
+ this.menuitemsarray[1] = x[0];
+ w.append(k);
+ this.menuitemsarray[2] = k[0];
+ e = 3
+ }
+ if (this.groupable && this._initgroupsheader && this.showgroupmenuitems) {
+ w.append(q);
+ this.menuitemsarray[3] = q[0];
+ w.append(f);
+ this.menuitemsarray[4] = f[0];
+ e += 2
+ }
+ var u = this._measureMenuElement();
+ var l = e * u + 9;
+ var p = true;
+ if (this.filterable && !this.showfilterrow && this.showfiltermenuitems) {
+ if (this._initfilterpanel) {
+ this.menuitemsarray[5] = v[0];
+ this.menuitemsarray[6] = v[0];
+ w.append(d);
+ w.append(v);
+ l += 180;
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ l += 20
+ }
+ var o = b(v).find("div:first");
+ this.excelfilterpanel = b("");
+ this.filterpanel = o;
+ this.filtermenu = b(v);
+ y += 20;
+ this._initfilterpanel(this, o, "", y);
+ this._initfilterpanel(this, this.excelfilterpanel, "", y, true);
+ p = false;
+ this.removeHandler(b(document), "click.menu" + r.element.id, r._closemenuafterclick, r);
+ this.addHandler(b(document), "click.menu" + r.element.id, r._closemenuafterclick, r)
+ } else {
+ throw new Error("jqxGrid: Missing reference to jqxgrid.filter.js.")
+ }
+ }
+ this.gridmenu.append(w);
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8 && this.filterable) {
+ b("#listBoxfilter1" + this.element.id).css("z-index", 4990);
+ b("#listBoxfilter2" + this.element.id).css("z-index", 4990);
+ b("#listBoxfilter3" + this.element.id).css("z-index", 4990);
+ b("#gridmenu" + this.element.id).css("z-index", 5000);
+ this.addHandler(b("#gridmenu" + this.element.id), "initialized",
+ function() {
+ b("#menuWrappergridmenu" + r.element.id).css("z-index", 4980)
+ })
+ }
+ if (this.menuitemsarray[0] == undefined) {
+ l = 65
+ }
+ this.removeHandler(b(window), "orientationchange.jqxgrid" + this.element.id);
+ this.removeHandler(b(window), "orientationchanged.jqxgrid" + this.element.id);
+ this.addHandler(b(window), "orientationchange.jqxgrid" + this.element.id,
+ function() {
+ r.gridmenu.jqxMenu("close")
+ });
+ this.addHandler(b(window), "orientationchanged.jqxgrid" + this.element.id,
+ function() {
+ r.gridmenu.jqxMenu("close")
+ });
+ this.removeHandler(this.gridmenu, "keydown");
+ this.addHandler(this.gridmenu, "keydown",
+ function(F) {
+ if (F.keyCode == 27) {
+ r.gridmenu.jqxMenu("close")
+ } else {
+ if (F.keyCode == 13 && r.filterable) {
+ if (r._buildfilter) {
+ var E = b(b.find("#filter1" + r.element.id)).jqxDropDownList("container").css("display") == "block";
+ var D = b(b.find("#filter2" + r.element.id)).jqxDropDownList("container").css("display") == "block";
+ var B = b(b.find("#filter3" + r.element.id)).jqxDropDownList("container").css("display") == "block";
+ var G = b(b.find("#filterclearbutton" + r.element.id)).hasClass("jqx-fill-state-focus");
+ if (G) {
+ var C = b.data(document.body, "contextmenu" + r.element.id).column;
+ r._clearfilter(r, r.element, C);
+ r.gridmenu.jqxMenu("close")
+ } else {
+ if (!E && !D && !B) {
+ var C = b.data(document.body, "contextmenu" + r.element.id).column;
+ r.gridmenu.jqxMenu("close");
+ r._buildfilter(r, v, C)
+ }
+ }
+ }
+ }
+ }
+ });
+ if (this.popupwidth != "auto") {
+ y = this.popupwidth
+ }
+ this.gridmenu.jqxMenu({
+ popupZIndex: 999999,
+ width: y,
+ height: l,
+ autoCloseOnClick: p,
+ autoOpenPopup: false,
+ mode: "popup",
+ theme: this.theme,
+ animationShowDuration: 0,
+ animationHideDuration: 0,
+ animationShowDelay: 0
+ });
+ if (this.filterable) {
+ this.gridmenu.jqxMenu("_setItemProperty", v[0].id, "closeOnClick", false)
+ }
+ if (this.rtl) {
+ var z = this.that;
+ b.each(w.find("li"),
+ function() {
+ b(this).addClass(z.toTP("jqx-rtl"))
+ });
+ var h = function(B) {
+ var C = B.find("div");
+ C.css("float", "right");
+ C.css("margin-left", "4px");
+ C.css("margin-right", "-4px")
+ };
+ h(k);
+ h(x);
+ h(t);
+ h(q);
+ h(f)
+ }
+ this._handlemenueevents()
+ } else {
+ this.columnsmenu = false
+ }
+ },
+ _arrangemenu: function() {
+ if (!this.gridmenu) {
+ this._initmenu()
+ }
+ var i = this.gridlocalization.sortascendingstring.length;
+ var d = this.gridlocalization.sortascendingstring;
+ if (this.gridlocalization.sortdescendingstring.length > i) {
+ i = this.gridlocalization.sortdescendingstring.length;
+ d = this.gridlocalization.sortdescendingstring
+ }
+ if (this.gridlocalization.sortremovestring.length > i) {
+ i = this.gridlocalization.sortremovestring.length;
+ d = this.gridlocalization.sortremovestring
+ }
+ if (this.groupable && this._initgroupsheader) {
+ if (this.gridlocalization.groupbystring.length > i) {
+ i = this.gridlocalization.groupbystring.length;
+ d = this.gridlocalization.groupbystring
+ }
+ if (this.gridlocalization.groupremovestring.length > i) {
+ i = this.gridlocalization.groupremovestring.length;
+ d = this.gridlocalization.groupremovestring
+ }
+ }
+ var e = 200;
+ d = b.trim(d).replace(/\ \;/ig, "").replace(/\ \;/ig, "");
+ var f = b("" + d + "");
+ f.addClass(this.toThemeProperty("jqx-menu-item"));
+ this.host.append(f);
+ e = f.outerWidth() + 60;
+ f.remove();
+ var g = 0;
+ if (this.sortable && this._togglesort && this.showsortmenuitems) {
+ g = 3
+ }
+ if (this.groupable && this._initgroupsheader && this.showgroupmenuitems) {
+ g += 2
+ }
+ var h = g * 27 + 3;
+ if (this.filterable && this.showfiltermenuitems) {
+ if (this._initfilterpanel) {
+ h += 180;
+ e += 20;
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ h += 20
+ }
+ }
+ }
+ if (this.menuitemsarray[0] == undefined) {
+ h = 65
+ }
+ if (this.popupwidth != "auto") {
+ e = this.popupwidth
+ }
+ if (this.popupheight != "auto") {
+ h = this.popupheight
+ }
+ this.gridmenu.jqxMenu({
+ width: e,
+ height: h
+ })
+ },
+ _closemenuafterclick: function(e) {
+ var i = e != null ? e.data: this;
+ var g = false;
+ if (e.target == undefined || (e.target != undefined && e.target.className.indexOf == undefined)) {
+ i.gridmenu.jqxMenu("close");
+ return
+ }
+ if (e.target.className.indexOf("filter") != -1 && e.target.className.indexOf("jqx-grid-cell-filter") == -1) {
+ return
+ }
+ if (e.target.className.indexOf("jqx-grid-cell") != -1) {
+ i.gridmenu.jqxMenu("close");
+ return
+ }
+ if (i._hasOpenedMenu) {
+ if (b(e.target).ischildof(i.gridmenu)) {
+ return
+ }
+ }
+ var d = i.host.coord();
+ var f = i.gridmenu.coord();
+ var k = e.pageX;
+ var j = e.pageY;
+ b.each(b(e.target).parents(),
+ function() {
+ if (this.id != null && this.id.indexOf && this.id.indexOf("filter") != -1) {
+ g = true;
+ return false
+ }
+ if (this.className.indexOf && this.className.indexOf("filter") != -1 && this.className.indexOf("jqx-grid-cell-filter") == -1) {
+ g = true;
+ return false
+ }
+ if (this.className.indexOf && this.className.indexOf("jqx-grid-cell") != -1) {
+ i.gridmenu.jqxMenu("close");
+ return false
+ }
+ if (this.className.indexOf && this.className.indexOf("jqx-grid-column") != -1) {
+ i.gridmenu.jqxMenu("close");
+ return false
+ }
+ });
+ if (g) {
+ return
+ }
+ try {
+ if (i.filtermode === "default") {
+ var n = b(b.find("#filter1" + i.element.id)).jqxDropDownList("listBox").vScrollInstance._mouseup;
+ var l = new Date();
+ if (l - n < 100) {
+ return
+ }
+ var m = b(b.find("#filter3" + i.element.id)).jqxDropDownList("listBox").vScrollInstance._mouseup;
+ if (l - m < 100) {
+ return
+ }
+ if ((b(b.find("#filter3" + i.element.id)).jqxDropDownList("container")).css("display") == "block") {
+ return
+ }
+ if ((b(b.find("#filter1" + i.element.id)).jqxDropDownList("container")).css("display") == "block") {
+ return
+ }
+ if ((b(b.find("#filter2" + i.element.id)).jqxDropDownList("container")).css("display") == "block") {
+ return
+ }
+ if (i._hasdatefilter) {
+ if (b(".filtertext1" + i.element.id)[0].nodeName.toLowerCase() == "div") {
+ if (b(".filtertext1" + i.element.id).jqxDateTimeInput("container").css("display") == "block") {
+ return
+ }
+ if (b(".filtertext2" + i.element.id).jqxDateTimeInput("container").css("display") == "block") {
+ return
+ }
+ }
+ }
+ } else {
+ var n = b(b.find("#filter1" + i.element.id)).data().jqxListBox.instance.vScrollInstance._mouseup;
+ var l = new Date();
+ if (l - n < 100) {
+ return
+ }
+ var m = b(b.find("#filter1" + i.element.id)).data().jqxListBox.instance.hScrollInstance._mouseup;
+ if (l - m < 100) {
+ return
+ }
+ }
+ } catch(h) {}
+ if (k >= f.left && k <= f.left + i.gridmenu.width()) {
+ if (j >= f.top && j <= f.top + i.gridmenu.height()) {
+ return
+ }
+ }
+ i.gridmenu.jqxMenu("close")
+ },
+ _handlemenueevents: function() {
+ var d = this.that;
+ this.removeHandler(this.gridmenu, "closed");
+ this.addHandler(this.gridmenu, "closed",
+ function(e) {
+ d._closemenu()
+ });
+ this.removeHandler(this.gridmenu, "itemclick");
+ this.addHandler(this.gridmenu, "itemclick",
+ function(h) {
+ var g = h.args;
+ for (var e = 0; e < d.menuitemsarray.length; e++) {
+ var j = d.menuitemsarray[e];
+ if (g == j) {
+ if (b(g).attr("ignoretheme") != undefined) {
+ return
+ }
+ var k = b.data(document.body, "contextmenu" + d.element.id);
+ var f = k.column;
+ if (d.filterable) {
+ d.gridmenu.jqxMenu("close")
+ }
+ var m = f.displayfield;
+ if (m == null) {
+ m = f.datafield
+ }
+ if (k != null) {
+ switch (e) {
+ case 0:
+ d.sortby(m, "ascending", null);
+ break;
+ case 1:
+ d.sortby(m, "descending", null);
+ break;
+ case 2:
+ d.sortby(m, null, null);
+ break;
+ case 3:
+ d.addgroup(m);
+ break;
+ case 4:
+ d.removegroup(m);
+ break;
+ case 5:
+ var l = b(d.menuitemsarray[6]);
+ b(l).css("display", "block");
+ break;
+ case 7:
+ break
+ }
+ }
+ break
+ }
+ }
+ })
+ },
+ getdatainformation: function() {
+ var d = this.dataview.totalrecords;
+ if (this.summaryrows) {
+ d += this.summaryrows.length
+ }
+ return {
+ rowscount: d,
+ sortinformation: this.getsortinformation(),
+ paginginformation: this.getpaginginformation()
+ }
+ },
+ getsortinformation: function() {
+ return {
+ sortcolumn: this.sortcolumn,
+ sortdirection: this.sortdirection
+ }
+ },
+ getpaginginformation: function() {
+ return {
+ pagenum: this.dataview.pagenum,
+ pagesize: this.pagesize,
+ pagescount: Math.ceil(this.dataview.totalrecords / this.pagesize)
+ }
+ },
+ _updaterowsproperties: function() {
+ this._updatehiddenrows();
+ this._updaterowheights();
+ this._updaterowdetails()
+ },
+ _updatehiddenrows: function() {
+ var e = this.that;
+ this.hiddens = new Array();
+ var d = this.hiddenboundrows;
+ b.each(d,
+ function(g) {
+ if (this.index != undefined) {
+ var f = this.index;
+ var h = e.getrowvisibleindex(g);
+ e.hiddens[h] = this.hidden
+ }
+ })
+ },
+ _updaterowheights: function() {
+ var e = this.that;
+ this.heights = new Array();
+ var d = this.heightboundrows;
+ b.each(d,
+ function(g) {
+ if (this.index != undefined) {
+ var f = this.index;
+ var h = e.getrowvisibleindex(g);
+ e.heights[h] = this.height
+ }
+ })
+ },
+ _updaterowdetails: function() {
+ var d = this.that;
+ this.details = new Array();
+ var e = this.detailboundrows;
+ b.each(e,
+ function(g) {
+ if (this.index != undefined) {
+ var f = this.index;
+ var h = d.getrowvisibleindex(g);
+ d.details[h] = this.details
+ }
+ })
+ },
+ _getmenuitembyindex: function(d) {
+ if (d == undefined) {
+ return null
+ }
+ return this.menuitemsarray[d]
+ },
+ openmenu: function(e) {
+ if (this._openingmenu) {
+ return
+ }
+ this._openingmenu = true;
+ this.closemenu();
+ var h = this.getcolumn(e);
+ if (!h.menu) {
+ return false
+ }
+ if (!this.gridmenu) {
+ this._initmenu()
+ }
+ var d = h.columnsmenu;
+ b(h.element).trigger("mouseenter");
+ this.menuOwner = h;
+ var g = this;
+ for (var f = 0; f < g.columns.records.length; f++) {
+ if (g.columns.records[f].datafield != e) {
+ b(g.columns.records[f].element).trigger("mouseleave")
+ }
+ }
+ setTimeout(function() {
+ if (b(d)[0].style.display == "block") {
+ b(d).trigger("click")
+ }
+ g._openingmenu = false
+ },
+ 200)
+ },
+ closemenu: function() {
+ this._closemenu()
+ },
+ _closemenu: function() {
+ if (this._hasOpenedMenu) {
+ var f = false;
+ if (this.columnmenuclosing) {
+ var i = b.data(document.body, "contextmenu" + this.element.id);
+ if (!i) {
+ i = {
+ column: {
+ displayfield: null
+ }
+ }
+ }
+ f = this.columnmenuclosing(this.gridmenu, i.column.displayfield, b(this.gridmenu).height());
+ if (f === false) {
+ return
+ }
+ }
+ if (this.gridmenu != null) {
+ this.gridmenu.jqxMenu("close")
+ }
+ var i = b.data(document.body, "contextmenu" + this.element.id);
+ var e = 16;
+ if (i != null && this.autoshowcolumnsmenubutton) {
+ if (this.enableanimations) {
+ b(i.columnsmenu).animate({
+ "margin-left": 0
+ },
+ "fast",
+ function() {
+ b(i.columnsmenu).css("display", "none")
+ });
+ var h = !this.rtl ? -32 : 0;
+ i.column.iconscontainer.animate({
+ "margin-left": h
+ },
+ "fast")
+ } else {
+ b(i.columnsmenu).css("display", "none");
+ var h = !this.rtl ? -32 : 0;
+ i.column.iconscontainer.css("margin-left", h)
+ }
+ b.data(document.body, "contextmenu" + this.element.id, null)
+ }
+ this._hasOpenedMenu = false;
+ this.menuOwner = null;
+ var k = this._getmenuitembyindex(5);
+ if (k) {
+ var j = b(k).find("#filter1" + this.element.id);
+ var d = b(k).find("#filter2" + this.element.id);
+ var g = b(k).find("#filter3" + this.element.id);
+ if (j.length > 0 && this.filtermode === "default") {
+ j.jqxDropDownList("hideListBox");
+ if (d.length > 0) {
+ d.jqxDropDownList("hideListBox")
+ }
+ if (g.length > 0) {
+ g.jqxDropDownList("hideListBox")
+ }
+ }
+ }
+ }
+ },
+ scrolloffset: function(e, d) {
+ if (e == null || d == null || e == undefined || d == undefined) {
+ return
+ }
+ this.vScrollBar.jqxScrollBar("setPosition", e);
+ this.hScrollBar.jqxScrollBar("setPosition", d)
+ },
+ scrollleft: function(d) {
+ if (d == null || d == undefined) {
+ return
+ }
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ this.hScrollBar.jqxScrollBar("setPosition", d)
+ }
+ },
+ scrolltop: function(d) {
+ if (d == null || d == undefined) {
+ return
+ }
+ if (this.vScrollBar.css("visibility") != "hidden") {
+ this.vScrollBar.jqxScrollBar("setPosition", d)
+ }
+ },
+ beginupdate: function(e, d) {
+ this._updating = true;
+ this._datachanged = false;
+ if (e === true) {
+ this._batchupdate = true
+ }
+ if (d === true) {
+ this._stopbindings = true
+ }
+ },
+ endupdate: function() {
+ this.resumeupdate()
+ },
+ resumeupdate: function() {
+ this._updating = false;
+ if (this._batchupdate) {
+ this._batchupdate = false;
+ this._datachanged = false;
+ if (!this._stopbindings) {
+ this.render()
+ } else {
+ this.updatebounddata()
+ }
+ return
+ }
+ if (this._stopbindings) {
+ this.updatebounddata("data");
+ return
+ }
+ if (this._datachanged == true) {
+ var d = this.vScrollInstance.value;
+ this.render(true, true, false);
+ this._datachanged = false;
+ if (d != 0 && d < this.vScrollInstance.max) {
+ this.scrolltop(d)
+ }
+ } else {
+ this.rendergridcontent(true);
+ this._renderrows(this.virtualsizeinfo)
+ }
+ if (this.showaggregates && this.renderaggregates) {
+ this.renderaggregates()
+ }
+ this._updatecolumnwidths();
+ this._updatecellwidths();
+ this._renderrows(this.virtualsizeinfo)
+ },
+ updating: function() {
+ return this._updating
+ },
+ showloadelement: function() {
+ if (this.renderloadelement) {
+ this.dataloadelement.html(this.renderloadelement())
+ }
+ this.dataloadelement.width(this.host.width());
+ this.dataloadelement.height(this.host.height());
+ b(this.dataloadelement).css("visibility", "visible");
+ b(this.dataloadelement).css("display", "block")
+ },
+ hideloadelement: function() {
+ b(this.dataloadelement).css("visibility", "hidden");
+ b(this.dataloadelement).css("display", "none")
+ },
+ _updatefocusedfilter: function() {
+ var d = this.that;
+ if (d.focusedfilter) {
+ d.focusedfilter.focus();
+ setTimeout(function() {
+ d.focusedfilter.focus();
+ if (d.focusedfilter[0].nodeName.toLowerCase() == "input") {
+ var g = d.focusedfilter.val().length;
+ try {
+ if ("selectionStart" in d.focusedfilter[0]) {
+ d.focusedfilter[0].setSelectionRange(g, g)
+ } else {
+ var e = d.focusedfilter[0].createTextRange();
+ e.collapse(true);
+ e.moveEnd("character", g);
+ e.moveStart("character", g);
+ e.select()
+ }
+ } catch(f) {}
+ }
+ },
+ 50)
+ }
+ },
+ databind: function(g, i) {
+ if (this.loadingstate === true) {
+ return
+ }
+ if (this._stopbindings === true) {
+ return
+ }
+ if (this.host.css("display") == "block") {
+ if (this.autoshowloadelement) {
+ b(this.dataloadelement).css("visibility", "visible");
+ b(this.dataloadelement).css("display", "block");
+ this.dataloadelement.width(this.host.width());
+ this.dataloadelement.height(this.host.height());
+ this._hideemptyrow()
+ } else {
+ b(this.dataloadelement).css("visibility", "hidden");
+ b(this.dataloadelement).css("display", "none")
+ }
+ }
+ if (!this._initgroupsheader && this.groups.length > 0) {
+ this.groups = new Array()
+ }
+ var f = this.that;
+ if (g == null) {
+ g = {}
+ }
+ if (!g.recordstartindex) {
+ g.recordstartindex = 0
+ }
+ if (!g.recordendindex) {
+ g.recordendindex = 0
+ }
+ if (g.loadallrecords == undefined || g.loadallrecords == null) {
+ g.loadallrecords = true
+ }
+ if (g.sortcomparer == undefined || g.sortcomparer == null) {
+ g.sortcomparer = null
+ }
+ if (g.filter == undefined || g.filter == null) {
+ g.filter = null
+ }
+ if (g.sort == undefined || g.sort == null) {
+ g.sort = null
+ }
+ if (g.data == undefined || g.data == null) {
+ g.data = null
+ }
+ var d = null;
+ if (g != null) {
+ d = g._source != undefined ? g._source.url: g.url
+ }
+ this.dataview = this.dataview || new b.jqx.dataview();
+ if (b.jqx.dataview.sort) {
+ b.extend(this.dataview, new b.jqx.dataview.sort())
+ }
+ if (b.jqx.dataview.grouping) {
+ b.extend(this.dataview, new b.jqx.dataview.grouping())
+ }
+ this.dataview.suspendupdate();
+ this.dataview.pageable = this.pageable;
+ this.dataview.groupable = this.groupable;
+ this.dataview.groups = this.groups;
+ this.dataview.virtualmode = this.virtualmode;
+ this.dataview.grid = this;
+ this.dataview._clearcaches();
+ if (!this.pageable && this.virtualmode) {
+ this.loadondemand = true
+ }
+ if (!f.initializedcall) {
+ if (g._source) {
+ if (this.sortable) {
+ if (g._source.sortcolumn != undefined) {
+ this.sortcolumn = g._source.sortcolumn;
+ this.source.sortcolumn = this.sortcolumn;
+ this.dataview.sortfield = g._source.sortcolumn;
+ g._source.sortcolumn = null
+ }
+ if (g._source.sortdirection != undefined) {
+ this.dataview.sortfielddirection = g._source.sortdirection;
+ var h = g._source.sortdirection;
+ if (h == "a" || h == "asc" || h == "ascending" || h == true) {
+ var e = true
+ } else {
+ var e = false
+ }
+ if (h != null) {
+ this.sortdirection = {
+ ascending: e,
+ descending: !e
+ }
+ } else {
+ this.sortdirection = {
+ ascending: false,
+ descending: false
+ }
+ }
+ }
+ }
+ }
+ if (this.pageable) {
+ if (g._source) {
+ if (g._source.pagenum != undefined) {
+ this.dataview.pagenum = g._source.pagenum
+ }
+ if (g._source.pagesize != undefined) {
+ this.pagesize = g._source.pagesize;
+ this.dataview.pagesize = g._source.pagesize
+ } else {
+ this.dataview.pagesize = g._source.pagesize;
+ if (this.dataview.pagesize == undefined) {
+ this.dataview.pagesize = this.pagesize
+ }
+ }
+ }
+ }
+ if (this.sortable) {
+ if (g.sortcolumn) {
+ this.dataview.sortfield = g.sortcolumn
+ }
+ if (g.sortdirection) {
+ this.dataview.sortfielddirection = g.sortdirection
+ }
+ }
+ if (this.filterable) {
+ if (this.columns) {
+ b.each(this.columns,
+ function() {
+ if (this.filter) {
+ f.dataview.addfilter(this.datafield, this.filter)
+ }
+ })
+ }
+ }
+ }
+ this._loading = true;
+ this.dataview.update = function(l) {
+ if (!f.pageable && f.virtualmode) {
+ f.loadondemand = true
+ }
+ f._loading = false;
+ if (f.dataview.isupdating()) {
+ f.dataview.resumeupdate(false)
+ }
+ if (f.pageable && f.pagerrenderer) {
+ if (f._initpager) {
+ f._initpager()
+ } else {
+ throw new Error("jqxGrid: Missing reference to jqxgrid.pager.js.")
+ }
+ }
+ if ((f.source && f.source.sortcolumn) && f.sortby && !f.virtualmode) {
+ f.render();
+ if (!f.source._source.sort) {
+ f.sortby(f.source.sortcolumn, f.source.sortdirection, f.source.sortcomparer)
+ }
+ f.source.sortcolumn = null
+ } else {
+ var k = f.vScrollInstance.value;
+ var n = f.hScrollInstance.value;
+ var o = f.source ? f.source.datatype: "array";
+ if (o != "local" || o != "array") {
+ var q = f.virtualsizeinfo == null || (f.virtualsizeinfo != null && f.virtualsizeinfo.virtualheight == 0);
+ if (i == "cells") {
+ var m = false;
+ if (f.filterable && f._initfilterpanel && f.dataview.filters.length) {
+ m = true
+ }
+ if (false == l) {
+ if (!f.vScrollInstance.isScrolling() && !f.hScrollInstance.isScrolling()) {
+ f._cellscache = new Array();
+ f._pagescache = new Array();
+ f._renderrows(f.virtualsizeinfo);
+ if (f.showfilterrow && f.filterable && f.filterrow) {
+ f._updatelistfilters(true)
+ }
+ if (f.showaggregates && f._updateaggregates) {
+ f._updateaggregates()
+ }
+ }
+ if (f.sortcolumn) {
+ f.sortby(f.sortcolumn, f.dataview.sortfielddirection, f.source.sortcomparer)
+ }
+ if (f.autoshowloadelement) {
+ b(f.dataloadelement).css("visibility", "hidden");
+ b(f.dataloadelement).css("display", "none")
+ }
+ if (f.virtualmode && !f._loading) {
+ f.loadondemand = true;
+ f._renderrows(f.virtualsizeinfo)
+ }
+ return
+ } else {
+ if (m) {
+ i = "filter"
+ } else {
+ if (f.sortcolumn != undefined) {
+ i = "sort"
+ }
+ }
+ }
+ }
+ if (!f.virtualmode || q || (f.virtualmode && f.pageable)) {
+ if (f.initializedcall == true && i == "pagechanged") {
+ k = 0;
+ if (f.groupable && f.groups.length > 0) {
+ f._render(true, true, false, false, false);
+ f._updatecolumnwidths();
+ f._updatecellwidths();
+ f._renderrows(f.virtualsizeinfo)
+ } else {
+ f.rendergridcontent(true);
+ if (f.pageable && f.updatepagerdetails) {
+ f.updatepagerdetails();
+ if (f.autoheight) {
+ f._updatepageviews();
+ if (f.autorowheight) {
+ f._renderrows(this.virtualsizeinfo)
+ }
+ } else {
+ if (f.autorowheight) {
+ f._updatepageviews();
+ f._renderrows(this.virtualsizeinfo)
+ }
+ }
+ }
+ }
+ if (f.showaggregates && f._updateaggregates) {
+ f._updateaggregates()
+ }
+ } else {
+ if (i == "filter") {
+ if (f.virtualmode) {
+ f._render(true, true, false, false, false);
+ f._updatecolumnwidths();
+ f._updatecellwidths();
+ f._renderrows(f.virtualsizeinfo);
+ f._updatefocusedfilter()
+ } else {
+ f._render(true, true, false, false, false);
+ f._updatecolumnwidths();
+ f._updatecellwidths();
+ f._renderrows(f.virtualsizeinfo);
+ f._updatefocusedfilter()
+ }
+ } else {
+ if (i == "sort") {
+ if (f.virtualmode) {
+ f.rendergridcontent(true);
+ if (f.showaggregates && f._updateaggregates) {
+ f._updateaggregates()
+ }
+ } else {
+ f._render(true, true, false, false, false);
+ if (f.sortcolumn && !f.source.sort) {
+ f.sortby(f.sortcolumn, f.dataview.sortfielddirection, f.source.sortcomparer)
+ }
+ }
+ if (f.source.sort) {
+ f._updatefocusedfilter()
+ }
+ } else {
+ if (i == "data") {
+ f._render(true, true, false, false, false)
+ } else {
+ if (i == "state") {
+ f._render(true, true, false, f.menuitemsarray && f.menuitemsarray.length > 0 && !f.virtualmode)
+ } else {
+ f._render(true, true, true, f.menuitemsarray && f.menuitemsarray.length > 0 && !f.virtualmode)
+ }
+ }
+ }
+ }
+ }
+ } else {
+ if (f.virtualmode && l == true && !f.pageable) {
+ f._render(true, true, false, false, false);
+ f._updatefocusedfilter();
+ f._updatecolumnwidths();
+ f._updatecellwidths();
+ f._renderrows(f.virtualsizeinfo)
+ } else {
+ if (f.virtualmode && !f.pageable && l == false && i != undefined) {
+ f.rendergridcontent(true);
+ if (f.showaggregates && f._updateaggregates) {
+ f._updateaggregates()
+ }
+ } else {
+ if (f.virtualmode && f.dataview.totalrecords == 0 && f.dataview.filters.length > 0) {
+ f._render(true, true, true, f.menuitemsarray && !f.virtualmode)
+ } else {
+ f._pagescache = new Array();
+ f._renderrows(f.virtualsizeinfo)
+ }
+ }
+ }
+ }
+ if (f.vScrollInstance.value != k && k <= f.vScrollInstance.max) {
+ f.vScrollInstance.setPosition(k)
+ }
+ if (f.hScrollInstance.value != n && n <= f.hScrollInstance.max) {
+ f.hScrollInstance.setPosition(n)
+ }
+ }
+ }
+ if (f.autoshowloadelement) {
+ b(f.dataloadelement).css("visibility", "hidden");
+ b(f.dataloadelement).css("display", "none")
+ }
+ if (f.pageable) {
+ if (f.pagerrightbutton) {
+ f.pagerrightbutton.jqxButton({
+ disabled: false
+ });
+ f.pagerleftbutton.jqxButton({
+ disabled: false
+ });
+ f.pagershowrowscombo.jqxDropDownList({
+ disabled: false
+ })
+ }
+ if (f.pagerfirstbutton) {
+ f.pagerfirstbutton.jqxButton({
+ disabled: false
+ });
+ f.pagerlastbutton.jqxButton({
+ disabled: false
+ })
+ }
+ }
+ f._raiseEvent(11);
+ if (!f.initializedcall) {
+ var p = function() {
+ f._raiseEvent(0);
+ f.initializedcall = true;
+ f.isInitialized = true;
+ if (f.ready) {
+ f.ready()
+ }
+ if (f.renderstatusbar) {
+ f.renderstatusbar(f.statusbar)
+ }
+ if (f.rendertoolbar) {
+ f.rendertoolbar(f.toolbar)
+ }
+ if (f.autoloadstate) {
+ if (f.loadstate) {
+ f.loadstate(null, true)
+ }
+ }
+ };
+ if (!b.jqx.isHidden(f.host)) {
+ p()
+ } else {
+ if (f.readyInterval) {
+ clearInterval(f.readyInterval)
+ }
+ f.readyInterval = setInterval(function() {
+ if (!b.jqx.isHidden(f.host)) {
+ if (f.__isRendered) {
+ clearInterval(f.readyInterval);
+ f.readyInterval = null;
+ p();
+ f._initmenu()
+ }
+ }
+ },
+ 200)
+ }
+ if ((f.width != null && f.width.toString().indexOf("%") != -1) || (f.height != null && f.height.toString().indexOf("%") != -1)) {}
+ if (f.host.css("visibility") == "hidden") {
+ var j = b.jqx.browser.msie && b.jqx.browser.version < 8;
+ if (f.vScrollBar.css("visibility") == "visible") {
+ f.vScrollBar.css("visibility", "inherit")
+ }
+ if (!f.autowidth) {
+ if (f.hScrollBar.css("visibility") == "visible") {
+ f.hScrollBar.css("visibility", "inherit")
+ }
+ }
+ f._intervalTimer = setInterval(function() {
+ if (f.host.css("visibility") == "visible") {
+ f._updatesize(true);
+ clearInterval(f._intervalTimer)
+ }
+ },
+ 100)
+ }
+ } else {
+ f._updateTouchScrolling()
+ }
+ };
+ this.dataview.databind(g);
+ if (this.dataview.isupdating()) {
+ if (d != undefined) {
+ this.dataview.suspend = false
+ } else {
+ this.dataview.resumeupdate(false)
+ }
+ }
+ this._initializeRows()
+ },
+ scrollto: function(e, d) {
+ if (undefined != e) {
+ this.hScrollInstance.setPosition(e)
+ }
+ if (undefined != d) {
+ this.vScrollInstance.setPosition(d)
+ }
+ },
+ scrollposition: function() {
+ return {
+ top: this.vScrollInstance.value,
+ left: this.hScrollInstance.value
+ }
+ },
+ ensurerowvisible: function(h) {
+ if (this.autoheight && !this.pageable) {
+ return true
+ }
+ var e = this._getpagesize();
+ var g = Math.floor(h / e);
+ if (!this._pageviews[g] && !this.pageable) {
+ this._updatepageviews()
+ }
+ var n = false;
+ if (this.pageable && this.gotopage && !this.virtualmode) {
+ var g = Math.floor(h / e);
+ if (this.dataview.pagenum != g) {
+ if (this.groupable && this.groups.length > 0) {
+ return true
+ }
+ this.gotopage(g);
+ n = true
+ }
+ }
+ var l = this.vScrollInstance.value;
+ var m = this._gettableheight() - this.rowsheight;
+ var d = e * (h / e - g);
+ d = Math.round(d);
+ if (this._pageviews[g]) {
+ var k = this._pageviews[g].top;
+ var j = k + d * this.rowsheight;
+ if (this.rowdetails) {
+ for (var f = e * g; f < h; f++) {
+ if (this.details[f]) {
+ if (this.details[f].rowdetailshidden == false) {
+ j += this.details[f].rowdetailsheight
+ }
+ }
+ }
+ }
+ if (this.scrollmode == "deferred") {
+ if (this.vScrollInstance.max <= j + this.rowsheight) {
+ j = this.vScrollInstance.max
+ }
+ }
+ if (j < l) {
+ this.scrolltop(j);
+ n = true
+ } else {
+ if (j > l + m + 2) {
+ this.scrolltop(j - m);
+ n = true
+ } else {}
+ }
+ } else {
+ if (this.pageable) {
+ var j = d * this.rowsheight;
+ if (this.rowdetails) {
+ for (var f = e * g; f < e * g + d; f++) {
+ if (this.details[f] && this.details[f].rowdetailshidden == false) {
+ j += this.details[f].rowdetailsheight
+ }
+ }
+ }
+ if (j < l || j > l + m) {
+ this.scrollto(0, j);
+ n = true
+ }
+ }
+ }
+ return n
+ },
+ ensurecellvisible: function(h, d) {
+ var n = this.that;
+ var i = this.hScrollBar.jqxScrollBar("value");
+ var j = n.hScrollInstance.max;
+ if (n.rtl) {
+ if (this.hScrollBar.css("visibility") != "visible") {
+ j = 0
+ }
+ }
+ var o = this.ensurerowvisible(h);
+ var e = 0;
+ if (this.columns.records) {
+ var m = i;
+ if (this.hScrollBar.css("visibility") == "hidden") {
+ return
+ }
+ var l = this.host.width();
+ var k = 0;
+ var f = this.vScrollBar.css("visibility") == "visible" ? 20 : 0;
+ var g = false;
+ b.each(this.columns.records,
+ function() {
+ if (this.hidden) {
+ return true
+ }
+ if (this.datafield == d) {
+ var q = 0;
+ var p = !n.rtl ? m: j - i;
+ if (e + this.width > p + l - f) {
+ q = e + this.width - l + f;
+ if (n.rtl) {
+ q = j - q
+ }
+ n.scrollleft(q);
+ g = true
+ } else {
+ if (e <= p) {
+ q = e - this.width;
+ if (n.rtl) {
+ q = j - q
+ }
+ n.scrollleft(q);
+ g = true
+ }
+ }
+ if (k == 0) {
+ if (n.rtl) {
+ n.scrollleft(j)
+ } else {
+ n.scrollleft(0)
+ }
+ g = true
+ } else {
+ if (k == n.columns.records.length - 1) {
+ if (n.hScrollBar.css("visibility") == "visible") {
+ if (!n.rtl) {
+ n.scrollleft(n.hScrollBar.jqxScrollBar("max"))
+ } else {
+ n.scrollleft(n.hScrollBar.jqxScrollBar("min"))
+ }
+ g = true
+ }
+ }
+ }
+ return false
+ }
+ k++;
+ e += this.width
+ });
+ if (!g) {
+ n.scrollleft(m)
+ }
+ }
+ return o
+ },
+ setrowheight: function(e, d) {
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ if (e == null || d == null) {
+ return false
+ }
+ this.heightboundrows[e] = {
+ index: e,
+ height: d
+ };
+ e = this.getrowvisibleindex(e);
+ if (e < 0) {
+ return false
+ }
+ if (this.rows.records[e]) {
+ this.rows.records[e].height = d
+ } else {
+ row = new a(this, null);
+ row.height = d;
+ this.rows.replace(e, row)
+ }
+ this.heights[e] = d;
+ this.rendergridcontent(true);
+ return true
+ },
+ getrowheight: function(d) {
+ if (d == null) {
+ return null
+ }
+ d = this.getrowvisibleindex(d);
+ if (d < 0) {
+ return false
+ }
+ if (this.rows.records[d]) {
+ return this.rows.records[d].height
+ }
+ },
+ setrowdetails: function(f, h, d, j) {
+ if (f == undefined || f == null || f < 0) {
+ return
+ }
+ var e = f + "_";
+ if (this._rowdetailscache[e]) {
+ var g = this._rowdetailscache[e].element;
+ b(g).remove();
+ this._rowdetailscache[e] = null
+ }
+ var i = this.dataview.generatekey();
+ this.detailboundrows[f] = {
+ index: f,
+ details: {
+ rowdetails: h,
+ rowdetailsheight: d,
+ rowdetailshidden: j,
+ key: i
+ }
+ };
+ f = this.getrowvisibleindex(f);
+ if (f < 0) {
+ return false
+ }
+ return this._setrowdetails(f, h, d, j, i)
+ },
+ getcolumn: function(d) {
+ var e = null;
+ if (this.columns.records) {
+ b.each(this.columns.records,
+ function() {
+ if (this.datafield == d || this.displayfield == d) {
+ e = this;
+ return false
+ }
+ })
+ }
+ return e
+ },
+ _getcolumnindex: function(e) {
+ var d = -1;
+ if (this.columns.records) {
+ b.each(this.columns.records,
+ function() {
+ d++;
+ if (this.datafield == e) {
+ return false
+ }
+ })
+ }
+ return d
+ },
+ _getcolumnat: function(d) {
+ var e = this.columns.records[d];
+ return e
+ },
+ _getprevvisiblecolumn: function(e) {
+ var d = this.that;
+ while (e > 0) {
+ e--;
+ var f = d.getcolumnat(e);
+ if (!f) {
+ return null
+ }
+ if (!f.hidden) {
+ return f
+ }
+ }
+ return null
+ },
+ _getnextvisiblecolumn: function(e) {
+ var d = this.that;
+ while (e < this.columns.records.length) {
+ e++;
+ var f = d.getcolumnat(e);
+ if (!f) {
+ return null
+ }
+ if (!f.hidden) {
+ return f
+ }
+ }
+ return null
+ },
+ getcolumnat: function(d) {
+ if (!isNaN(d)) {
+ var e = this.columns.records[d];
+ return e
+ }
+ return null
+ },
+ _getcolumn: function(d) {
+ var e = null;
+ b.each(this._columns,
+ function() {
+ if (this.datafield == d || this.displayfield == d) {
+ e = this;
+ return false
+ }
+ });
+ return e
+ },
+ _setcolumnproperty: function(e, g, h) {
+ if (e == null || g == null || h == null) {
+ return null
+ }
+ g = g.toLowerCase();
+ var f = this.getcolumn(e);
+ if (f == null) {
+ return
+ }
+ var i = f[g];
+ f[g] = h;
+ var d = this._getcolumn(e);
+ if (d != null) {
+ d[g] = h
+ }
+ this._cellscache = new Array();
+ switch (g) {
+ case "filteritems":
+ if (this.filterable && this.showfilterrow) {
+ this._updatelistfilters(true, true)
+ }
+ break;
+ case "text":
+ this.prerenderrequired = true;
+ this._rendercolumnheaders();
+ this._updatecellwidths();
+ if (this._groupsheader()) {
+ if (this._initgroupsheader) {
+ this._initgroupsheader()
+ }
+ }
+ this._renderrows(this.virtualsizeinfo);
+ break;
+ case "editable":
+ case "resizable":
+ case "draggable":
+ if (g == "editable") {
+ if (h != i) {
+ if (this.editcell != null && this.endcelledit) {
+ this.endcelledit(this.editcell.row, this.editcell.column, true, true)
+ }
+ if (f.columntype == "checkbox") {
+ this.prerenderrequired = true;
+ this.rendergridcontent(true, false);
+ if (this.updating()) {
+ return false
+ }
+ }
+ if (this.updating()) {
+ return false
+ }
+ this._renderrows(this.virtualsizeinfo)
+ }
+ }
+ break;
+ case "hidden":
+ case "hideable":
+ case "renderer":
+ case "cellsrenderer":
+ case "align":
+ case "aggregates":
+ case "cellsalign":
+ case "cellsformat":
+ case "pinned":
+ case "contenttype":
+ case "filterable":
+ case "groupable":
+ case "cellclass":
+ case "cellclassname":
+ case "classname":
+ case "class":
+ this.prerenderrequired = true;
+ if (g == "pinned") {
+ this._initializeColumns();
+ this._preparecolumngroups()
+ }
+ this.rendergridcontent(true);
+ if (this.updating()) {
+ return false
+ }
+ if (g == "hidden") {
+ this._updatecolumnwidths();
+ this._updatecellwidths()
+ }
+ this._renderrows(this.virtualsizeinfo);
+ if (this.showaggregates && this._updateaggregates) {
+ this._updateaggregates()
+ }
+ break;
+ case "width":
+ case "minwidth":
+ case "maxwidth":
+ if (this.updating()) {
+ return false
+ }
+ f._width = null;
+ f._percentagewidth = null;
+ this._updatecolumnwidths();
+ this._updatecellwidths();
+ this._renderrows(this.virtualsizeinfo);
+ break
+ }
+ },
+ _getcolumnproperty: function(d, f) {
+ if (d == null || f == null) {
+ return null
+ }
+ f = f.toLowerCase();
+ var e = this.getcolumn(d);
+ return e[f]
+ },
+ setcolumnproperty: function(d, e, f) {
+ this._setcolumnproperty(d, e, f)
+ },
+ getcolumnproperty: function(d, e) {
+ return this._getcolumnproperty(d, e)
+ },
+ hidecolumn: function(d) {
+ this._setcolumnproperty(d, "hidden", true)
+ },
+ showcolumn: function(d) {
+ this._setcolumnproperty(d, "hidden", false)
+ },
+ iscolumnvisible: function(d) {
+ return ! this._getcolumnproperty(d, "hidden")
+ },
+ pincolumn: function(d) {
+ this._setcolumnproperty(d, "pinned", true)
+ },
+ unpincolumn: function(d) {
+ this._setcolumnproperty(d, "pinned", false)
+ },
+ iscolumnpinned: function(d) {
+ return this._getcolumnproperty(d, "pinned")
+ },
+ _setrowdetails: function(j, d, n, h, e) {
+ if (n == 0) {
+ n = 100
+ }
+ if (j == null || n == null) {
+ return false
+ }
+ if (e != null) {
+ this.details[j] = {
+ rowdetails: d,
+ rowdetailsheight: n,
+ rowdetailshidden: h,
+ detailskey: e
+ }
+ } else {
+ var m = this.details[j] != null ? this.details[j].detailskey: null;
+ var l = {
+ rowdetails: d,
+ rowdetailsheight: n,
+ rowdetailshidden: h,
+ detailskey: m
+ };
+ var k = this.that;
+ for (var g = 0; g < this.detailboundrows.length; g++) {
+ if (this.detailboundrows[g] != undefined) {
+ var f = this.detailboundrows[g];
+ if (f.details.detailskey == m) {
+ f.details.rowdetailsheight = l.rowdetailsheight;
+ f.details.rowdetailshidden = l.rowdetailshidden;
+ f.details.rowdetails = l.rowdetails;
+ break
+ }
+ }
+ }
+ this.details[j] = l
+ }
+ this.rendergridcontent(true);
+ this._updatecolumnwidths();
+ this._updatecellwidths();
+ this._renderrows(this.virtualsizeinfo);
+ return true
+ },
+ getrowdetails: function(d) {
+ if (d == null) {
+ return false
+ }
+ d = this.getrowvisibleindex(d);
+ return this._getrowdetails(d)
+ },
+ _getrowdetails: function(d) {
+ if (d == null) {
+ return false
+ }
+ if (d < 0) {
+ return false
+ }
+ if (this.details[d]) {
+ return this.details[d]
+ }
+ if (this.rowdetailstemplate) {
+ return this.rowdetailstemplate
+ }
+ },
+ getrecordscount: function() {
+ return this.dataview.totalrecords
+ },
+ showrowdetails: function(d) {
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ if (d == null) {
+ return false
+ }
+ d = this.getrowvisibleindex(d);
+ if (d < 0) {
+ return false
+ }
+ var e = this._getrowdetails(d);
+ return this._setrowdetailsvisibility(d, e, false)
+ },
+ hiderowdetails: function(d) {
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ d = this.getrowvisibleindex(d);
+ if (d < 0) {
+ return false
+ }
+ var e = this._getrowdetails(d);
+ return this._setrowdetailsvisibility(d, e, true)
+ },
+ _togglerowdetails: function(i) {
+ var f = i.visibleindex;
+ var g = this._getrowdetails(f);
+ if (g != null) {
+ var e = this.vScrollInstance.value;
+ var h = !g.rowdetailshidden;
+ var d = this._setrowdetailsvisibility(f, g, h);
+ if (e !== 0 && this.vScrollBar.css("visibility") !== "hidden") {
+ if (e <= this.vScrollInstance.max) {
+ this.vScrollInstance.setPosition(e)
+ } else {
+ this.vScrollInstance.setPosition(this.vScrollInstance.max)
+ }
+ }
+ return d
+ }
+ return false
+ },
+ _setrowdetailsvisibility: function(e, f, h) {
+ if (this.rowdetailstemplate) {
+ if (!this.details) {
+ this.details = new Array()
+ }
+ if (!this.details[e]) {
+ this.details[e] = {
+ rowdetailshidden: this.rowdetailstemplate.rowdetailshidden,
+ rowdetailsheight: this.rowdetailstemplate.rowdetailsheight,
+ rowdetails: this.rowdetailstemplate.rowdetails
+ };
+ var g = this.dataview.generatekey();
+ this.details[e].detailskey = g;
+ this.detailboundrows[e] = {
+ index: e,
+ details: this.details[e]
+ }
+ }
+ }
+ if (f != null) {
+ this.details[e].rowdetailshidden = h
+ } else {
+ return false
+ }
+ var d = this.details[e];
+ if (h) {
+ this._raiseEvent(21, {
+ rowindex: e,
+ details: d.rowdetails,
+ height: d.rowdetailsheight
+ })
+ } else {
+ this._raiseEvent(20, {
+ rowindex: e,
+ details: d.rowdetails,
+ height: d.rowdetailsheight
+ })
+ }
+ return this._setrowdetails(e, d.rowdetails, d.rowdetailsheight, d.rowdetailshidden)
+ },
+ getrowvisibleindex: function(d) {
+ if (d == undefined || d == null || d < 0) {
+ return false
+ }
+ if (this.virtualmode) {
+ var e = this.dataview.loadedrecords[d];
+ if (e == undefined) {
+ return - 1
+ }
+ return e.visibleindex
+ }
+ return this.getrowdisplayindex(d)
+ },
+ hiderow: function(d) {
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ if (d == undefined || d == null || d < 0) {
+ return false
+ }
+ if (d == null) {
+ return false
+ }
+ this.hiddenboundrows[d] = {
+ index: d,
+ hidden: true
+ };
+ d = this.getrowvisibleindex(d);
+ return this._setrowvisibility(d, true)
+ },
+ showrow: function(d) {
+ if (this._loading) {
+ throw new Error("jqxGrid: " + this.loadingerrormessage);
+ return false
+ }
+ if (d == undefined || d == null || d < 0) {
+ return false
+ }
+ if (d == null) {
+ return false
+ }
+ this.hiddenboundrows[d] = {
+ index: d,
+ hidden: false
+ };
+ d = this.getrowvisibleindex(d);
+ return this._setrowvisibility(d, false)
+ },
+ isrowhiddenat: function(d) {
+ if (d == null) {
+ return null
+ }
+ d = this.getrowvisibleindex(d);
+ if (this.rows.records[d]) {
+ return this.rows.records[d].hidden
+ }
+ },
+ _setrowvisibility: function(d, f, e) {
+ if (d == null) {
+ return false
+ }
+ this.hiddens[d] = f;
+ if (e == undefined || e) {
+ this.rendergridcontent(true);
+ return true
+ }
+ return false
+ },
+ _loadrows: function() {
+ if (!this._pageviews[this.dataview.pagenum] && !this.pageable) {
+ return
+ }
+ var p = !this.pageable ? this._pageviews[this.dataview.pagenum].top: 0;
+ if (!this.pageable && this._pagescache[this.dataview.pagenum] != undefined) {
+ return null
+ }
+ if (!this.virtualsizeinfo) {
+ return
+ }
+ var t = this.that;
+ var l = new Array();
+ var q = new Array();
+ var e = t.groupable && t.groups.length > 0;
+ var j = this.dataview.totalrecords;
+ var o = this.virtualsizeinfo.virtualheight;
+ var s = 0;
+ this.rows.beginupdate();
+ var f = this.dataview.pagesize;
+ if (this.pageable && e) {
+ f = this.dataview.rows.length
+ }
+ for (var g = 0; g < f; g++) {
+ if (g >= this.dataview.rows.length) {
+ break
+ }
+ var k = this.dataview.rows[g];
+ var u = null;
+ if (!t.rows.records[k.visibleindex]) {
+ u = new a(t, k)
+ } else {
+ u = t.rows.records[k.visibleindex];
+ u.setdata(k)
+ }
+ u.hidden = this.hiddens[u.visibleindex];
+ if (this.rowdetailstemplate) {
+ u.rowdetails = this.rowdetailstemplate.rowdetails;
+ u.rowdetailsheight = this.rowdetailstemplate.rowdetailsheight;
+ u.rowdetailshidden = this.rowdetailstemplate.rowdetailshidden
+ }
+ var d = this.details[u.visibleindex];
+ if (d) {
+ u.rowdetails = d.rowdetails;
+ u.rowdetailsheight = d.rowdetailsheight;
+ u.rowdetailshidden = d.rowdetailshidden
+ } else {
+ if (!this.rowdetailstemplate) {
+ u.rowdetails = null
+ }
+ }
+ if (e && this.pageable && u.parentbounddata != null) {
+ var r = l[u.parentbounddata.uniqueid];
+ if (r != null) {
+ var n = this._findgroupstate(r.uniqueid);
+ if (this._setsubgroupsvisibility) {
+ this._setsubgroupsvisibility(this, u.parentbounddata, !n, false)
+ }
+ u.hidden = this.hiddens[u.visibleindex]
+ }
+ if (r != null && r != undefined) {
+ u.parentrow = r;
+ r.subrows[r.subrows.length++] = u
+ }
+ }
+ if (u.hidden) {
+ continue
+ }
+ var h = k.visibleindex;
+ if (!this.heights[h]) {
+ this.heights[h] = this.rowsheight
+ }
+ u.height = this.heights[h];
+ if (this.rowdetails) {
+ if (u.rowdetails && !u.rowdetailshidden) {
+ u.height += u.rowdetailsheight
+ }
+ }
+ l[u.uniqueid] = u;
+ q[s++] = u;
+ u.top = p;
+ p += u.height;
+ var m = h;
+ t.rows.replace(m, u)
+ }
+ if ((this.autoheight || this.pageable) && this.autorowheight) {
+ if (this._pageviews && this._pageviews.length > 0) {
+ this._pageviews[0].height = p
+ }
+ }
+ this.rows.resumeupdate();
+ if (q.length > 0) {
+ this._pagescache[this.dataview.pagenum] = q
+ }
+ },
+ _updateaddnewrowui: function(g) {
+ var m = this;
+ var k = m.everpresentrowposition != "bottom" ? m.addnewrowtop: m.addnewrowbottom;
+ var o = m.columns.records.length;
+ var f = 0;
+ for (var l = 0; l < o; l++) {
+ var h = m.columns.records[l];
+ if (h.addnewrowwidget) {
+ h.addnewrowwidget.detach()
+ }
+ }
+ for (var l = 0; l < o; l++) {
+ var h = m.columns.records[l];
+ var e = h.width;
+ if (e < h.minwidth) {
+ e = h.minwidth
+ }
+ if (e > h.maxwidth) {
+ e = h.maxwidth
+ }
+ var n = b(k[0].cells[l]);
+ n.css("left", f);
+ var i = true;
+ if (n.width() == e) {
+ i = false
+ }
+ if (g) {
+ i = true
+ }
+ n.width(e);
+ n[0].left = f;
+ if (h.addnewrowwidget) {
+ n.html("");
+ n.append(h.addnewrowwidget)
+ }
+ if (! (h.hidden && h.hideable)) {
+ f += e
+ } else {
+ n.css("display", "none")
+ }
+ if (!i) {
+ continue
+ }
+ }
+ var p = m.everpresentrowactions.split(" ");
+ m.addnewrowbutton.show();
+ m.addnewrowupdatebutton.show();
+ m.addnewrowresetbutton.show();
+ m.addnewrowdeletebutton.show();
+ if (p.indexOf("add") == -1 && p.indexOf("addBottom") == -1) {
+ m.addnewrowbutton.hide()
+ }
+ if (p.indexOf("update") == -1) {
+ m.addnewrowupdatebutton.hide()
+ }
+ if (p.indexOf("reset") == -1) {
+ m.addnewrowresetbutton.hide()
+ }
+ if (p.indexOf("delete") == -1) {
+ m.addnewrowdeletebutton.hide()
+ }
+ var d = b(k.children()[0]);
+ d.width(parseInt(f) + 2);
+ d.height(m.everpresentrowheight);
+ d.css("max-height", m.everpresentrowheight + "px")
+ },
+ _removeaddnewrow: function() {
+ var g = this;
+ var d = g.columns.records.length;
+ for (var f = 0; f < d; f++) {
+ var e = g.columns.records[f];
+ if (e.addnewrowwidget) {
+ if (e.destroyeverpresentrowwidget) {
+ e.destroyeverpresentrowwidget(e.addnewrowwidget)
+ } else {
+ e.addnewrowwidget.remove()
+ }
+ e.addnewrowwidget = null
+ }
+ }
+ if (g.addnewrowbutton) {
+ g.addnewrowbutton.remove()
+ }
+ if (g.addnewrowupdatebutton) {
+ g.addnewrowupdatebutton.remove()
+ }
+ if (g.addnewrowdeletebutton) {
+ g.addnewrowdeletebutton.remove()
+ }
+ if (g.addnewrowresetbutton) {
+ g.addnewrowresetbutton.remove()
+ }
+ if (g.addnewrowpopup) {
+ g.addnewrowpopup.remove();
+ g.addnewrowpopup = null
+ }
+ if (g.addnewrowtop) {
+ g.addnewrowtop.remove();
+ g.addnewrowtop = null
+ }
+ if (g.addnewrowbottom) {
+ g.addnewrowbottom.remove();
+ g.addnewrowbottom = null
+ }
+ },
+ _updateaddnewrow: function() {
+ var o = this;
+ var f = o.everpresentrowposition != "bottom" ? o.addnewrowtop: o.addnewrowbottom;
+ var t = b('');
+ var i = 0;
+ var z = o.columns.records.length;
+ var n = o.toThemeProperty("jqx-grid-cell");
+ n += " " + o.toThemeProperty("jqx-grid-cell-add-new-row");
+ n += " " + o.toThemeProperty("jqx-grid-cell-filter-row");
+ var m = z + 10;
+ var h = new Array();
+ var D = o.that;
+ f[0].cells = h;
+ t.height(o.everpresentrowheight);
+ if (!o.showfilterrow && o.everpresentrowposition != "bottom") {
+ f.css("max-height", (o.everpresentrowheight - 1) + "px")
+ } else {
+ if (o.showfilterrow && o.everpresentrowposition != "bottom") {
+ f.css("max-height", (o.everpresentrowheight - 3) + "px")
+ }
+ }
+ t.css("max-height", o.everpresentrowheight + "px");
+ f.append(t);
+ var C = b("").appendTo(b(document.body));
+ var d = b("
");
+ var q = b("
");
+ var k = b("
");
+ var p = b("
");
+ C.addClass(o.toThemeProperty("jqx-popup"));
+ C.addClass(o.toThemeProperty("jqx-rc-all"));
+ C.addClass(o.toThemeProperty("jqx-fill-state-normal"));
+ C.addClass(o.toThemeProperty("jqx-shadow"));
+ C.append(d);
+ C.append(q);
+ C.append(k);
+ C.append(p);
+ var g = o.everpresentrowactions.split(" ");
+ if (g.indexOf("add") == -1 && g.indexOf("addBottom") == -1) {
+ d.hide()
+ }
+ if (g.indexOf("update") == -1) {
+ q.hide()
+ }
+ if (g.indexOf("reset") == -1) {
+ p.hide()
+ }
+ if (g.indexOf("delete") == -1) {
+ k.hide()
+ }
+ o.addnewrowpopup = C;
+ o.addnewrowbutton = d;
+ o.addnewrowupdatebutton = q;
+ o.addnewrowdeletebutton = k;
+ o.addnewrowresetbutton = p;
+ d.jqxButton({
+ template: "success",
+ theme: o.theme
+ });
+ k.jqxButton({
+ template: "danger",
+ theme: o.theme
+ });
+ q.jqxButton({
+ template: "primary",
+ theme: o.theme
+ });
+ p.jqxButton({
+ template: "warning",
+ theme: o.theme
+ });
+ q.mousedown(function(E) {
+ var P = {};
+ var I = {};
+ for (var G = 0; G < z; G++) {
+ var F = o.columns.records[G];
+ if (!F.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var L = F.geteverpresentrowwidgetvalue(F.displayfield, F.addnewrowwidget);
+ I[F.datafield] = L;
+ if (F.datafield != F.displayfield) {
+ I[F.datafield] = L.value;
+ I[F.displayfield] = L.label
+ }
+ }
+ var K = false;
+ for (var G = 0; G < z; G++) {
+ var F = o.columns.records[G];
+ if (!F.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var L = F.geteverpresentrowwidgetvalue(F.displayfield, F.addnewrowwidget);
+ if (F.createeverpresentrowwidget && F.validateeverpresentrowwidgetvalue) {
+ var J = F.validateeverpresentrowwidgetvalue(F.displayfield, L, I);
+ var O = J;
+ var H = o.gridlocalization.validationstring;
+ if (O.message != undefined) {
+ H = O.message
+ }
+ var N = typeof O == "boolean" ? O: O.result;
+ if (!N) {
+ L = "invalid editor state";
+ F.addnewrowwidget.attr("title", H);
+ F.addnewrowwidget.addClass(o.toThemeProperty("jqx-input-invalid"))
+ } else {
+ F.addnewrowwidget.attr("title", "");
+ F.addnewrowwidget.removeClass(o.toThemeProperty("jqx-input-invalid"))
+ }
+ }
+ if (L === "invalid editor state") {
+ E.preventDefault();
+ E.stopPropagation();
+ K = true;
+ continue
+ }
+ if (K) {
+ continue
+ }
+ }
+ if (K) {
+ C.hide();
+ o.focus();
+ return
+ }
+ for (var G = 0; G < z; G++) {
+ var F = o.columns.records[G];
+ if (!F.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var L = F.geteverpresentrowwidgetvalue(F.displayfield, F.addnewrowwidget);
+ P[F.datafield] = L;
+ if (F.datafield != F.displayfield) {
+ P[F.datafield] = L.value;
+ P[F.displayfield] = L.label
+ }
+ if (F.reseteverpresentrowwidgetvalue) {
+ F.reseteverpresentrowwidgetvalue(F.displayfield, F.addnewrowwidget)
+ }
+ }
+ if (o.selectedcells.length > 0 || o.selectedrowindexes.length > 0) {
+ if (o.selectionmode.indexOf("cell") >= 0) {
+ var M = o.getselectedcells()[0].rowindex
+ } else {
+ var M = o.selectedrowindexes[0]
+ }
+ rowData = o.getrowdata(M);
+ if (rowData) {
+ o.updaterow(rowData.uid, P)
+ }
+ }
+ C.hide();
+ o.focus()
+ });
+ k.mousedown(function(G) {
+ if (o.selectedcells.length > 0 || o.selectedrowindexes.length > 0) {
+ if (o.selectionmode.indexOf("cell") >= 0) {
+ var H = o.getselectedcells()[0].rowindex
+ } else {
+ var H = o.selectedrowindexes[0]
+ }
+ rowData = o.getrowdata(H);
+ if (rowData) {
+ o.deleterow(rowData.uid)
+ }
+ }
+ for (var F = 0; F < z; F++) {
+ var E = o.columns.records[F];
+ if (E.reseteverpresentrowwidgetvalue) {
+ E.reseteverpresentrowwidgetvalue(E.displayfield, E.addnewrowwidget)
+ }
+ }
+ C.hide();
+ o.focus();
+ o.updateeverpresentrow()
+ });
+ d.mousedown(function(F) {
+ var P = {};
+ var J = {};
+ for (var H = 0; H < z; H++) {
+ var G = o.columns.records[H];
+ if (!G.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var M = G.geteverpresentrowwidgetvalue(G.displayfield, G.addnewrowwidget);
+ J[G.datafield] = M;
+ if (G.datafield != G.displayfield) {
+ J[G.datafield] = M.value;
+ J[G.displayfield] = M.label
+ }
+ if (G.datafield != G.displayfield) {
+ J[G.datafield] = M.label;
+ J[G.displayfield] = M.value
+ }
+ }
+ var L = false;
+ for (var H = 0; H < z; H++) {
+ var G = o.columns.records[H];
+ if (!G.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var M = G.geteverpresentrowwidgetvalue(G.displayfield, G.addnewrowwidget);
+ if (G.createeverpresentrowwidget && G.validateeverpresentrowwidgetvalue) {
+ var K = G.validateeverpresentrowwidgetvalue(G.displayfield, M, J);
+ var O = K;
+ var I = o.gridlocalization.validationstring;
+ if (O.message != undefined) {
+ I = O.message
+ }
+ var N = typeof O == "boolean" ? O: O.result;
+ if (!N) {
+ M = "invalid editor state";
+ G.addnewrowwidget.attr("title", I);
+ G.addnewrowwidget.addClass(o.toThemeProperty("jqx-input-invalid"))
+ } else {
+ G.addnewrowwidget.attr("title", "");
+ G.addnewrowwidget.removeClass(o.toThemeProperty("jqx-input-invalid"))
+ }
+ }
+ if (M === "invalid editor state") {
+ F.preventDefault();
+ F.stopPropagation();
+ L = true;
+ continue
+ }
+ if (L) {
+ continue
+ }
+ }
+ if (L) {
+ C.hide();
+ o.focus();
+ return
+ }
+ for (var H = 0; H < z; H++) {
+ var G = o.columns.records[H];
+ if (!G.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var M = G.geteverpresentrowwidgetvalue(G.displayfield, G.addnewrowwidget);
+ P[G.datafield] = M;
+ if (G.datafield != G.displayfield) {
+ J[G.datafield] = M.label;
+ J[G.displayfield] = M.value
+ }
+ if (G.reseteverpresentrowwidgetvalue) {
+ G.reseteverpresentrowwidgetvalue(G.displayfield, G.addnewrowwidget)
+ }
+ }
+ var E = o.everpresentrowactions.indexOf("addBottom") >= 0 ? "last": "first";
+ o.addrow(null, P, E);
+ C.hide();
+ o.focus()
+ });
+ p.mousedown(function(G) {
+ var H = {};
+ for (var F = 0; F < z; F++) {
+ var E = o.columns.records[F];
+ if (E.reseteverpresentrowwidgetvalue) {
+ E.reseteverpresentrowwidgetvalue(E.displayfield, E.addnewrowwidget)
+ }
+ if (E.addnewrowwidget) {
+ E.addnewrowwidget.attr("title", "");
+ E.addnewrowwidget.removeClass(o.toThemeProperty("jqx-input-invalid"))
+ }
+ }
+ C.hide();
+ o.focus()
+ });
+ for (var w = 0; w < z; w++) {
+ var x = o.columns.records[w];
+ var u = x.width;
+ if (u < x.minwidth) {
+ u = x.minwidth
+ }
+ if (u > x.maxwidth) {
+ u = x.maxwidth
+ }
+ var e = b('
');
+ t.append(e);
+ e.css("left", i);
+ if (o.rtl) {
+ e.css("z-index", m++);
+ e.css("border-left-width", "1px")
+ } else {
+ e.css("z-index", m--)
+ }
+ if (u == "auto") {
+ u = 0
+ }
+ e[0].style.width = parseFloat(u) + "px";
+ e[0].left = i;
+ if (! (x.hidden && x.hideable)) {
+ i += u
+ } else {
+ e.css("display", "none")
+ }
+ h[h.length] = e[0];
+ if (x.checkboxcolumn) {
+ var B = o.toThemeProperty("jqx-grid-cell");
+ B += " " + o.toThemeProperty("jqx-grid-cell-filter-row");
+ B += " " + o.toThemeProperty("jqx-grid-cell-pinned");
+ e.removeClass().addClass(B);
+ continue
+ }
+ var s = true;
+ if (!o.rtl) {
+ if (o.groupable) {
+ var y = (o.showrowdetailscolumn && o.rowdetails) ? 1 : 0;
+ if (o.groups.length + y > w) {
+ s = false
+ }
+ }
+ if (o.showrowdetailscolumn && o.rowdetails && w == 0) {
+ s = false
+ }
+ } else {
+ if (o.groupable) {
+ var y = (o.showrowdetailscolumn && o.rowdetails) ? 1 : 0;
+ if (o.groups.length + y + w > z - 1) {
+ s = false
+ }
+ }
+ if (o.showrowdetailscolumn && o.rowdetails && w == z - 1) {
+ s = false
+ }
+ }
+ o.updateeverpresentrow = function() {
+ var G = null;
+ if (o.selectedcells.length > 0 || o.selectedrowindexes.length > 0) {
+ if (o.selectionmode.indexOf("cell") >= 0) {
+ var H = o.getselectedcells()[0].rowindex
+ } else {
+ var H = o.selectedrowindexes[0]
+ }
+ G = o.getrowdata(H)
+ }
+ if (!G) {
+ return
+ }
+ for (var F = 0; F < o.columns.records.length; F++) {
+ var j = o.columns.records[F];
+ if (j.seteverpresentrowwidgetvalue) {
+ var E = o.getcelltext(H, j.displayfield);
+ j.seteverpresentrowwidgetvalue(j.addnewrowwidget, E)
+ }
+ }
+ };
+ if (s) {
+ if (x.createeverpresentrowwidget) {
+ var v = function() {
+ d.trigger("mousedown")
+ };
+ x.addnewrowwidget = x.createeverpresentrowwidget(x.datafield, e, C, v);
+ if (x.initeverpresentrowwidget) {
+ x.initeverpresentrowwidget(x.datafield, e, C)
+ }
+ } else {
+ o._measureElement("column");
+ var r = (o.everpresentrowheight / 2 - o._columnheight / 2);
+ if (r < 0) {
+ r = 4
+ }
+ r += "px";
+ if (x.datafield === "addButtonColumn") {
+ var l = b('
");
+ e.append(l);
+ l.mousedown(function() {
+ d.trigger("mousedown")
+ });
+ continue
+ } else {
+ if (x.datafield === "resetButtonColumn") {
+ var l = b('
");
+ e.append(l);
+ l.mousedown(function() {
+ p.trigger("mousedown")
+ });
+ continue
+ }
+ }
+ var A = function(F, H, j) {
+ var E = b('
');
+ E[0].id = b.jqx.utilities.createId();
+ E.addClass(F.toThemeProperty("jqx-widget"));
+ E.addClass(F.toThemeProperty("jqx-input"));
+ E.addClass(F.toThemeProperty("jqx-widget-content"));
+ E.addClass(F.toThemeProperty("jqx-enableselect"));
+ E.addClass(F.toThemeProperty("jqx-grid-cell-add-new-row"));
+ E.css("text-align", j.cellsalign);
+ if (F.rtl) {
+ E.css("direction", "rtl")
+ }
+ if (F.disabled) {
+ E.attr("disabled", true)
+ }
+ E.attr("disabled", false);
+ E.attr("placeholder", F.gridlocalization.everpresentrowplaceholder + j.text);
+ E.appendTo(H);
+ E.css("width", "100%");
+ E.css("height", F.everpresentrowheight + "px");
+ E.css("line-height", F.everpresentrowheight + "px");
+ E.css("max-height", F.everpresentrowheight + "px");
+ E.css("margin", "0px");
+ E.focus(function() {
+ if (o.selectedcells.length > 0 || o.selectedrowindexes.length > 0) {
+ if (o.selectionmode.indexOf("cell") >= 0) {
+ var K = o.getselectedcells()[0].rowindex
+ } else {
+ var K = o.selectedrowindexes[0]
+ }
+ }
+ E.addClass(F.toThemeProperty("jqx-fill-state-focus"));
+ var I = F.columns.records.indexOf(j);
+ if (F.everpresentrowactionsmode !== "columns") {
+ C.css({
+ display: "block",
+ top: E.coord().top + F.everpresentrowheight - 1,
+ left: I > 0 ? E.coord().left: E.coord().left - 1
+ })
+ }
+ var J = C.children().width();
+ if (j.cellsalign === "right") {
+ var J = d.width() + p.width();
+ C.children().css("left", J - J + "px")
+ } else {
+ C.children().css("left", "0px")
+ }
+ F.content[0].scrollLeft = 0;
+ F.content[0].scrollTop = 0;
+ setTimeout(function() {
+ F.content[0].scrollLeft = 0;
+ F.content[0].scrollTop = 0
+ },
+ 50);
+ return false
+ });
+ j.addnewrowwidget = E;
+ if (!j.reseteverpresentrowwidgetvalue) {
+ j.reseteverpresentrowwidgetvalue = function(J, I) {
+ I.val("");
+ I.focus();
+ I.blur();
+ I.removeClass(o.toThemeProperty("jqx-input-invalid"));
+ I.attr("title", "")
+ }
+ }
+ if (!j.seteverpresentrowwidgetvalue) {
+ j.seteverpresentrowwidgetvalue = function(J, I) {
+ J.val(I)
+ }
+ }
+ if (!j.geteverpresentrowwidgetvalue) {
+ var G = j;
+ j.geteverpresentrowwidgetvalue = function(I, P, R) {
+ var U = P.val();
+ if (R !== false && G.validateeverpresentrowwidgetvalue) {
+ var Y = {};
+ var O = {};
+ for (var M = 0; M < z; M++) {
+ var K = o.columns.records[M];
+ if (!K.geteverpresentrowwidgetvalue) {
+ continue
+ }
+ var Q = K.geteverpresentrowwidgetvalue(K.displayfield, K.addnewrowwidget, false);
+ O[K.datafield] = Q;
+ if (K.datafield != K.displayfield) {
+ O[K.datafield] = Q.value;
+ O[K.displayfield] = Q.label
+ }
+ }
+ var T = G.validateeverpresentrowwidgetvalue(G.displayfield, U, O);
+ var X = T;
+ var N = o.gridlocalization.validationstring;
+ if (X.message != undefined) {
+ N = X.message
+ }
+ var W = typeof X == "boolean" ? X: X.result;
+ if (!W) {
+ E.addClass(o.toThemeProperty("jqx-input-invalid"));
+ E.attr("title", N);
+ return "invalid editor state"
+ } else {
+ E.removeClass(o.toThemeProperty("jqx-input-invalid"));
+ E.attr("title", "")
+ }
+ }
+ var S = "string";
+ var J = o.source.datafields || ((o.source._source) ? o.source._source.datafields: null);
+ if (J) {
+ var V = "";
+ b.each(J,
+ function() {
+ if (this.name == G.displayfield) {
+ if (this.type) {
+ V = this.type
+ }
+ return false
+ }
+ });
+ if (V) {
+ S = V
+ }
+ }
+ if (S === "number") {
+ var L = parseFloat(U);
+ if (isNaN(L)) {
+ return null
+ }
+ }
+ if (S === "date") {
+ return b.jqx.dataFormat.tryparsedate(U, o.gridlocalization)
+ }
+ if (S === "bool" || S === "boolean") {
+ if (U === "true") {
+ return true
+ }
+ if (U == "1") {
+ return true
+ }
+ if (U === "false") {
+ return false
+ }
+ if (U == "0") {
+ return false
+ }
+ if (U === true) {
+ return U
+ }
+ if (U === false) {
+ return U
+ }
+ return false
+ }
+ return U
+ }
+ }
+ E.keydown(function(I) {
+ if (I.keyCode === 13) {
+ if (o.everpresentrowactions.indexOf("add") >= 0) {
+ d.trigger("mousedown")
+ } else {
+ if (o.everpresentrowactions.indexOf("update") >= 0) {
+ q.trigger("mousedown")
+ } else {
+ if (o.everpresentrowactions.indexOf("delete") >= 0) {
+ k.trigger("mousedown")
+ }
+ }
+ }
+ }
+ });
+ E.blur(function() {
+ E.removeClass(F.toThemeProperty("jqx-fill-state-focus"));
+ C.css("display", "none")
+ });
+ if (j.initeverpresentrowwidget) {
+ j.initeverpresentrowwidget(j.datafield, H, C)
+ }
+ };
+ A(this, e, x)
+ }
+ }
+ }
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ t.css("z-index", m--)
+ }
+ t.width(parseFloat(i) + 2);
+ f.addClass(n);
+ f.css("border-bottom-width", "0px");
+ if (o.showfilterrow) {
+ f.css("border-top-width", "0px")
+ } else {
+ f.css("border-top-width", "1px")
+ }
+ f.css("box-sizing", "border-box");
+ f.css("border-right-width", "0px")
+ },
+ _gettableheight: function() {
+ if (this.tableheight != undefined) {
+ return this.tableheight
+ }
+ var e = this.host.height();
+ if (this.columnsheader) {
+ var d = this.columnsheader.outerHeight();
+ if (!this.showheader) {
+ d = 0
+ }
+ }
+ e -= d;
+ if (this.hScrollBar[0].style.visibility == "visible") {
+ e -= this.hScrollBar.outerHeight()
+ }
+ if (this.pageable) {
+ e -= this.pager.outerHeight()
+ }
+ if (this._groupsheader()) {
+ e -= this.groupsheader.outerHeight()
+ }
+ if (this.showtoolbar) {
+ e -= this.toolbarheight
+ }
+ if (this.showstatusbar) {
+ e -= this.statusbarheight
+ }
+ if (this.showeverpresentrow && this.everpresentrowposition === "bottom") {
+ e -= this.everpresentrowheight
+ }
+ if (e > 0) {
+ this.tableheight = e;
+ return e
+ }
+ return this.host.height()
+ },
+ _getpagesize: function() {
+ if (this.pageable) {
+ return this.pagesize
+ }
+ if (this.virtualmode) {
+ var e = Math.round(this.host.height()) + 2 * this.rowsheight;
+ var d = Math.round(e / this.rowsheight);
+ return d
+ }
+ if (this.autoheight || this.autorowheight) {
+ if (this.dataview.totalrows == 0) {
+ return 1
+ }
+ return this.dataview.totalrows
+ }
+ if (this.dataview.totalrows < 100 && this.dataview.totalrecords < 100 && this.dataview.totalrows > 0) {
+ return this.dataview.totalrows
+ }
+ return 100
+ },
+ _calculatevirtualheight: function() {
+ var n = this.that;
+ var e = Math.round(this.host.height()) + 2 * this.rowsheight;
+ realheight = this._gettableheight();
+ var p = Math.round(e / this.rowsheight);
+ this.heights = new Array();
+ this.hiddens = new Array();
+ this.details = new Array();
+ this.expandedgroups = new Array();
+ this.hiddenboundrows = new Array();
+ this.heightboundrows = new Array();
+ this.detailboundrows = new Array();
+ var h = Math.max(this.dataview.totalrows, this.dataview.totalrecords);
+ if (this.pageable) {
+ h = this.pagesize;
+ if (this.pagesize > Math.max(this.dataview.totalrows, this.dataview.totalrecords) && this.autoheight) {
+ h = Math.max(this.dataview.totalrows, this.dataview.totalrecords)
+ } else {
+ if (!this.autoheight) {
+ if (this.dataview.totalrows < this.pagesize) {
+ h = Math.max(this.dataview.totalrows, this.dataview.totalrecords)
+ }
+ }
+ }
+ }
+ var l = h * this.rowsheight;
+ var m = 0;
+ var j = 0;
+ var k = 0;
+ var f = this._getpagesize();
+ var d = f * this.rowsheight;
+ var g = 0;
+ if (!this.pageable && this.autoheight) {
+ p = h
+ }
+ if (h + f > 0) {
+ while (g <= h + f) {
+ m += d;
+ if (g - f < h && g >= h) {
+ var o = g - h;
+ if (o > 0) {
+ k -= d;
+ this._pageviews[j - 1] = {
+ top: k,
+ height: d - o * this.rowsheight
+ }
+ }
+ break
+ } else {
+ this._pageviews[j++] = {
+ top: k,
+ height: d
+ }
+ }
+ k = m;
+ g += f
+ }
+ }
+ if (this.resizingGrid != true) {
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+ if (l > realheight && !this.autoheight) {
+ this.vScrollBar.css("visibility", "visible");
+ if (this.scrollmode == "deferred") {
+ this.vScrollBar.jqxScrollBar({
+ max: l
+ })
+ } else {
+ this.vScrollBar.jqxScrollBar({
+ max: l - realheight
+ })
+ }
+ } else {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+ this.dataview.pagesize = f;
+ this.dataview.updateview();
+ return {
+ visiblerecords: p,
+ virtualheight: l
+ }
+ },
+ _updatepageviews: function() {
+ if (this.updating()) {
+ return
+ }
+ this._pagescache = new Array();
+ this._pageviews = new Array();
+ this.tableheight = null;
+ var u = this.that;
+ var d = Math.round(this.host.height()) + 2 * this.rowsheight;
+ var v = Math.round(d / this.rowsheight);
+ var n = Math.max(this.dataview.totalrows, this.dataview.totalrecords);
+ var q = n * this.rowsheight;
+ var t = 0;
+ var f = 0;
+ var o = 0;
+ var p = 0;
+ var j = 0;
+ var h = this._getpagesize();
+ if (!this.pageable) {
+ for (var m = 0; m < n; m++) {
+ var s = {
+ index: m,
+ height: this.heights[m],
+ hidden: this.hiddens[m],
+ details: this.details[m]
+ };
+ if (this.heights[m] == undefined) {
+ this.heights[m] = this.rowsheight;
+ s.height = this.rowsheight
+ }
+ if (this.hiddens[m] == undefined) {
+ this.hiddens[m] = false;
+ s.hidden = false
+ }
+ if (this.details[m] == undefined) {
+ this.details[m] = null
+ }
+ if (s.height != u.rowsheight) {
+ q -= u.rowsheight;
+ q += s.height
+ }
+ if (s.hidden) {
+ q -= s.height
+ } else {
+ f += s.height;
+ var l = 0;
+ if (this.rowdetails) {
+ if (this.rowdetailstemplate) {
+ if (!s.details) {
+ s.details = this.rowdetailstemplate
+ }
+ }
+ if (s.details && s.details.rowdetails && !s.details.rowdetailshidden) {
+ l = s.details.rowdetailsheight;
+ f += l;
+ q += l
+ }
+ }
+ t += s.height + l
+ }
+ j++;
+ if (j >= h || m == n - 1) {
+ this._pageviews[o++] = {
+ top: p,
+ height: f
+ };
+ f = 0;
+ p = t;
+ j = 0
+ }
+ }
+ } else {
+ if (this._updatepagedview) {
+ q = this._updatepagedview(n, q, 0)
+ }
+ if (this.autoheight) {
+ this._arrange()
+ }
+ }
+ var e = this._gettableheight();
+ if (q > e) {
+ if (this.pageable && this.gotopage) {
+ q = this._pageviews[0].height;
+ if (q < 0) {
+ q = this._pageviews[0].height
+ }
+ }
+ if (this.vScrollBar.css("visibility") != "visible") {
+ this.vScrollBar.css("visibility", "visible")
+ }
+ if (q <= e || this.autoheight) {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+ if (q - e > 0) {
+ if (this.scrollmode != "deferred") {
+ var r = q - e;
+ var g = this.vScrollInstance.max;
+ this.vScrollBar.jqxScrollBar({
+ max: r
+ });
+ if (r != g) {
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+ } else {
+ this.vScrollBar.jqxScrollBar({
+ value: 0,
+ max: q
+ })
+ }
+ } else {
+ this.vScrollBar.jqxScrollBar({
+ value: 0,
+ max: q
+ })
+ }
+ } else {
+ if (!this._loading) {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+ this._arrange();
+ if (this.autoheight) {
+ v = Math.round(this.host.height() / this.rowsheight)
+ }
+ this.virtualsizeinfo = {
+ visiblerecords: v,
+ virtualheight: q
+ }
+ },
+ updatebounddata: function(d) {
+ if (d != "data" && d != "sort" && d != "filter" && d != "cells" && d != "pagechanged" && d != "pagesizechanged" && !this.virtualmode) {
+ this.virtualsizeinfo = null;
+ if (this.showfilterrow && this.filterable && this.filterrow) {
+ if (this.clearfilters) {
+ this.clearfilters(false)
+ }
+ this.filterrow.remove();
+ this._filterrowcache = new Array();
+ if (this.filterable && this._destroyedfilters && this.showfilterrow) {
+ this._destroyedfilters()
+ }
+ this.filterrow = null
+ } else {
+ if (this.filterable) {
+ if (this.clearfilters) {
+ this.clearfilters(false)
+ }
+ }
+ }
+ if (this.groupable) {
+ this.dataview.groups = [];
+ this.groups = []
+ }
+ if (this.pageable) {
+ this.pagenum = 0;
+ this.dataview.pagenum = 0
+ }
+ if (this.sortable) {
+ this.sortcolumn = null;
+ this.sortdirection = "";
+ this.dataview.sortfielddirection = "";
+ this.dataview.clearsortdata()
+ }
+ }
+ this.databind(this.source, d)
+ },
+ refreshdata: function() {
+ this._refreshdataview();
+ this.render()
+ },
+ _updatevscrollbarmax: function() {
+ if (this._pageviews && this._pageviews.length > 0) {
+ var f = this._pageviews[0].height;
+ if (this.virtualmode || !this.pageable) {
+ f = this.virtualsizeinfo.virtualheight
+ }
+ var e = this._gettableheight();
+
+ if (f > e) {
+ if (this.pageable && this.gotopage) {
+ f = this._pageviews[0].height;
+ if (f < 0) {
+ f = this._pageviews[0].height
+ }
+ }
+ if (this.vScrollBar.css("visibility") != "visible") {
+ this.vScrollBar.css("visibility", "visible")
+ }
+ if (f <= e || this.autoheight) {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+
+ if (f - e > 0) {
+ var d = f - e;
+ this.vScrollBar.jqxScrollBar({
+ max: d
+ })
+ } else {
+ this.vScrollBar.jqxScrollBar({
+ value: 0,
+ max: f
+ })
+ }
+ } else {
+ this.vScrollBar.css("visibility", "hidden");
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+
+ }
+ },
+ _refreshdataview: function() {
+ this.dataview.refresh()
+ },
+ refresh: function(d) {
+ if (d != true) {
+ if (b.jqx.isHidden(this.host)) {
+ return
+ }
+ if (this.virtualsizeinfo != null) {
+ this._cellscache = new Array();
+ this._renderrows(this.virtualsizeinfo);
+ this._updatesize()
+ }
+ }
+ },
+ render: function() {
+ this._render(true, true, true, true)
+ },
+ invalidate: function() {
+ if (this.virtualsizeinfo) {
+ this._updatecolumnwidths();
+ this._updatecellwidths();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ },
+ clear: function() {
+ this.databind(null);
+ this.render()
+ },
+ _preparecolumngroups: function() {
+ var o = this.columnsheight;
+ if (this.columngroups) {
+ this.columnshierarchy = new Array();
+ if (this.columngroups.length) {
+ var n = this;
+ for (var h = 0; h < this.columngroups.length; h++) {
+ this.columngroups[h].parent = null;
+ this.columngroups[h].groups = null
+ }
+ for (var h = 0; h < this.columns.records.length; h++) {
+ this.columns.records[h].parent = null;
+ this.columns.records[h].groups = null
+ }
+ var p = function(j) {
+ for (var u = 0; u < n.columngroups.length; u++) {
+ var v = n.columngroups[u];
+ if (v.name === j) {
+ return v
+ }
+ }
+ return null
+ };
+ for (var h = 0; h < this.columngroups.length; h++) {
+ var q = this.columngroups[h];
+ if (!q.groups) {
+ q.groups = null
+ }
+ if (q.parentgroup) {
+ var s = p(q.parentgroup);
+ if (s) {
+ q.parent = s;
+ if (!s.groups) {
+ s.groups = new Array()
+ }
+ if (s.groups.indexOf(q) === -1) {
+ s.groups.push(q)
+ }
+ }
+ }
+ }
+ for (var h = 0; h < this.columns.records.length; h++) {
+ var q = this.columns.records[h];
+ if (q.columngroup) {
+ var s = p(q.columngroup);
+ if (s) {
+ if (!s.groups) {
+ s.groups = new Array()
+ }
+ q.parent = s;
+ if (s.groups.indexOf(q) === -1) {
+ s.groups.push(q)
+ }
+ }
+ }
+ }
+ var r = 0;
+ for (var h = 0; h < this.columns.records.length; h++) {
+ var q = this.columns.records[h];
+ var e = q;
+ q.level = 0;
+ while (e.parent) {
+ e = e.parent;
+ q.level++
+ }
+ var e = q;
+ var d = q.level;
+ r = Math.max(r, q.level);
+ while (e.parent) {
+ e = e.parent;
+ if (e) {
+ e.level = --d
+ }
+ }
+ }
+ var m = function(y) {
+ var x = new Array();
+ if (y.columngroup) {
+ x.push(y)
+ }
+ if (y.groups) {
+ for (var w = 0; w < y.groups.length; w++) {
+ if (y.groups[w].columngroup) {
+ x.push(y.groups[w])
+ } else {
+ if (y.groups[w].groups) {
+ var v = m(y.groups[w]);
+ for (var u = 0; u < v.length; u++) {
+ x.push(v[u])
+ }
+ }
+ }
+ }
+ }
+ return x
+ };
+ for (var h = 0; h < this.columngroups.length; h++) {
+ var q = this.columngroups[h];
+ var f = m(q);
+ q.columns = f;
+ var k = new Array();
+ var t = 0;
+ for (var g = 0; g < f.length; g++) {
+ k.push(this.columns.records.indexOf(f[g]));
+ if (f[g].pinned) {
+ t++
+ }
+ }
+ if (t != 0) {
+ throw new Error("jqxGrid: Column Groups initialization Error. Please, check the initialization of the jqxGrid's columns array. The columns in a column group cannot be pinned.")
+ }
+ k.sort(function(j, i) {
+ j = parseInt(j);
+ i = parseInt(i);
+ if (j < i) {
+ return - 1
+ }
+ if (j > i) {
+ return 1
+ }
+ return 0
+ });
+ for (var l = 1; l < k.length; l++) {
+ if (k[l] != k[l - 1] + 1) {
+ throw new Error("jqxGrid: Column Groups initialization Error. Please, check the initialization of the jqxGrid's columns array. The columns in a column group are expected to be siblings in the columns array.");
+ this.host.remove()
+ }
+ }
+ }
+ }
+ this.columngroupslevel = 1 + r;
+ o = this.columngroupslevel * this.columnsheight
+ }
+ return o
+ },
+ _render: function(k, j, l, e, f) {
+ if (this.dataview == null) {
+ return
+ }
+ if (this._loading) {
+ return
+ }
+ if (this._batchupdate) {
+ return
+ }
+ if (b.jqx.isHidden(this.host)) {
+ var g = this;
+ if (g.___hiddenTimer) {
+ clearInterval(g.___hiddenTimer);
+ g.___hiddenTimer = null
+ }
+ this.___hiddenTimer = setInterval(function() {
+ if (!b.jqx.isHidden(g.host)) {
+ clearInterval(g.___hiddenTimer);
+ g.render()
+ }
+ },
+ 300);
+ return
+ }
+ if (this.editcell != null && this.endcelledit) {
+ this.endcelledit(this.editcell.row, this.editcell.column, true, false)
+ }
+ this.validationpopup = null;
+ this._removeHandlers();
+ this._addHandlers();
+ this._initializeRows();
+ this._requiresupdate = j != undefined ? j: true;
+ this._newmax = null;
+ if (l) {
+ if (!this._requiresupdate) {
+ if (e != false) {
+ this._initmenu()
+ }
+ }
+ if (this.columns == null) {
+ this.columns = new b.jqx.collection(this.element)
+ } else {
+ var i = this;
+ if (this.columns && this.columns.name === "observableArray") {
+ this.columns.notifier = function(p) {
+ var n = function() {
+ i.columns = i._columns;
+ i.render()
+ };
+ switch (p.type) {
+ case "add":
+ n();
+ break;
+ case "update":
+ if (p.name === "index") {
+ i.beginupdate();
+ for (var o in p.newValue) {
+ i.setcolumnproperty(p.newValue.datafield, o, p.newValue[o])
+ }
+ i.endupdate()
+ } else {
+ var m = p.path.split(".");
+ i.setcolumnproperty(i.columns[m[0]].datafield, p.name, p.newValue)
+ }
+ break;
+ case "delete":
+ n();
+ break
+ }
+ }
+ }
+ if (this.columngroups && this.columngroups.name === "observableArray") {
+ this.columngroups.notifier = function(m) {
+ i.render()
+ }
+ }
+ this._initializeColumns()
+ }
+ }
+ this.tableheight = null;
+ this._pagescache = new Array();
+ this._pageviews = new Array();
+ this.visiblerows = new Array();
+ this.hittestinfo = new Array();
+ if (this._requiresupdate) {
+ this._clearcaches();
+ if (e == true) {
+ this._initmenu()
+ }
+ }
+ this.virtualsizeinfo = null;
+ this.prerenderrequired = true;
+ if ((this.groupable && this.groups.length > 0 && this.rowdetails) || (this.rowdetails)) {
+ if (this.gridcontent) {
+ this._rowdetailscache = new Array();
+ this._rowdetailselementscache = new Array();
+ this.detailboundrows = new Array();
+ this.details = new Array();
+ b.jqx.utilities.html(this.gridcontent, "");
+ this.gridcontent = null
+ }
+ }
+ if (this.gridcontent) {
+ if (this.editable && this._destroyeditors) {
+ this._destroyeditors()
+ }
+ }
+ if (l) {
+ if (this.filterrow) {
+ this.filterrow.detach()
+ }
+ b.jqx.utilities.html(this.content, "");
+ this.columnsheader = this.columnsheader || b('
');
+ this.columnsheader.remove();
+ this.columnsheader.addClass(this.toTP("jqx-widget-header"));
+ this.columnsheader.addClass(this.toTP("jqx-grid-header"))
+ } else {
+ if (this.gridcontent) {
+ b.jqx.utilities.html(this.gridcontent, "")
+ }
+ }
+ if (!this.showheader) {
+ this.columnsheader.css("display", "none")
+ } else {
+ if (this.columnsheader) {
+ this.columnsheader.css("display", "block")
+ }
+ }
+ this.gridcontent = this.gridcontent || b('
');
+ this.gridcontent.remove();
+ var h = this.columnsheight;
+ h = this._preparecolumngroups();
+ if (this.showfilterrow && this.filterable) {
+ this.columnsheader.height(h + this.filterrowheight);
+ if (this.showeverpresentrow && this.everpresentrowposition !== "bottom") {
+ this.columnsheader.height(h + this.filterrowheight + this.everpresentrowheight)
+ }
+ } else {
+ if (this.showeverpresentrow && this.everpresentrowposition !== "bottom") {
+ this.columnsheader.height(h + this.everpresentrowheight)
+ } else {
+ this.columnsheader.height(h)
+ }
+ }
+ this.content.append(this.columnsheader);
+ this.content.append(this.gridcontent);
+ this._arrange();
+ if (this._initgroupsheader) {
+ this._initgroupsheader()
+ }
+ this.selectionarea = this.selectionarea || b("
");
+ this.selectionarea.addClass(this.toThemeProperty("jqx-grid-selectionarea"));
+ this.selectionarea.addClass(this.toThemeProperty("jqx-fill-state-pressed"));
+ this.content.append(this.selectionarea);
+ this.tableheight = null;
+ this.rendergridcontent(false, l);
+ if (this.groups.length > 0 && this.groupable) {
+ var d = this.vScrollBar[0].style.visibility;
+ this.suspendgroupevents = true;
+ if (this.collapseallgroups) {
+ if (!this.groupsexpandedbydefault) {
+ this.collapseallgroups(false);
+ this._updatescrollbarsafterrowsprerender()
+ } else {
+ this.expandallgroups(false)
+ }
+ }
+ if (this.vScrollBar[0].style.visibility != d) {
+ this._updatecolumnwidths();
+ this._updatecellwidths()
+ }
+ this.suspendgroupevents = false
+ }
+ if (this.pageable && this.updatepagerdetails) {
+ this.updatepagerdetails();
+ if (this.autoheight) {
+ this._updatepageviews()
+ }
+ if (this.autorowheight) {
+ if (!this.autoheight) {
+ this._updatepageviews()
+ }
+ this._renderrows(this.virtualsizeinfo)
+ }
+ }
+ if (this.showaggregates && this._updateaggregates) {
+ this._updateaggregates()
+ }
+ this._addoverlayelement();
+ if (this.scrollmode == "deferred") {
+ this._addscrollelement()
+ }
+ if (this.showfilterrow && this.filterable && this.filterrow && (f == undefined || f == true)) {
+ this._updatelistfilters(!l)
+ }
+ if (this.rendered) {
+ this.rendered("full")
+ }
+ this.__isRendered = true
+ },
+ _addoverlayelement: function() {
+ if (this.autoheight) {
+ if (this._overlayElement) {
+ this._overlayElement.remove()
+ }
+ this._updateTouchScrolling();
+ return
+ }
+ var d = b.jqx.utilities.getBrowser();
+ if ((d.browser == "msie" && parseInt(d.version) < 9) || this.isTouchDevice()) {
+ if (this._overlayElement) {
+ this._overlayElement.remove()
+ }
+ this._overlayElement = b("
");
+ this._overlayElement.css("background", "white");
+ this._overlayElement.css("z-index", 18000);
+ this._overlayElement.css("opacity", 0.001);
+ if (this.isTouchDevice()) {
+ if (this.vScrollBar.css("visibility") !== "hidden" || this.hScrollBar.css("visibility") !== "hidden") {
+ var e = 0;
+ if (this.selectionmode == "checkbox") {
+ e += 30
+ }
+ if (this.groupable || this.rowdetails) {
+ this._overlayElement.css("left", 30 * (this.groups.length + (this.rowdetails ? 1 : 0)))
+ }
+ var f = this._overlayElement.css("left");
+ this._overlayElement.css("left", f + e)
+ } else {
+ if (this._overlayElement) {
+ this._overlayElement.remove()
+ }
+ }
+ } else {
+ this.content.prepend(this._overlayElement)
+ }
+ }
+ this._updateTouchScrolling()
+ },
+ _addscrollelement: function() {
+ if (this._scrollelement) {
+ this._scrollelement.remove()
+ }
+ if (this._scrollelementoverlay) {
+ this._scrollelementoverlay.remove()
+ }
+ this._scrollelementoverlay = b("
");
+ this._scrollelementoverlay.css("background", "black");
+ this._scrollelementoverlay.css("z-index", 18000);
+ this._scrollelementoverlay.css("opacity", 0.1);
+ this._scrollelement = b("
");
+ this._scrollelement.css("z-index", 18005);
+ this._scrollelement.addClass(this.toThemeProperty("jqx-button"));
+ this._scrollelement.addClass(this.toThemeProperty("jqx-fill-state-normal"));
+ this._scrollelement.addClass(this.toThemeProperty("jqx-rc-all"));
+ this._scrollelement.addClass(this.toThemeProperty("jqx-shadow"));
+ this.content.prepend(this._scrollelement);
+ this.content.prepend(this._scrollelementoverlay)
+ },
+ rendergridcontent: function(d, f) {
+ if (this.updating()) {
+ return false
+ }
+ if (d == undefined || d == null) {
+ d = false
+ }
+ this._requiresupdate = d;
+ var h = this.prerenderrequired;
+ if (this.prerenderrequired) {
+ this._arrange()
+ }
+ var g = this.that;
+ var f = f;
+ if (f == null || f == undefined) {
+ f = true
+ }
+ this.tableheight = null;
+ g.virtualsizeinfo = g.virtualsizeinfo || g._calculatevirtualheight();
+ if (g.pageable && !g.autoheight) {
+ if (g.dataview.totalrows < g.pagesize) {
+ g._requiresupdate = true
+ }
+ }
+ if (f) {
+ g._rendercolumnheaders()
+ } else {
+ if (this._rendersortcolumn) {
+ this._rendersortcolumn()
+ }
+ if (this._renderfiltercolumn) {
+ this._renderfiltercolumn()
+ }
+ }
+ g._renderrows(g.virtualsizeinfo);
+ if (this.gridcontent) {
+ if (this.gridcontent[0].scrollTop != 0) {
+ this.gridcontent[0].scrollTop = 0
+ }
+ if (this.gridcontent[0].scrollLeft != 0) {
+ this.gridcontent[0].scrollLeft = 0
+ }
+ }
+ if (h) {
+ var e = this.tableheight;
+ this._arrange();
+ if (e != this.tableheight && this.autoheight) {
+ g._renderrows(g.virtualsizeinfo)
+ }
+ }
+ if (this.rtl) {
+ this._renderhorizontalscroll()
+ }
+ if (this.autosavestate) {
+ if (this.initializedcall != null) {
+ if (this.savestate) {
+ this.savestate()
+ }
+ }
+ }
+ return true
+ },
+ _updatecolumnwidths: function() {
+ var l = this.host.width();
+ var e = l;
+ var j = "";
+ if (this.columns == undefined || this.columns.records == undefined) {
+ return
+ }
+ var n = this.that;
+ var g = this.rowdetails && this.showrowdetailscolumn ? (1 + this.groups.length) * this.groupindentwidth: (this.groups.length) * this.groupindentwidth;
+ b.each(this.columns.records,
+ function(p, q) {
+ if (! (this.hidden && this.hideable)) {
+ if (this.width.toString().indexOf("%") != -1 || this._percentagewidth != undefined) {
+ var q = 0;
+ var r = n.vScrollBar[0].style.visibility == "hidden" ? 0 : n.scrollbarsize + 5;
+ if (n.scrollbarautoshow) {
+ r = 0
+ }
+ var o = e;
+ q = parseFloat(this.width) * o / 100;
+ r += g;
+ if (this._percentagewidth != undefined) {
+ q = parseFloat(this._percentagewidth) * (o - r) / 100
+ }
+ if (q < this.minwidth && this.minwidth != "auto") {
+ q = this.minwidth
+ }
+ if (q > this.maxwidth && this.maxwidth != "auto") {
+ q = this.maxwidth
+ }
+ l -= q
+ } else {
+ if (this.width != "auto" && !this._width) {
+ l -= this.width
+ } else {
+ j += this.text
+ }
+ }
+ }
+ });
+ var f = this._gettableheight();
+ if (!this.autoheight) {
+ if (this.virtualsizeinfo && this.virtualsizeinfo.virtualheight > f) {
+ if (this.groupable && this.groups.length > 0) {
+ if (this.dataview && this.dataview.loadedrootgroups && !this.groupsexpandedbydefault) {
+ var m = this.dataview.loadedrootgroups.length * this.rowsheight;
+ if (this.pageable) {
+ for (var d = 0; d < this.dataview.rows.length; d++) {
+ if (this.dataview.rows[d].group && this.dataview.rows[d].level === 0) {
+ m += this.rowsheight
+ }
+ }
+ }
+ if (m > f) {
+ l -= this.scrollbarsize + 5;
+ e -= this.scrollbarsize + 5
+ } else {
+ if (this.vScrollBar.css("visibility") == "visible") {
+ l -= this.scrollbarsize + 5;
+ e -= this.scrollbarsize + 5
+ }
+ }
+ } else {
+ l -= this.scrollbarsize + 5;
+ e -= this.scrollbarsize + 5
+ }
+ } else {
+ if (this.vScrollBar.css("visibility") != "hidden") {
+ l -= this.scrollbarsize + 5;
+ e -= this.scrollbarsize + 5
+ }
+ }
+ }
+ }
+ var g = this.rowdetails && this.showrowdetailscolumn ? (1 + this.groups.length) * this.groupindentwidth: (this.groups.length) * this.groupindentwidth;
+ e -= g;
+ if (!this.columnsheader) {
+ return
+ }
+ var i = this.columnsheader.find("#columntable" + this.element.id);
+ if (i.length == 0) {
+ return
+ }
+ var h = 0;
+ var k = this;
+ b.each(this.columns.records,
+ function(p, t) {
+ var r = b(this.element);
+ if (!this.hidden && this.element.style.display === "none") {
+ this.element.style.display = "block"
+ }
+ var o = false;
+ var s = this.width;
+ if (this.width.toString().indexOf("%") != -1 || this._percentagewidth != undefined) {
+ if (this._percentagewidth != undefined) {
+ s = parseFloat(this._percentagewidth) * e / 100
+ } else {
+ s = parseFloat(this.width) * e / 100
+ }
+ o = true
+ }
+ if (this.width != "auto" && !this._width && !o) {
+ if (parseInt(r[0].style.width) != this.width) {
+ r.width(this.width)
+ }
+ } else {
+ if (o) {
+ if (s < this.minwidth && this.minwidth != "auto") {
+ s = this.minwidth;
+ this.width = s
+ }
+ if (s > this.maxwidth && this.maxwidth != "auto") {
+ s = this.maxwidth;
+ this.width = s
+ }
+ if (parseInt(r[0].style.width) != s) {
+ r.width(s);
+ this.width = s
+ }
+ } else {
+ var q = Math.floor(l * (this.text.length / j.length));
+ if (isNaN(q)) {
+ q = this.minwidth
+ }
+ if (q == Infinity) {
+ q = 0
+ }
+ if (q < 0) {
+ $element = b("
" + this.text + "");
+ b(document.body).append($element);
+ q = 10 + $element.width();
+ $element.remove()
+ }
+ if (q < this.minwidth) {
+ q = this.minwidth
+ }
+ if (q > this.maxwidth) {
+ q = this.maxwidth
+ }
+ this._width = "auto";
+ this.width = q;
+ r.width(this.width)
+ }
+ }
+ if (parseInt(r[0].style.left) != h) {
+ r.css("left", h)
+ }
+ if (! (this.hidden && this.hideable)) {
+ h += this.width
+ }
+ this._requirewidthupdate = true
+ });
+ this.columnsheader.width(2 + h);
+ i.width(this.columnsheader.width());
+ if (h == 0) {
+ this.columnsheader[0].style.visibility = "hidden"
+ } else {
+ this.columnsheader[0].style.visibility = "inherit"
+ }
+ this._resizecolumngroups();
+ if (this.showfilterrow && this.filterrow) {
+ this.filterrow.width(this.columnsheader.width());
+ this._updatefilterrowui()
+ }
+ if (this.showeverpresentrow) {
+ if (this.everpresentrowposition !== "bottom") {
+ this.addnewrowtop.width(this.columnsheader.width())
+ } else {
+ this.addnewrowbottom.width(this.columnsheader.width())
+ }
+ this._updateaddnewrowui()
+ }
+ if (this.autowidth) {
+ this._arrange()
+ }
+ },
+ _rendercolumnheaders: function() {
+ var x = this.that;
+ if (!this.prerenderrequired) {
+ if (this._rendersortcolumn) {
+ this._rendersortcolumn()
+ }
+ if (this._renderfiltercolumn) {
+ this._renderfiltercolumn()
+ }
+ if (this.showfilterrow && this.filterrow) {
+ this.filterrow.width(this.columnsheader.width());
+ this._updatefilterrowui()
+ }
+ if (this.showeverpresentrow) {
+ if (this.everpresentrowposition !== "bottom") {
+ this.addnewrowtop.width(this.columnsheader.width())
+ } else {
+ this.addnewrowbottom.width(this.columnsheader.width())
+ }
+ this._updateaddnewrowui()
+ }
+ return
+ }
+ this._columnsbydatafield = new Array();
+ this.columnsheader.find("#columntable" + this.element.id).remove();
+ var o = b('
');
+ o[0].cells = new Array();
+ var A = 0;
+ var h = 0;
+ var u = "";
+ var F = this.host.width();
+ var s = F;
+ var g = new Array();
+ var z = new Array();
+ var t = this.rowdetails && this.showrowdetailscolumn ? (1 + this.groups.length) * this.groupindentwidth: (this.groups.length) * this.groupindentwidth;
+ b.each(this.columns.records,
+ function(j, k) {
+ if (! (this.hidden && this.hideable)) {
+ if (this.width != "auto" && !this._width) {
+ if (this.width < this.minwidth && this.minwidth != "auto") {
+ F -= this.minwidth
+ } else {
+ if (this.width > this.maxwidth && this.maxwidth != "auto") {
+ F -= this.maxwidth
+ } else {
+ if (this.width.toString().indexOf("%") != -1) {
+ var k = 0;
+ var p = x.vScrollBar[0].style.visibility == "hidden" ? 0 : x.scrollbarsize + 5;
+ p += t;
+ k = parseFloat(this.width) * (s - p) / 100;
+ if (k < this.minwidth && this.minwidth != "auto") {
+ k = this.minwidth
+ }
+ if (k > this.maxwidth && this.maxwidth != "auto") {
+ k = this.maxwidth
+ }
+ F -= k
+ } else {
+ if (typeof this.width == "string") {
+ this.width = parseInt(this.width)
+ }
+ F -= this.width
+ }
+ }
+ }
+ } else {
+ u += this.text
+ }
+ }
+ if (this.pinned || this.grouped || this.checkboxcolumn) {
+ if (x._haspinned) {
+ this.pinned = true
+ }
+ g[g.length] = this
+ } else {
+ z[z.length] = this
+ }
+ });
+ if (!this.rtl) {
+ for (var C = 0; C < g.length; C++) {
+ this.columns.replace(C, g[C])
+ }
+ for (var B = 0; B < z.length; B++) {
+ this.columns.replace(g.length + B, z[B])
+ }
+ } else {
+ var y = 0;
+ g.reverse();
+ for (var C = this.columns.records.length - 1; C >= this.columns.records.length - g.length; C--) {
+ this.columns.replace(C, g[y++])
+ }
+ for (var B = 0; B < z.length; B++) {
+ this.columns.replace(B, z[B])
+ }
+ }
+ var n = this.headerZIndex;
+ var r = x.groupable ? x.groups.length: 0;
+ if (this.rowdetails && this.showrowdetailscolumn) {
+ r++
+ }
+ var l = x.columnsheader.height();
+ if (this.showfilterrow) {
+ if (!this.columngroups) {
+ l = this.columnsheight
+ } else {
+ l -= this.filterrowheight
+ }
+ }
+ if (this.showeverpresentrow && this.everpresentrowposition !== "bottom") {
+ l -= this.everpresentrowheight
+ }
+ var v = this._gettableheight();
+ if (this.virtualsizeinfo && this.virtualsizeinfo.virtualheight > v && !this.scrollbarautoshow) {
+ if (this.groupable && this.groups.length > 0) {
+ if (this.dataview && this.dataview.loadedrootgroups && !this.groupsexpandedbydefault) {
+ var D = 0;
+ if (!this.pageable) {
+ var D = this.dataview.loadedrootgroups.length * this.rowsheight
+ } else {
+ if (this.pageable) {
+ for (var w = 0; w < this.dataview.rows.length; w++) {
+ if (this.dataview.rows[w].group && this.dataview.rows[w].level === 0) {
+ D += this.rowsheight
+ }
+ }
+ }
+ }
+ if (D > v) {
+ F -= this.scrollbarsize + 5;
+ s -= this.scrollbarsize + 5
+ }
+ } else {
+ F -= this.scrollbarsize + 5;
+ s -= this.scrollbarsize + 5
+ }
+ } else {
+ if (!this.autoheight) {
+ F -= this.scrollbarsize + 5;
+ s -= this.scrollbarsize + 5
+ }
+ }
+ }
+ s -= t;
+ var d = function(j, k) {
+ var i = x.columngroupslevel * x.columnsheight;
+ i = i - (k.level * x.columnsheight);
+ return i
+ };
+ var f = document.createDocumentFragment();
+ b.each(this.columns.records,
+ function(V, T) {
+ this.height = x.columnsheight;
+ if (x.columngroups) {
+ if (x.columngroups.length) {
+ this.height = d(this.datafield, this);
+ l = this.height
+ }
+ }
+ var Z = x.toTP("jqx-grid-column-header") + " " + x.toTP("jqx-widget-header");
+ if (x.rtl) {
+ Z += " " + x.toTP("jqx-grid-column-header-rtl")
+ }
+ var X = !x.rtl ? 150 + n - 1 : 150 + n + 1;
+ var R = !x.rtl ? n--:n++;
+ var G = b('
');
+ if (x.columngroups) {
+ G[0].style.height = l + "px";
+ G[0].style.bottom = "0px";
+ if (this.pinned) {
+ G[0].style.zIndex = X
+ }
+ }
+ this.uielement = G;
+ if (this.classname != "" && this.classname) {
+ G.addClass(this.classname)
+ }
+ var O = this.width;
+ var P = false;
+ if (this.width === null) {
+ this.width = "auto"
+ }
+ if (this.width.toString().indexOf("%") != -1 || this._percentagewidth != undefined) {
+ if (this._percentagewidth != undefined) {
+ O = parseFloat(this._percentagewidth) * s / 100
+ } else {
+ O = parseFloat(this.width) * s / 100
+ }
+ P = true
+ }
+ if (this.width != "auto" && !this._width && !P) {
+ if (O < this.minwidth && this.minwidth != "auto") {
+ O = this.minwidth;
+ this.width = O
+ }
+ if (O > this.maxwidth && this.maxwidth != "auto") {
+ O = this.maxwidth;
+ this.width = O
+ }
+ G[0].style.width = parseInt(O) + "px"
+ } else {
+ if (P) {
+ if (O < this.minwidth && this.minwidth != "auto") {
+ O = this.minwidth
+ }
+ if (O > this.maxwidth && this.maxwidth != "auto") {
+ O = this.maxwidth
+ }
+ if (this._percentagewidth == undefined || this.width.toString().indexOf("%") != -1) {
+ this._percentagewidth = this.width
+ }
+ G.width(O);
+ this.width = O
+ } else {
+ if (!this.hidden) {
+ var S = Math.floor(F * (this.text.length / u.length));
+ if (isNaN(S)) {
+ S = this.minwidth
+ }
+ if (S < 0) {
+ $element = b("
" + this.text + "");
+ b(document.body).append($element);
+ S = 10 + $element.width();
+ $element.remove()
+ }
+ if (S < this.minwidth) {
+ S = this.minwidth
+ }
+ if (S > this.maxwidth) {
+ S = this.maxwidth
+ }
+ this._width = "auto";
+ this.width = S;
+ O = this.width;
+ G.width(this.width)
+ }
+ }
+ }
+ if (this.hidden && this.hideable) {
+ G.css("display", "none")
+ }
+ var p = b(G.children()[0]);
+ var W = x.rtl ? x.toTP("jqx-grid-column-menubutton") + " " + x.toTP("jqx-grid-column-menubutton-rtl") : x.toTP("jqx-grid-column-menubutton");
+ W += " " + x.toTP("jqx-icon-arrow-down");
+ var J = b('
');
+ if (!x.enableanimations) {
+ J.css("margin-left", -16)
+ }
+ if (x.rtl) {
+ J.css("left", "0px")
+ }
+ this.columnsmenu = J[0];
+ o[0].cells[V] = G[0];
+ J[0].style.width = parseInt(x.columnsmenuwidth) + "px";
+ var I = x.columnsmenu;
+ var q = false;
+ var U = false;
+ var Q = (x.groupable && r > 0 && A < r) || (x.rowdetails && A < r);
+ if (x.rtl) {
+ Q = (x.groupable && r > 0 && A < r) || (x.rowdetails && A < r);
+ Q &= V > x.columns.records.length - 1 - r
+ }
+ if (Q) {
+ A++;
+ I &= false;
+ this.sortable = false;
+ this.editable = false;
+ U = true
+ } else {
+ var L = this.renderer != null ? this.renderer(this.text, this.align, l) : x._rendercolumnheader(this.text, this.align, l, x);
+ if (L == null) {
+ L = x._rendercolumnheader(this.text, this.align, l, x)
+ }
+ if (this.renderer != null) {
+ L = b(L)
+ }
+ I &= true;
+ q = true
+ }
+ if (x.WinJS) {
+ MSApp.execUnsafeLocalFunction(function() {
+ p.append(b(L))
+ })
+ } else {
+ if (this.renderer) {
+ p.append(b(L))
+ } else {
+ if (L) {
+ p[0].innerHTML = L
+ }
+ }
+ }
+ if (L != null) {
+ var N = b('
');
+ J.addClass(x.toTP("jqx-widget-header"));
+ p.append(N);
+ var aa = N.children();
+ this.sortasc = aa[1];
+ this.sortdesc = aa[2];
+ this.filtericon = aa[0];
+ this.iconscontainer = N;
+ if (x.rtl) {
+ N.css("margin-left", "0px");
+ N.css("left", "0px");
+ b(this.sortasc).css("float", "left");
+ b(this.filtericon).css("float", "left");
+ b(this.sortdesc).css("float", "left")
+ }
+ if (!x.autoshowfiltericon && this.filterable) {
+ b(this.filtericon).css("display", "block")
+ }
+ }
+ this.element = G[0];
+ if (I) {
+ x._handlecolumnsmenu(x, p, G, J, this);
+ if (!this.menu) {
+ J.hide()
+ }
+ }
+ f.appendChild(G[0]);
+ if (x.groupable && q) {
+ G[0].id = x.dataview.generatekey();
+ if (x._handlecolumnstogroupsdragdrop) {
+ x._handlecolumnstogroupsdragdrop(this, G)
+ } else {
+ throw new Error("jqxGrid: Missing reference to jqxgrid.grouping.js.")
+ }
+ }
+ if (x.columnsreorder && this.draggable && x._handlecolumnsdragreorder) {
+ x._handlecolumnsdragreorder(this, G)
+ }
+ var Y = this;
+ x.addHandler(G, "click",
+ function(i) {
+ if (Y.checkboxcolumn) {
+ return true
+ }
+ if (x.sorttogglestates > 0 && x._togglesort) {
+ if (!x._loading) {
+ if (x.suspendClick) {
+ return true
+ }
+ x._togglesort(Y)
+ }
+ }
+ i.preventDefault();
+ x._raiseEvent(7, {
+ column: Y.getcolumnproperties(),
+ datafield: Y.datafield,
+ originalEvent: i
+ })
+ });
+ if (Y.resizable && x.columnsresize && !U) {
+ var H = false;
+ var j = "mousemove";
+ if (x.isTouchDevice() && x.touchmode !== true) {
+ H = true;
+ j = b.jqx.mobile.getTouchEventName("touchstart")
+ }
+ x.addHandler(G, j,
+ function(ab) {
+ var i = parseInt(ab.pageX);
+ var ad = 5;
+ var ag = parseInt(G.coord().left);
+ if (x.hasTransform) {
+ ag = b.jqx.utilities.getOffset(G).left
+ }
+ if (x.resizing) {
+ return true
+ }
+ if (x._handlecolumnsresize) {
+ if (H) {
+ var ac = x.getTouches(ab);
+ var af = ac[0];
+ i = af.pageX;
+ ad = 40;
+ if (i >= ag + Y.width - ad) {
+ x.resizablecolumn = {
+ columnelement: G,
+ column: Y
+ };
+ G.css("cursor", "col-resize")
+ } else {
+ G.css("cursor", "");
+ x.resizablecolumn = null
+ }
+ return true
+ }
+ var ae = Y.width;
+ if (x.rtl) {
+ ae = 0
+ }
+ if (i >= ag + ae - ad) {
+ if (i <= ag + ae + ad) {
+ x.resizablecolumn = {
+ columnelement: G,
+ column: Y
+ };
+ G.css("cursor", "col-resize");
+ return false
+ } else {
+ G.css("cursor", "");
+ x.resizablecolumn = null
+ }
+ } else {
+ G.css("cursor", "");
+ if (i < ag + ae - ad) {
+ if (!Y._animating && !Y._menuvisible) {
+ G.mouseenter()
+ }
+ }
+ x.resizablecolumn = null
+ }
+ }
+ })
+ }
+ G.css("left", h);
+ if (! (this.hidden && this.hideable)) {
+ h += O
+ }
+ if (Y.rendered) {
+ var M = Y.rendered(b(p[0].firstChild), Y.align, l);
+ if (M && N != null) {
+ N.hide()
+ }
+ }
+ if (Y.checkboxcolumn) {
+ if (N) {
+ N.hide()
+ }
+ if (!x.host.jqxCheckBox) {
+ throw new Error("jqxGrid: Missing reference to jqxcheckbox.js")
+ }
+ p.html('
');
+ var k = p.find("div:first");
+ k.jqxCheckBox({
+ _canFocus: false,
+ disabled: x.disabled,
+ disabledContainer: true,
+ theme: x.theme,
+ enableContainerClick: false,
+ width: 16,
+ height: 16,
+ animationShowDelay: 0,
+ animationHideDelay: 0
+ });
+ Y.checkboxelement = k;
+ var K = k.data().jqxCheckBox.instance;
+ x._checkboxcolumn = Y;
+ K.updated = function(ab, i, ac) {
+ x._checkboxcolumnupdating = true;
+ if (x.disabled) {
+ k.jqxCheckBox({
+ disabled: x.disabled
+ });
+ i = ac
+ }
+ if (i) {
+ x.selectallrows()
+ } else {
+ x.unselectallrows()
+ }
+ x._checkboxcolumnupdating = false
+ }
+ }
+ });
+ if (h > 0) {
+ this.columnsheader.width(2 + h)
+ } else {
+ this.columnsheader.width(h)
+ }
+ o[0].appendChild(f);
+ this.columnsrow = o;
+ x.columnsheader.append(o);
+ if (this.showfilterrow && this._updatefilterrow) {
+ if (!this.columngroups) {
+ o.height(this.columnsheight)
+ } else {
+ o.height(this.columngroupslevel * this.columnsheight)
+ }
+ if (!this.filterrow) {
+ var E = b("
");
+ E[0].id = "filterrow." + this.element.id;
+ E.height(this.filterrowheight);
+ this.filterrow = E
+ }
+ this.filterrow.width(2 + h);
+ this.columnsheader.append(this.filterrow);
+ this._updatefilterrow()
+ }
+ if (this.showeverpresentrow && this.everpresentrowposition !== "bottom") {
+ if (!this.columngroups) {
+ o.height(this.columnsheight)
+ } else {
+ o.height(this.columngroupslevel * this.columnsheight)
+ }
+ if (!this.addnewrowtop) {
+ var m = b("
");
+ m[0].id = "addnewrowtop." + this.element.id;
+ m.height(this.everpresentrowheight);
+ this.addnewrowtop = m
+ }
+ this.addnewrowtop.width(2 + h);
+ if (this.everpresentrowposition == "topAboveFilterRow") {
+ if (this.filterrow) {
+ this.addnewrowtop.insertBefore(this.filterrow)
+ } else {
+ this.columnsheader.append(this.addnewrowtop)
+ }
+ } else {
+ this.columnsheader.append(this.addnewrowtop)
+ }
+ this._updateaddnewrow()
+ } else {
+ if (this.showeverpresentrow && this.everpresentrowposition === "bottom") {
+ if (!this.addnewrowbottom) {
+ var e = b("
");
+ e[0].id = "addnewrowbottom." + this.element.id;
+ e.height(this.everpresentrowheight);
+ this.addnewrowbottom = e
+ }
+ this.addnewrowbottom.width(2 + h);
+ this.addnewrow.append(this.addnewrowbottom);
+ this._updateaddnewrow()
+ }
+ }
+ if (h == 0) {
+ o[0].style.visibility = "hidden"
+ } else {
+ o[0].style.visibility = "inherit"
+ }
+ o.width(h);
+ if (this._handlecolumnsdragdrop) {
+ this._handlecolumnsdragdrop()
+ }
+ if (this._handlecolumnsreorder) {
+ this._handlecolumnsreorder()
+ }
+ if (this._rendersortcolumn) {
+ this._rendersortcolumn()
+ }
+ if (this._renderfiltercolumn) {
+ this._renderfiltercolumn()
+ }
+ if (this._handlecolumnsresize) {
+ this._handlecolumnsresize()
+ }
+ if (this.columngroups) {
+ this._rendercolumngroups()
+ }
+ if (this._updatecheckboxselection) {
+ this._updatecheckboxselection()
+ }
+ },
+ _rendercolumngroups: function() {
+ if (!this.columngroups) {
+ return
+ }
+ var p = 0;
+ for (var m = 0; m < this.columns.records.length; m++) {
+ if (this.columns.records[m].pinned) {
+ p++
+ }
+ }
+ var u = this.headerZIndex - p + this.columns.records.length;
+ var v = this.that;
+ var h = v.toTP("jqx-grid-column-header") + " " + v.toTP("jqx-grid-columngroup-header") + " " + v.toTP("jqx-widget-header");
+ if (v.rtl) {
+ h += " " + v.toTP("jqx-grid-columngroup-header-rtl")
+ }
+ var f = this.columnsheader.find("#columntable" + this.element.id);
+ f.find("jqx-grid-columngroup-header").remove();
+ for (var k = 0; k < this.columngroupslevel - 1; k++) {
+ for (var m = 0; m < this.columngroups.length; m++) {
+ var r = this.columngroups[m];
+ var d = r.level;
+ if (d !== k) {
+ continue
+ }
+ var q = d * this.columnsheight;
+ var e = 99999;
+ if (r.groups) {
+ var t = function(y) {
+ var x = 0;
+ for (var w = 0; w < y.groups.length; w++) {
+ var i = y.groups[w];
+ if (!i.groups) {
+ if (!i.hidden) {
+ x += i.width;
+ e = Math.min(parseFloat(i.element.style.left), e)
+ }
+ } else {
+ x += t(i)
+ }
+ }
+ return x
+ };
+ r.width = t(r);
+ r.left = e;
+ var s = this.columnsheight;
+ var n = u--;
+ var g = b('
');
+ var l = b(this._rendercolumnheader(r.text, r.align, this.columnsheight, this));
+ if (r.renderer) {
+ var l = b("
");
+ var o = r.renderer(r.text, r.align, s);
+ l.html(o)
+ }
+ g.append(l);
+ g[0].style.left = e + "px";
+ if (e === 0) {
+ g[0].style.borderLeftColor = "transparent"
+ }
+ g[0].style.top = q + "px";
+ g[0].style.height = s + "px";
+ g[0].style.width = -1 + r.width + "px";
+ f.append(g);
+ r.element = g;
+ if (r.rendered) {
+ r.rendered(l, r.align, s)
+ }
+ }
+ }
+ }
+ },
+ _resizecolumngroups: function() {
+ if (!this.columngroups) {
+ return
+ }
+ for (var e = 0; e < this.columngroups.length; e++) {
+ var k = this.columngroups[e];
+ var l = k.level;
+ var j = l * this.columnsheight;
+ var h = 99999;
+ if (k.groups) {
+ var g = function(o) {
+ var n = 0;
+ for (var m = 0; m < o.groups.length; m++) {
+ var i = o.groups[m];
+ if (!i.groups) {
+ if (!i.hidden) {
+ n += i.width;
+ h = Math.min(parseFloat(i.element.style.left), h)
+ }
+ } else {
+ n += g(i)
+ }
+ }
+ return n
+ };
+ k.width = g(k);
+ k.left = h;
+ var d = this.columnsheight;
+ var f = k.element;
+ f[0].style.left = h + "px";
+ f[0].style.top = j + "px";
+ f[0].style.height = d + "px";
+ f[0].style.width = -1 + k.width + "px"
+ }
+ }
+ },
+ _handlecolumnsmenu: function(p, g, h, k, m) {
+ p.dragmousedown = null;
+ k[0].id = p.dataview.generatekey();
+ g.append(k);
+ h[0].columnsmenu = k[0];
+ m.element = h[0];
+ var l = this.columnsmenuwidth + 1;
+ var o = function() {
+ if (!m.menu) {
+ return false
+ }
+ if (!p.resizing) {
+ if (m._menuvisible && p._hasOpenedMenu) {
+ return false
+ }
+ m._animating = true;
+ if (p.menuitemsarray && p.menuitemsarray.length > 0) {
+ if (!p.enableanimations) {
+ k.css("display", "block");
+ var q = !p.rtl ? -48 : 16;
+ m.iconscontainer.css("margin-left", q + "px");
+ m._animating = false;
+ m._menuvisible = true
+ } else {
+ k.css("display", "block");
+ k.stop();
+ m.iconscontainer.stop();
+ if (!p.rtl) {
+ k.css("margin-left", "0px");
+ k.animate({
+ "margin-left": -l
+ },
+ "fast",
+ function() {
+ k.css("display", "block");
+ m._animating = false;
+ m._menuvisible = true
+ })
+ } else {
+ k.css("margin-left", -l);
+ k.animate({
+ "margin-left": "0px"
+ },
+ "fast",
+ function() {
+ k.css("display", "block");
+ m._animating = false;
+ m._menuvisible = true
+ })
+ }
+ var q = !p.rtl ? -(32 + l) : l;
+ m.iconscontainer.animate({
+ "margin-left": q
+ },
+ "fast")
+ }
+ }
+ }
+ };
+ var f = "mouseenter";
+ if (p.isTouchDevice()) {
+ f = "touchstart"
+ }
+ p.addHandler(h, f,
+ function(r) {
+ var q = parseInt(r.pageX);
+ var t = p.columnsresize && m.resizable ? 3 : 0;
+ var v = parseInt(h.coord().left);
+ if (p.hasTransform) {
+ v = b.jqx.utilities.getOffset(h).left
+ }
+ var u = m.width;
+ if (p.rtl) {
+ u = 0
+ }
+ if (t != 0) {
+ if (q >= v + u - t) {
+ if (q <= v + u + t) {
+ return false
+ }
+ }
+ }
+ var s = p.vScrollInstance.isScrolling();
+ if (m.menu && p.autoshowcolumnsmenubutton && !s && !p.disabled) {
+ o()
+ }
+ });
+ if (!p.autoshowcolumnsmenubutton) {
+ k.css("display", "block");
+ var e = !p.rtl ? -48 : 16;
+ m.iconscontainer.css("margin-left", e + "px");
+ if (!p.rtl) {
+ k.css({
+ "margin-left": -l
+ })
+ } else {
+ k.css({
+ "margin-left": "0px"
+ })
+ }
+ }
+ p.addHandler(h, "mouseleave",
+ function(q) {
+ if (p.menuitemsarray && p.menuitemsarray.length > 0 && m.menu) {
+ var s = b.data(document.body, "contextmenu" + p.element.id);
+ if (s != undefined && k[0].id == s.columnsmenu.id) {
+ return
+ }
+ if (p.autoshowcolumnsmenubutton) {
+ if (!p.enableanimations) {
+ k.css("display", "none");
+ var r = !p.rtl ? -32 : 0;
+ m.iconscontainer.css("margin-left", r + "px");
+ m._menuvisible = false
+ } else {
+ if (!p.rtl) {
+ k.css("margin-left", -l)
+ } else {
+ k.css("margin-left", "0px")
+ }
+ k.stop();
+ m.iconscontainer.stop();
+ if (!p.rtl) {
+ k.animate({
+ "margin-left": 0
+ },
+ "fast",
+ function() {
+ k.css("display", "none");
+ m._menuvisible = false
+ })
+ } else {
+ k.animate({
+ "margin-left": -l
+ },
+ "fast",
+ function() {
+ k.css("display", "none");
+ m._menuvisible = false
+ })
+ }
+ var r = !p.rtl ? -32 : 0;
+ m.iconscontainer.animate({
+ "margin-left": r
+ },
+ "fast")
+ }
+ }
+ }
+ });
+ var j = true;
+ var d = "";
+ var i = b(m.filtericon);
+ p.addHandler(k, "mousedown",
+ function(q) {
+ if (!p.gridmenu) {
+ p._initmenu()
+ }
+ j = !b.data(p.gridmenu[0], "contextMenuOpened" + p.gridmenu[0].id);
+ d = b.data(document.body, "contextmenu" + p.element.id);
+ if (d != null) {
+ d = d.column.datafield
+ }
+ });
+ p.addHandler(i, "mousedown",
+ function(q) {
+ if (!p.gridmenu) {
+ p._initmenu()
+ }
+ j = !b.data(p.gridmenu[0], "contextMenuOpened" + p.gridmenu[0].id);
+ d = b.data(document.body, "contextmenu" + p.element.id);
+ if (d != null) {
+ d = d.column.datafield
+ }
+ });
+ var n = function() {
+ if (!m.menu) {
+ return false
+ }
+ if (!p.gridmenu) {
+ p._initmenu()
+ }
+ if (p.disabled) {
+ return false
+ }
+ for (var v = 0; v < p.columns.records.length; v++) {
+ if (p.columns.records[v].datafield != m.datafield) {
+ p.columns.records[v]._menuvisible = false
+ }
+ }
+ var t = k.coord(true);
+ var A = k.height();
+ if (!j) {
+ j = true;
+ if (d == m.datafield) {
+ p._closemenu();
+ return false
+ }
+ }
+ var x = p.host.coord(true);
+ if (p.hasTransform) {
+ x = b.jqx.utilities.getOffset(p.host);
+ t = b.jqx.utilities.getOffset(k)
+ }
+ if (x.left + p.host.width() > parseInt(t.left) + p.gridmenu.width()) {
+ p.gridmenu.jqxMenu("open", t.left, t.top + A)
+ } else {
+ p.gridmenu.jqxMenu("open", k.width() + t.left - p.gridmenu.width(), t.top + A)
+ }
+ if (p.gridmenu.width() < 100) {
+ p._arrangemenu()
+ }
+ p._hasOpenedMenu = true;
+ var y = p._getmenuitembyindex(0);
+ var r = p._getmenuitembyindex(1);
+ var C = p._getmenuitembyindex(2);
+ var z = p._getmenuitembyindex(3);
+ var q = p._getmenuitembyindex(4);
+ var D = p._getmenuitembyindex(5);
+ if (y != null && r != null && C != null) {
+ var u = m.sortable && p.sortable;
+ p.gridmenu.jqxMenu("disable", y.id, !u);
+ p.gridmenu.jqxMenu("disable", r.id, !u);
+ p.gridmenu.jqxMenu("disable", C.id, !u);
+ if (m.displayfield != undefined) {
+ if (p.sortcolumn == m.displayfield) {
+ var w = p.getsortinformation();
+ if (u) {
+ if (w.sortdirection.ascending) {
+ p.gridmenu.jqxMenu("disable", y.id, true)
+ } else {
+ p.gridmenu.jqxMenu("disable", r.id, true)
+ }
+ }
+ } else {
+ p.gridmenu.jqxMenu("disable", C.id, true)
+ }
+ }
+ }
+ if (z != null && q != null) {
+ if (!p.groupable || !m.groupable) {
+ p.gridmenu.jqxMenu("disable", q.id, true);
+ p.gridmenu.jqxMenu("disable", z.id, true)
+ } else {
+ if (p.groups && p.groups.indexOf(m.datafield) != -1) {
+ p.gridmenu.jqxMenu("disable", z.id, true);
+ p.gridmenu.jqxMenu("disable", q.id, false)
+ } else {
+ p.gridmenu.jqxMenu("disable", z.id, false);
+ p.gridmenu.jqxMenu("disable", q.id, true)
+ }
+ }
+ }
+ if (D != null) {
+ p.menuOwner = m;
+ p._updatefilterpanel(p, D, m);
+ var s = 0;
+ if (p.sortable && p._togglesort && p.showsortmenuitems) {
+ s += 3
+ }
+ if (p.groupable && p.addgroup && p.showgroupmenuitems) {
+ s += 2
+ }
+ var B = s * 27 + 3;
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ B += 20;
+ b(D).height(190)
+ }
+ if (p.filterable && p.showfiltermenuitems) {
+ if (!m.filterable) {
+ p.gridmenu.height(B);
+ b(D).css("display", "none")
+ } else {
+ p.gridmenu.height(B + 180);
+ b(D).css("display", "block")
+ }
+ }
+ }
+ if (p.columnmenuopening) {
+ var E = p.columnmenuopening(p.gridmenu, m.displayfield, p.gridmenu.height());
+ if (false === E) {
+ p._closemenu()
+ }
+ }
+ b.data(document.body, "contextmenu" + p.element.id, {
+ column: m,
+ columnsmenu: k[0]
+ })
+ };
+ p.addHandler(i, "click",
+ function(q) {
+ if (!m.menu) {
+ return false
+ }
+ if (!p.showfilterrow) {
+ if (k[0].style.display != "block") {
+ h.trigger("mouseenter")
+ }
+ setTimeout(function() {
+ if (k[0].style.display != "block") {
+ h.trigger("mouseenter")
+ }
+ n()
+ },
+ 200)
+ }
+ return false
+ });
+ p.addHandler(k, "click",
+ function(q) {
+ if (!m.menu) {
+ return false
+ }
+ n();
+ return false
+ });
+ if (p.isTouchDevice()) {
+ p.addHandler(k, b.jqx.mobile.getTouchEventName("touchstart"),
+ function(q) {
+ if (!m.menu) {
+ return false
+ }
+ if (!p._hasOpenedMenu) {
+ n()
+ } else {
+ p._closemenu()
+ }
+ return false
+ })
+ }
+ },
+ _removecolumnhandlers: function(h) {
+ var e = this.that;
+ var f = b(h.element);
+ if (f.length > 0) {
+ e.removeHandler(f, "mouseenter");
+ e.removeHandler(f, "mouseleave");
+ var g = b(h.filtericon);
+ e.removeHandler(g, "mousedown");
+ e.removeHandler(g, "click");
+ e.removeHandler(f, "click");
+ e.removeHandler(f, "mousemove");
+ if (e.columnsreorder) {
+ e.removeHandler(f, "mousedown.drag");
+ e.removeHandler(f, "mousemove.drag")
+ }
+ e.removeHandler(f, "dragstart");
+ if (f[0].columnsmenu) {
+ var d = b(f[0].columnsmenu);
+ e.removeHandler(d, "click");
+ e.removeHandler(d, "mousedown");
+ e.removeHandler(d, b.jqx.mobile.getTouchEventName("touchstart"))
+ }
+ }
+ },
+ _rendercolumnheader: function(h, i, e, d) {
+ var g = "4px";
+ if (d.columngroups) {
+ g = (e / 2 - this._columnheight / 2);
+ if (g < 0) {
+ g = 4
+ }
+ g += "px"
+ } else {
+ if (this.columnsheight != 25) {
+ g = (this.columnsheight / 2 - this._columnheight / 2);
+ if (g < 0) {
+ g = 4
+ }
+ g += "px"
+ }
+ }
+ if (this.enableellipsis) {
+ return '
' + h + "
"
+ }
+ if (i == "center" || i == "middle") {
+ return '
"
+ }
+ var f = '
' + h + "";
+ return f
+ },
+ _renderrows: function(f, h, l) {
+ var r = this.that;
+ if ((this.pageable || this.groupable) && (this.autoheight || this.autorowheight)) {
+ if (this.table != null && this.table[0].rows != null && this.table[0].rows.length < this.dataview.rows.length) {
+ r.prerenderrequired = true
+ }
+ }
+ if (!this.pageable && (this.autoheight || this.autorowheight) && (this.virtualmode || this.unboundmode)) {
+ var p = this.source.totalrecords;
+ if (!isNaN(p)) {
+ if (this.table != null && this.table[0].rows != null && this.table[0].rows.length != p) {
+ r.prerenderrequired = true
+ }
+ }
+ }
+ if ((this.autoheight || this.autorowheight) && !r.prerenderrequired) {
+ if (this.table && this.table[0].rows) {
+ if (this.table[0].rows.length < this.dataview.records.length) {
+ if (this.pageable && this.table[0].rows.length < this.dataview.pagesize) {
+ r.prerenderrequired = true
+ } else {
+ if (!this.pageable) {
+ r.prerenderrequired = true
+ }
+ }
+ }
+ if (this.table[0].rows.length < this.dataview.cachedrecords.length) {
+ if (this.pageable && this.table[0].rows.length < this.dataview.pagesize) {
+ r.prerenderrequired = true
+ } else {
+ if (!this.pageable) {
+ r.prerenderrequired = true
+ }
+ }
+ }
+ }
+ }
+ r._prerenderrows(f);
+ if (r._requiresupdate) {
+ r._requiresupdate = false;
+ r._updatepageviews()
+ }
+ var q = function() {
+ if (r._loading) {
+ return
+ }
+ if (r.WinJS) {
+ MSApp.execUnsafeLocalFunction(function() {
+ r._rendervisualrows()
+ })
+ } else {
+ r._rendervisualrows()
+ }
+ if (r.virtualmode && r.showaggregates && r._updateaggregates) {
+ r.refreshaggregates()
+ }
+ };
+ var t = b.jqx.browser.msie && b.jqx.browser.version < 10;
+ if (this.virtualmode) {
+ var i = function() {
+ if (r.rendergridrows) {
+ var w = r._startboundindex;
+ if (w == undefined) {
+ w = 0
+ }
+ var u = w + 1 + r.dataview.pagesize;
+ if (w != null && u != null) {
+ var v = r.source._source ? true: false;
+ var x = !v ? r.source.recordstartindex: r.source._source.recordstartindex;
+ if (x != w || h == true) {
+ if (!v) {
+ r.source.recordstartindex = w;
+ r.source.recordendindex = u
+ } else {
+ if (u >= r.source._source.totalrecords) {
+ u = r.source._source.totalrecords;
+ w = u - r.dataview.pagesize - 1;
+ if (w < 0) {
+ w = 0
+ }
+ if (r.source._source.recordendindex == u && r.source._source.recordstartindex == w) {
+ return
+ }
+ }
+ r.source._source.recordstartindex = w;
+ r.source._source.recordendindex = u
+ }
+ r.updatebounddata("cells")
+ }
+ }
+ }
+ };
+ if (this.loadondemand) {
+ q();
+ i();
+ this.loadondemand = false
+ }
+ var j = this._browser == undefined ? this._isIE10() : this._browser;
+ if (this.editable && this.editcell && !this.vScrollInstance.isScrolling() && !this.hScrollInstance.isScrolling()) {
+ q()
+ } else {
+ if (this.autoheight) {
+ q()
+ } else {
+ if (j || t || (navigator && navigator.userAgent.indexOf("Safari") != -1)) {
+ if (this._scrolltimer != null) {
+ clearTimeout(this._scrolltimer)
+ }
+ this._scrolltimer = setTimeout(function() {
+ q()
+ },
+ 5)
+ } else {
+ q()
+ }
+ }
+ }
+ } else {
+ if (this.scrollmode == "deferred" && (this.hScrollInstance.isScrolling() || this.vScrollInstance.isScrolling())) {
+ if (this._scrolltimer != null) {
+ clearInterval(this._scrolltimer)
+ }
+ var s = this._getfirstvisualrow();
+ if (s != null) {
+ var m = function(z) {
+ if (s == null) {
+ return ""
+ }
+ var y = "
";
+ var w = r.deferreddatafields;
+ if (w == null) {
+ if (r.columns.records.length > 0) {
+ w = new Array();
+ w.push(r.columns.records[0].displayfield)
+ }
+ }
+ for (var v = 0; v < w.length; v++) {
+ var A = w[v];
+ var x = r._getcolumnbydatafield(A);
+ if (x) {
+ var u = r._getcellvalue(x, s);
+ if (x.cellsformat != "") {
+ if (b.jqx.dataFormat) {
+ if (b.jqx.dataFormat.isDate(u)) {
+ u = b.jqx.dataFormat.formatdate(u, x.cellsformat, r.gridlocalization)
+ } else {
+ if (b.jqx.dataFormat.isNumber(u)) {
+ u = b.jqx.dataFormat.formatnumber(u, x.cellsformat, r.gridlocalization)
+ }
+ }
+ }
+ }
+ y += "| " + u + " |
"
+ }
+ }
+ y += "
";
+ return y
+ };
+ var k = this.scrollfeedback ? this.scrollfeedback(s.bounddata) : m(s.bounddata);
+ if (k != this._scrollelementcontent) {
+ this._scrollelement[0].innerHTML = k;
+ this._scrollelementcontent = k
+ }
+ }
+ this._scrollelement.css("visibility", "visible");
+ this._scrollelementoverlay.css("visibility", "visible");
+ this._scrollelement.css("margin-top", -this._scrollelement.height() / 2);
+ this._scrolltimer = setInterval(function() {
+ if (!r.hScrollInstance.isScrolling() && !r.vScrollInstance.isScrolling()) {
+ q();
+ r._scrollelement.css("visibility", "hidden");
+ r._scrollelementoverlay.css("visibility", "hidden");
+ clearInterval(r._scrolltimer);
+ if (s) {
+ r.ensurerowvisible(s.visibleindex)
+ }
+ }
+ },
+ 100);
+ return
+ }
+ if (navigator && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") != -1) {
+ this._updatedelay = 1
+ }
+ if (this.touchDevice != undefined && this.touchDevice == true) {
+ this._updatedelay = 5
+ }
+ var j = this._browser == undefined ? this._isIE10() : this._browser;
+ if (j || t) {
+ this._updatedelay = 5
+ }
+ if ((j) && this.hScrollInstance.isScrolling()) {
+ q();
+ return
+ }
+ if (b.jqx.browser.mozilla && this._updatedelay == 0 && (this.vScrollInstance.isScrolling() || this.hScrollInstance.isScrolling())) {
+ this._updatedelay = 0
+ }
+ if (this.updatedelay != null) {
+ this._updatedelay = this.updatedelay
+ }
+ if (this._updatedelay == 0) {
+ q()
+ } else {
+ var d = this._jqxgridrendertimer;
+ if (d != null) {
+ clearTimeout(d)
+ }
+ if (this.vScrollInstance.isScrolling() || this.hScrollInstance.isScrolling()) {
+ if (this._updatedelay) {
+ d = setTimeout(function() {
+ q()
+ },
+ this._updatedelay)
+ } else {
+ d = null;
+ q()
+ }
+ this._jqxgridrendertimer = d
+ } else {
+ this._jqxgridrendertimer = d;
+ q()
+ }
+ }
+ }
+ if (r.autorowheight && !r.autoheight) {
+ if (this._pageviews.length > 0) {
+ var e = this._gettableheight();
+ var n = this._pageviews[0].height;
+ if (n > e) {
+ if (this.pageable && this.gotopage) {
+ n = this._pageviews[0].height;
+ if (n < 0) {
+ n = this._pageviews[0].height
+ }
+ }
+ if (this.vScrollBar.css("visibility") != "visible") {
+ this.vScrollBar.css("visibility", "visible")
+ }
+
+ if (n <= e || this.autoheight) {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+ if (n - e > 0) {
+ if (this.scrollmode != "deferred") {
+ var o = n - e;
+ var g = this.vScrollInstance.max;
+ this.vScrollBar.jqxScrollBar({
+ max: o
+ });
+ if (Math.round(o) != Math.round(g)) {
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+ }
+ else{
+ var o = n - e;
+ var g = this.vScrollInstance.max;
+ this.vScrollBar.jqxScrollBar({
+ max: o
+ });
+ }
+ } else {
+ this.vScrollBar.jqxScrollBar({
+ value: 0,
+ max: n
+ })
+ }
+ } else {
+ if (!this._loading) {
+ this.vScrollBar.css("visibility", "hidden")
+ }
+ this.vScrollBar.jqxScrollBar({
+ value: 0
+ })
+ }
+ this._arrange();
+ if (this.virtualsizeinfo) {
+ this.virtualsizeinfo.virtualheight = n
+ }
+ }
+ }
+ },
+ scrolling: function() {
+ var e = this.vScrollInstance.isScrolling();
+ var d = this.hScrollInstance.isScrolling();
+ return {
+ vertical: e,
+ horizontal: d
+ }
+ },
+ _renderhorizontalscroll: function() {
+ var t = this.hScrollInstance;
+ var u = t.value;
+ if (this.hScrollBar.css("visibility") === "hidden") {
+ t.value = 0;
+ u = 0
+ }
+ var k = parseInt(u);
+ if (this.table == null) {
+ return
+ }
+ var q = this.table[0].rows.length;
+ var p = this.columnsrow;
+ var r = this.groupable && this.groups.length > 0 ? this.groups.length: 0;
+ var l = this.columns.records.length - r;
+ var f = this.columns.records;
+ var n = this.dataview.rows.length == 0;
+ if (this.rtl) {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ k = t.max - k
+ }
+ }
+ if (n && !this._haspinned) {
+ for (var w = 0; w < q; w++) {
+ var s = this.table[0].rows[w];
+ for (var v = 0; v < r + l; v++) {
+ var d = s.cells[v];
+ if (d != undefined) {
+ var g = f[v];
+ if (g.pinned) {
+ d.style.marginLeft = k + "px";
+ if (w == 0) {
+ var e = p[0].cells[v];
+ e.style.marginLeft = k + "px"
+ }
+ }
+ }
+ }
+ }
+ this.table[0].style.marginLeft = -k + "px";
+ p[0].style.marginLeft = -k + "px"
+ } else {
+ if (this._haspinned || this._haspinned == undefined) {
+ for (var w = 0; w < q; w++) {
+ var s = this.table[0].rows[w];
+ for (var v = 0; v < r + l; v++) {
+ var d = s.cells[v];
+ if (d != undefined) {
+ var g = f[v];
+ if (g.pinned) {
+ if (k == 0 && d.style.marginLeft == "") {
+ continue
+ }
+ var h = null;
+ var x = null;
+ var o = null;
+ if (this.showeverpresentrow && this.addnewrowtop) {
+ if (this.addnewrowtop[0].cells) {
+ o = this.addnewrowtop[0].cells[v]
+ }
+ }
+ if (this.showfilterrow && this.filterrow) {
+ if (this.filterrow[0].cells) {
+ x = this.filterrow[0].cells[v]
+ }
+ }
+ if (this.showaggregates) {
+ if (this.statusbar[0].cells) {
+ h = this.statusbar[0].cells[v]
+ }
+ }
+ if (!this.rtl) {
+ d.style.marginLeft = k + "px";
+ if (w == 0) {
+ var e = p[0].cells[v];
+ e.style.marginLeft = k + "px";
+ if (h) {
+ h.style.marginLeft = k + "px"
+ }
+ if (x) {
+ x.style.marginLeft = k + "px"
+ }
+ if (o) {
+ o.style.marginLeft = k + "px"
+ }
+ }
+ } else {
+ d.style.marginLeft = -parseInt(u) + "px";
+ if (w == 0) {
+ var e = p[0].cells[v];
+ e.style.marginLeft = -parseInt(u) + "px";
+ if (h) {
+ h.style.marginLeft = -parseInt(u) + "px"
+ }
+ if (x) {
+ x.style.marginLeft = -parseInt(u) + "px"
+ }
+ if (o) {
+ o.style.marginLeft = -parseInt(u) + "px"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ this.table[0].style.marginLeft = -k + "px";
+ p[0].style.marginLeft = -k + "px"
+ } else {
+ if (this._haspinned == false) {
+ this.table[0].style.marginLeft = -k + "px";
+ p[0].style.marginLeft = -k + "px"
+ }
+ }
+ }
+ if (this.showaggregates) {
+ if (this.statusbar[0].cells) {
+ var m = 0;
+ if (this.rtl) {
+ if (this.vScrollBar.css("visibility") != "hidden") {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ m = 2 + parseInt(this.hScrollBar.css("left"))
+ }
+ }
+ }
+ this.statusbar[0].style.marginLeft = -k + m + "px"
+ }
+ }
+ if (this.showfilterrow && this.filterrow) {
+ if (this.filterrow[0].cells) {
+ this.filterrow[0].style.marginLeft = -k + "px"
+ }
+ }
+ if (this.showeverpresentrow && this.addnewrowtop) {
+ if (this.addnewrowtop[0].cells) {
+ this.addnewrowtop[0].style.marginLeft = -k + "px"
+ }
+ }
+ },
+ _updaterowdetailsvisibility: function() {
+ if (this.rowdetails) {
+ for (var d = 0; d < this._rowdetailselementscache.length; d++) {
+ b(this._rowdetailselementscache[d]).css("display", "none")
+ }
+ }
+ },
+ _getvisualcolumnsindexes: function(e, n, i, m, d, l) {
+ if (this.rowdetails || this.rtl || this.editcell || (this.width && this.width.toString().indexOf("%") >= 0) || this.exporting) {
+ return {
+ start: 0,
+ end: i + m
+ }
+ }
+ var f = 0;
+ var k = -1;
+ var g = i + m;
+ var o = false;
+ if (this.autorowheight) {
+ return {
+ start: 0,
+ end: i + m
+ }
+ }
+ if (!d) {
+ for (var h = 0; h < i + m; h++) {
+ var p = h;
+ if (!o) {
+ if (this.columns.records[h].pinned && l) {
+ o = true
+ }
+ }
+ if (!this.columns.records[h].hidden) {
+ f += this.columns.records[h].width
+ }
+ if (f >= e && k == -1) {
+ k = h
+ }
+ if (f > n + e) {
+ g = h;
+ break
+ }
+ }
+ }
+ g++;
+ if (g > i + m) {
+ g = i + m
+ }
+ if (k == -1 || o) {
+ k = 0
+ }
+ return {
+ start: k,
+ end: g
+ }
+ },
+ _getvirtualcolumnsindexes: function(e, m, i, l, d) {
+ if (this.rtl || this.editcell || this.exporting) {
+ return {
+ start: 0,
+ end: i + l
+ }
+ }
+ var f = 0;
+ var k = -1;
+ var g = i + l;
+ if (this.autorowheight) {
+ return {
+ start: 0,
+ end: i + l
+ }
+ }
+ if (!d) {
+ for (var h = 0; h < i + l; h++) {
+ var n = h;
+ if (!this.columns.records[h].hidden) {
+ f += this.columns.records[h].width
+ }
+ if (f >= e && k == -1) {
+ k = h
+ }
+ if (f > m + e) {
+ g = h;
+ break
+ }
+ }
+ }
+ g++;
+ if (g > i + l) {
+ g = i + l
+ }
+ if (k == -1) {
+ k = 0
+ }
+ return {
+ start: k,
+ end: g
+ }
+ },
+ _getfirstvisualrow: function() {
+ var e = this.vScrollInstance;
+ var g = e.value;
+ var f = parseInt(g);
+ if (this._pagescache.length == 0) {
+ this.dataview.updateview();
+ this._loadrows()
+ }
+ if (this.vScrollBar[0].style.visibility != "visible") {
+ f = 0
+ }
+ if (!this.pageable) {
+ var d = this._findvisiblerow(f, this._pageviews);
+ if (d == -1) {
+ return null
+ }
+ if (d != this.dataview.pagenum) {
+ this.dataview.pagenum = d;
+ this.dataview.updateview();
+ this._loadrows()
+ } else {
+ if (!this._pagescache[this.dataview.pagenum]) {
+ this._loadrows()
+ }
+ }
+ }
+ var h = this._findvisiblerow(f, this._pagescache[this.dataview.pagenum]);
+ var i = this._pagescache[this.dataview.pagenum];
+ if (i && i[0]) {
+ return i[h]
+ }
+ },
+ _rendervisualrows: function() {
+ if (!this.virtualsizeinfo) {
+ return
+ }
+ var Y = this.vScrollInstance;
+ var p = this.hScrollInstance;
+ var j = Y.value;
+ var C = p.value;
+ var o = parseInt(j);
+ var l = parseInt(C);
+ var x = this._gettableheight();
+ var J = this._hostwidth != undefined ? this._hostwidth: this.host.width();
+ if (this.hScrollBar[0].style.visibility == "visible") {
+ x += 29
+ }
+ if (this.scrollmode == "deferred" && this._newmax != 0) {
+ if (o > this._newmax && this._newmax != null) {
+ o = this._newmax
+ }
+ }
+ var ak = Y.isScrolling() || p.isScrolling() || this._keydown;
+ var D = this.groupable && this.groups.length > 0;
+ this.visiblerows = new Array();
+ this.hittestinfo = new Array();
+ if (this.editcell && this.editrow == undefined) {
+ this._hidecelleditor(false)
+ }
+ if (this.editrow != undefined) {
+ this._hideeditors()
+ }
+ if (this.virtualmode && !this.pageable) {
+ this._pagescache = new Array()
+ }
+ if (this._pagescache.length == 0) {
+ this.dataview.updateview();
+ this._loadrows()
+ }
+ if (this.vScrollBar[0].style.visibility == "hidden") {
+ o = 0
+ }
+ if (!this.pageable) {
+ var L = this._findvisiblerow(o, this._pageviews);
+ if (L == -1) {
+ this._clearvisualrows();
+ this._renderemptyrow();
+ this._updaterowdetailsvisibility();
+ return
+ }
+ if (L != this.dataview.pagenum) {
+ this.dataview.pagenum = L;
+ this.dataview.updateview();
+ this._loadrows()
+ } else {
+ if (!this._pagescache[this.dataview.pagenum]) {
+ this._loadrows()
+ }
+ }
+ }
+ var am = this.groupable && this.groups.length > 0 ? this.groups.length: 0;
+ if (!this.columns.records) {
+ return
+ }
+ var r = this.columns.records.length - am;
+ var ac = this._findvisiblerow(o, this._pagescache[this.dataview.pagenum]);
+ var M = this._pagescache[this.dataview.pagenum];
+ var S = ac;
+ if (S < 0) {
+ S = 0
+ }
+ var af = 0;
+ var ab = 0;
+ var Q = 0;
+ var e = 0;
+ var U = this.virtualsizeinfo.visiblerecords;
+ var P = this.groupable ? this.groups.length: 0;
+ var B = this.toTP("jqx-grid-cell") + " " + this.toTP("jqx-item");
+ if (this.rtl) {
+ B += " " + this.toTP("jqx-grid-cell-rtl")
+ }
+ if ((this.autoheight || this.autorowheight) && this.pageable) {
+ if (!this.groupable || (this.groupable && this.groups.length === 0)) {
+ U = this.dataview.pagesize
+ }
+ }
+ if (D) {
+ B = " " + this.toTP("jqx-grid-group-cell")
+ }
+ if (this.isTouchDevice()) {
+ B += " " + this.toTP("jqx-touch")
+ }
+ if (this.autorowheight) {
+ B += " jqx-grid-cell-wrap"
+ }
+ var O = this.rowsheight;
+ var G = S;
+ var al = this._rendercell;
+ var u = true;
+ var q = this._getvisualcolumnsindexes(l, J, am, r, D, true);
+ var d = q.start;
+ var aa = q.end;
+ var t = this._getvirtualcolumnsindexes(l, J, am, r, D);
+ var I = t.start;
+ var h = t.end;
+ var ae = b.jqx.browser.msie && b.jqx.browser.version < 9;
+ if ((this.autoheight || this.pageable) && this.autorowheight) {
+ if (this._pageviews[0]) {
+ this._oldpageviewheight = this._pageviews[0].height
+ }
+ }
+ if (this.autorowheight) {
+ S = 0
+ }
+ if (S >= 0) {
+ this._updaterowdetailsvisibility();
+ this._startboundindex = M != null ? M[S].bounddata.boundindex: 0;
+ this._startvisibleindex = M != null ? M[S].bounddata.visibleindex: 0;
+ var A = this.table[0].rows;
+ if (this.columns.records.length > 10 && this.enablecolumnsvirtualization) {
+ var H = function(i) {
+ if (i.parentNode && i.parentNode.nodeName != "#document-fragment") {
+ return true
+ }
+ return false
+ };
+ for (var ag = 0; ag < A.length; ag++) {
+ var k = A[ag];
+ for (var V = 0; V < I; V++) {
+ var ai = V;
+ if (this.columns.records[ai].pinned) {
+ continue
+ }
+ if (this.columns.records[ai].datafield == null) {
+ continue
+ }
+ var ah = k.cells[ai];
+ if (H(ah)) {
+ ah.parentNode.removeChild(ah)
+ }
+ var R = this.columns.records[ai].element;
+ if (H(R)) {
+ this.columnsrow[0].removeChild(R)
+ }
+ if (this.filterrow) {
+ if (H(this.filterrow[0].cells[ai]) && this.columns.records[ai].filterable) {
+ this.filterrow[0].cells[ai].parentNode.removeChild(this.filterrow[0].cells[ai])
+ }
+ }
+ }
+ for (var V = h; V < this.columns.records.length; V++) {
+ var ai = V;
+ if (this.columns.records[ai].pinned) {
+ continue
+ }
+ if (this.columns.records[ai].datafield == null) {
+ continue
+ }
+ var ah = k.cells[ai];
+ if (H(ah)) {
+ ah.parentNode.removeChild(ah)
+ }
+ var R = this.columns.records[ai].element;
+ if (H(R)) {
+ this.columnsrow[0].removeChild(R)
+ }
+ if (this.filterrow) {
+ if (H(this.filterrow[0].cells[ai]) && this.columns.records[ai].filterable) {
+ this.filterrow[0].cells[ai].parentNode.removeChild(this.filterrow[0].cells[ai])
+ }
+ }
+ }
+ for (var V = I; V < h; V++) {
+ var ai = V;
+ var ah = k.cells[ai];
+ if (!H(ah)) {
+ k.appendChild(ah)
+ }
+ var R = this.columns.records[ai].element;
+ if (!H(R)) {
+ this.columnsrow[0].appendChild(R)
+ }
+ if (this.filterrow && !H(this.filterrow[0].cells[ai]) && this.columns.records[ai].filterable) {
+ this.filterrow[0].firstChild.appendChild(this.filterrow[0].cells[ai])
+ }
+ }
+ }
+ }
+ for (var n = 0; n < U && ab < U; n++) {
+ var ad = M != undefined ? M[S + n] : null;
+ if (ad == null) {
+ S = -n;
+ if (this._pagescache[this.dataview.pagenum + 1]) {
+ M = this._pagescache[this.dataview.pagenum + 1];
+ this.dataview.pagenum++
+ } else {
+ var s = this._pageviews.length;
+ do {
+ if (this.dataview.pagenum < this._pageviews.length - 1) {
+ this.dataview.pagenum++;
+ M = undefined;
+ if (this._pageviews[this.dataview.pagenum].height > 0) {
+ this.dataview.updateview();
+ this._loadrows();
+ M = this._pagescache[this.dataview.pagenum]
+ }
+ } else {
+ M = undefined;
+ break
+ }
+ } while ( M == undefined && this . dataview . pagenum < s )
+ }
+ if (M != undefined) {
+ ad = M[S + n]
+ }
+ }
+ if (ad != null) {
+ if (ad.hidden) {
+ continue
+ }
+ this._endboundindex = this._startboundindex + n;
+ this._endvisibleindex = this._startvisibleindex + n;
+ if (n == 0) {
+ var m = Math.abs(o - ad.top);
+ this.table[0].style.top = -m + "px";
+ e = -m
+ }
+ var k = this.table[0].rows[ab];
+ if (!k) {
+ continue
+ }
+ if (parseInt(k.style.height) != ad.height) {
+ k.style.height = parseInt(ad.height) + "px"
+ }
+ Q += ad.height;
+ var X = this.rowdetails && ad.rowdetails;
+ var w = !ad.rowdetailshidden;
+ if (X && w) {
+ k.style.height = parseInt(ad.height - ad.rowdetailsheight) + "px";
+ U++
+ }
+ var K = this._isrowselected(u, ad);
+ for (var V = d; V < aa; V++) {
+ var ai = V;
+ this._rendervisualcell(al, B, K, X, w, D, P, k, ad, ai, ab, ak)
+ }
+ if (ad.group != undefined && this._rendergroup) {
+ this._rendergroup(P, k, ad, am, r, ab, J)
+ }
+ if (this.autorowheight) {// && (this.autoheight || this.pageable)) {
+ var O = this.rowsheight;
+ for (var V = d; V < aa; V++) {
+ if (this.editable && this.editcell && this.editcell.column == this.columns.records[V].datafield && this.editcell.row == this.getboundindex(ad)) {
+ if (this.editcell.editor) {
+ O = Math.max(O, this.editcell.editor.height());
+ continue
+ }
+ }
+ if (k.cells[V].firstChild) {
+ O = Math.max(O, 8 + parseInt(k.cells[V].firstChild.offsetHeight))
+ }
+ }
+ k.style.height = parseInt(O) + "px";
+ this.heights[this._startboundindex + n] = O;
+ if (X && w) {
+ O += ad.rowdetailsheight
+ }
+ ad.height = O
+ }
+ this.visiblerows[this.visiblerows.length] = ad;
+ this.hittestinfo[this.hittestinfo.length] = {
+ row: ad,
+ visualrow: k,
+ details: false
+ };
+ if (X && w) {
+ ab++;
+ var k = this.table[0].rows[ab];
+ this._renderrowdetails(B, k, ad, am, r, ab);
+ this.visiblerows[this.visiblerows.length] = ad;
+ this.hittestinfo[this.hittestinfo.length] = {
+ row: ad,
+ visualrow: k,
+ details: true
+ }
+ }
+ if (!this.autorowheight) {
+ if (Q + e >= x) {
+ break
+ }
+ }
+ } else {
+ cansetheight = true;
+ this._clearvisualrow(l, D, ab, am, r);
+ if (Q + af + e <= x) {
+ af += O
+ }
+ }
+ ab++
+ }
+ this._horizontalvalue = l;
+ if (af > 0) {
+ if (this.vScrollBar[0].style.visibility == "visible") {
+ var aj = parseInt(this.table.css("top"));
+ var F = this._pageviews[this._pageviews.length - 1];
+ var v = Y.max;
+ var E = F.top + F.height - x;
+ if (this.hScrollBar.css("visibility") == "visible") {
+ E += this.scrollbarsize + 20
+ }
+ if (v != E && !this.autorowheight) {
+ if (E >= 0) {
+ if (this.scrollmode != "deferred") {
+ Y.max = E;
+ Y.setPosition(Y.max)
+ } else {
+ if (this._newmax != E) {
+ this._newmax = E;
+ this._rendervisualrows()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (this.autorowheight) {//(this.autoheight || this.pageable) &&
+ this._pagescache = new Array();
+ var W = 0;
+ var g = 0;
+ for (var ag = 0; ag < this.visiblerows.length; ag++) {
+ var z = this.visiblerows[ag];
+ z.top = W;
+ W += z.height;
+ g += z.height;
+ var X = this.rowdetails && z.rowdetails;
+ var w = !z.rowdetailshidden;
+ var k = this.table[0].rows[ag];
+ if (X && w) {
+ ag++
+ }
+ for (var V = d; V < aa; V++) {
+ var Z = this.columns.records[V];
+ if (!Z.hidden) {
+ if (!Z.cellsrenderer) {
+ var N = k.cells[V];
+ var f = 0;
+ if (N.firstChild) {
+ var f = (z.height - parseInt(N.firstChild.offsetHeight) - 8) / 2;
+ if (X && w) {
+ var f = (z.height - z.rowdetailsheight - b(N.firstChild).height() - 8) / 2
+ }
+ } else {
+ var f = (z.height - parseInt(b(N).height()) - 8) / 2
+ }
+ if (f >= 0) {
+ f = parseInt(f) + 4;
+ if (N.firstChild) {
+ if (N.firstChild.className.indexOf("jqx-grid-groups-row") == -1) {
+ if (Z.columntype != "checkbox" && Z.columntype != "button") {
+ if (this.editable && this.editcell && this.editcell.column == Z.datafield && this.editcell.row == this.getboundindex(z)) {
+ continue
+ }
+ N.firstChild.style.marginTop = f + "px"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (this._pageviews[0]) {
+ this._pageviews[0].height = g
+ }
+ this._arrange()
+ }
+ this._renderemptyrow();
+ if (this.toCompile && this.toCompile.length > 0) {
+ var T = this;
+ b.each(T.toCompile,
+ function(y, an) {
+ if (this.compiled) {
+ return true
+ }
+ var i = this.cell;
+ if (!i) {
+ return true
+ }
+ if (b.jqx.angularCompile) {
+ b.jqx.angularCompile(i, "
" + this.value + "
")
+ }
+ this.compiled = true
+ })
+ }
+ },
+ _hideemptyrow: function() {
+ if (!this.showemptyrow) {
+ return
+ }
+ if (!this.table) {
+ return
+ }
+ if (!this.table[0].rows) {
+ return
+ }
+ var f = this.table[0].rows[0];
+ if (!f) {
+ return
+ }
+ var g = false;
+ for (var e = 0; e < f.cells.length; e++) {
+ var d = b(f.cells[e]);
+ if (d.css("display") != "none" && !g) {
+ if (d.width() == this.host.width() || d.text() == this.gridlocalization.emptydatastring) {
+ d[0].checkbox = null;
+ d[0].button = null;
+ g = true;
+ d[0].innerHTML = ""
+ }
+ }
+ }
+ },
+ _renderemptyrow: function() {
+ if (this._loading) {
+ return
+ }
+ if (this.dataview.records.length == 0 && this.showemptyrow) {
+ var l = false;
+ var e = this.toTP("jqx-grid-cell");
+ if (this.table && this.table.length > 0 && this.table[0].rows && this.table[0].rows.length > 0) {
+ var k = this.table[0].rows[0];
+ this.table[0].style.top = "0px";
+ for (var f = 0; f < k.cells.length; f++) {
+ var d = b(k.cells[f]);
+ if (d.css("display") != "none" && !l) {
+ d[0].checkbox = null;
+ d[0].button = null;
+ d[0].className = e;
+ l = true;
+ d[0].innerHTML = "";
+ var g = b("
");
+ g.text(this.gridlocalization.emptydatastring);
+ d.append(g);
+ var j = 0;
+ if (!this.oldhscroll) {
+ j = parseInt(this.table[0].style.marginLeft);
+ if (this.rtl) {
+ d.css("z-index", 999);
+ d.css("overflow", "visible")
+ }
+ }
+ g.css("left", -j - (g.width() / 2));
+ g.css("top", this._gettableheight() / 2 - g.height() / 2);
+ if (b.jqx.browser.msie && b.jqx.browser.version < 8) {
+ g.css("margin-left", "0px");
+ g.css("left", this.host.width() / 2 - g.width() / 2)
+ }
+ var h = Math.abs(parseInt(this.table[0].style.top));
+ if (isNaN(h)) {
+ h = 0
+ }
+ b(k).height(this._gettableheight() + h);
+ d.css("margin-left", "0px");
+ d.width(this.host.width());
+ if (this.table.width() < this.host.width()) {
+ this.table.width(this.host.width())
+ }
+ }
+ d.addClass(this.toThemeProperty("jqx-grid-empty-cell"))
+ }
+ }
+ }
+ },
+ _clearvisualrows: function() {
+ var e = this.virtualsizeinfo.visiblerecords;
+ var f = this.hScrollInstance;
+ var d = f.value;
+ var g = parseInt(d);
+ var i = this.groupable && this.groups.length > 0;
+ if (!this.columns.records) {
+ return
+ }
+ for (var h = 0; h < e; h++) {
+ this._clearvisualrow(g, i, h, 0, this.columns.records.length)
+ }
+ },
+ _iscellselected: function(j, i, g) {
+ var f = false;
+ var e = 0;
+ if (this.virtualmode && this.pageable && this.groupable) {
+ if (this.groups.length > 0) {
+ e = this.dataview.pagesize * this.dataview.pagenum
+ }
+ }
+ if (this.groups.length > 0 && this.pageable && this.groupable) {
+ var d = this.getrowboundindexbyid(i.bounddata.uid);
+ for (var h in this.selectedcells) {
+ if (h == d + "_" + g) {
+ f = true
+ }
+ }
+ return f
+ }
+ if (j && i.bounddata != null) {
+ if (this.selectionmode != "singlerow") {
+ if (this.dataview.filters.length > 0) {
+ if (!this.virtualmode && i.bounddata.dataindex != undefined) {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.dataindex + "_" + g) {
+ f = true
+ }
+ }
+ } else {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.boundindex + "_" + g) {
+ f = true
+ }
+ }
+ }
+ } else {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.boundindex + "_" + g) {
+ f = true;
+ break
+ }
+ }
+ }
+ } else {
+ if (this.dataview.filters.length > 0) {
+ if (!this.virtualmode && i.bounddata.dataindex != undefined) {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.dataindex + "_" + g) {
+ f = true;
+ break
+ }
+ }
+ } else {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.boundindex + "_" + g) {
+ f = true;
+ break
+ }
+ }
+ }
+ } else {
+ for (var h in this.selectedcells) {
+ if (h == e + i.bounddata.boundindex == this.selectedrowindex) {
+ f = true;
+ break
+ }
+ }
+ }
+ }
+ }
+ return f
+ },
+ _isrowselected: function(h, g) {
+ var f = false;
+ var e = 0;
+ if (this.virtualmode && this.pageable && this.groupable) {
+ if (this.groups.length > 0) {
+ e = this.dataview.pagesize * this.dataview.pagenum
+ }
+ }
+ if (this.groupable && this.groups.length > 0 && this.pageable) {
+ var d = this.getrowboundindexbyid(g.bounddata.uid);
+ if (d == undefined || d == -1) {
+ return false
+ }
+ if (this.selectedrowindexes.indexOf(d) != -1) {
+ f = true
+ }
+ if (!f) {
+ f = d == this.selectedrowindex && this.selectedrowindex != -1
+ }
+ return f
+ }
+ if (h && g.bounddata != null) {
+ if (this.selectionmode != "singlerow") {
+ if (this.dataview.filters.length > 0) {
+ if (!this.virtualmode && g.bounddata.dataindex != undefined) {
+ if (this.selectedrowindexes.indexOf(e + g.bounddata.dataindex) != -1) {
+ f = true
+ }
+ } else {
+ if (this.selectedrowindexes.indexOf(e + g.bounddata.boundindex) != -1) {
+ f = true
+ }
+ }
+ } else {
+ if (this.selectedrowindexes.indexOf(e + g.bounddata.boundindex) != -1) {
+ f = true
+ }
+ }
+ } else {
+ if (this.dataview.filters.length > 0) {
+ if (!this.virtualmode && g.bounddata.dataindex != undefined) {
+ if (this.selectedrowindexes.indexOf(e + g.bounddata.dataindex) != -1) {
+ f = true
+ }
+ } else {
+ if (this.selectedrowindexes.indexOf(e + g.bounddata.boundindex) != -1) {
+ f = true
+ }
+ }
+ } else {
+ if (e + g.bounddata.boundindex == this.selectedrowindex) {
+ f = true
+ }
+ }
+ }
+ }
+ return f
+ },
+ _rendervisualcell: function(z, i, p, k, t, x, j, q, d, h, s, n) {
+ var f = null;
+ var g = this.columns.records[h];
+ if (g.hidden) {
+ var e = q.cells[h];
+ e.innerHTML = "";
+ return
+ }
+ cellvalue = this._getcellvalue(g, d);
+ var e = q.cells[h];
+ var w = i;
+ if (this.selectionmode.indexOf("cell") != -1) {
+ if (this.dataview.filters.length > 0) {
+ if (this.selectedcells[d.bounddata.dataindex + "_" + g.datafield]) {
+ p = true
+ } else {
+ p = false
+ }
+ } else {
+ if (this.selectedcells[d.boundindex + "_" + g.datafield]) {
+ p = true
+ } else {
+ p = false
+ }
+ }
+ if (this.editcell) {
+ if (this.editcell.row === d.boundindex && this.editcell.column === g.datafield) {
+ if (g.columntype !== "checkbox") {
+ p = false
+ }
+ }
+ }
+ if (this.virtualmode || (this.groupable && this.groups.length > 0 && this.pageable)) {
+ p = this._iscellselected(true, d, g.datafield)
+ }
+ }
+ if (g.cellclassname != "" && g.cellclassname) {
+ if (typeof g.cellclassname == "string") {
+ w += " " + g.cellclassname
+ } else {
+ var m = g.cellclassname(this.getboundindex(d), g.datafield, cellvalue, d.bounddata);
+ if (m) {
+ w += " " + m
+ }
+ }
+ }
+ var o = this.showsortcolumnbackground && this.sortcolumn && g.displayfield == this.sortcolumn;
+ if (o) {
+ w += " " + this.toTP("jqx-grid-cell-sort")
+ }
+ if (g.filter && this.showfiltercolumnbackground) {
+ w += " " + this.toTP("jqx-grid-cell-filter")
+ }
+ if ((g.pinned && this.showpinnedcolumnbackground) || g.grouped) {
+ if (x) {
+ w += " " + this.toTP("jqx-grid-cell-pinned")
+ } else {
+ w += " " + this.toTP("jqx-grid-cell-pinned")
+ }
+ }
+ if (this.altrows && d.group == undefined) {
+ var y = d.visibleindex;
+ if (y >= this.altstart) {
+ if ((this.altstart + y) % (1 + this.altstep) == 0) {
+ if (!o) {
+ w += " " + this.toTP("jqx-grid-cell-alt")
+ } else {
+ w += " " + this.toTP("jqx-grid-cell-sort-alt")
+ }
+ if (g.filter && this.showfiltercolumnbackground) {
+ w += " " + this.toTP("jqx-grid-cell-filter-alt")
+ }
+ if (g.pinned && this.showpinnedcolumnbackground) {
+ w += " " + this.toTP("jqx-grid-cell-pinned-alt")
+ }
+ }
+ }
+ }
+ if (h <= j) {
+ if (x || this.rowdetails) {
+ var u = b(e);
+ var l = this.columns.records[h].width;
+ if (e.style.width != parseInt(l) + "px") {
+ u.width(l)
+ }
+ }
+ } else {
+ if (x || this.rowdetails) {
+ if (this._hiddencolumns) {
+ var u = b(e);
+ var l = this.columns.records[h].width;
+ if (parseInt(e.style.width) != l) {
+ u.width(l)
+ }
+ }
+ }
+ }
+ var v = true;
+ if (this.rowdetails && k) {
+ if (t && !x) {
+ w += " " + this.toTP("jqx-grid-details-cell")
+ } else {
+ if (x) {
+ w += " " + this.toTP("jqx-grid-group-details-cell")
+ }
+ }
+ if (this.showrowdetailscolumn) {
+ if (!this.rtl) {
+ if (d.group == undefined && h == j) {
+ var r = this.toThemeProperty("jqx-icon-arrow-down");
+ if (t) {
+ w += " " + this.toTP("jqx-grid-group-expand");
+ w += " " + r
+ } else {
+ w += " " + this.toTP("jqx-grid-group-collapse");
+ var r = this.toThemeProperty("jqx-icon-arrow-right");
+ w += " " + r
+ }
+ v = false;
+ e.title = "";
+ e.innerHTML = "";
+ if (e.className != w) {
+ e.className = w
+ }
+ return
+ }
+ } else {
+ if (d.group == undefined && h == q.cells.length - j - 1) {
+ var r = this.toThemeProperty("jqx-icon-arrow-down");
+ if (t) {
+ w += " " + this.toTP("jqx-grid-group-expand-rtl");
+ w += " " + r
+ } else {
+ w += " " + this.toTP("jqx-grid-group-collapse-rtl");
+ var r = this.toThemeProperty("jqx-icon-arrow-left");
+ w += " " + r
+ }
+ v = false;
+ e.title = "";
+ e.innerHTML = "";
+ if (e.className != w) {
+ e.className = w
+ }
+ return
+ }
+ }
+ }
+ }
+ if (p && v && h >= j) {
+ w += " " + this.toTP("jqx-grid-cell-selected");
+ w += " " + this.toTP("jqx-fill-state-pressed")
+ }
+ if (e.className != w) {
+ e.className = w
+ }
+ if (d.group != undefined) {
+ cellvalue = "";
+ e.title = "";
+ e.innerHTML = "";
+ return
+ }
+ z(this, g, d, cellvalue, e, n)
+ },
+ _rendercell: function(u, f, j, s, d, q) {
+ var g = s + "_" + f.visibleindex;
+ if (f.columntype == "number" || f.cellsrenderer != null) {
+ var g = j.uniqueid + "_" + f.visibleindex
+ }
+ if (f.columntype == "number") {
+ s = j.visibleindex
+ }
+ if (u.editcell && u.editrow == undefined) {
+ if (u.editmode == "selectedrow" && f.editable && u.editable) {
+ if (u.editcell.row == u.getboundindex(j)) {
+ if (u._showcelleditor) {
+ if (!u.hScrollInstance.isScrolling() && !u.vScrollInstance.isScrolling()) {
+ u._showcelleditor(u.editcell.row, f, d, u.editcell.init)
+ } else {
+ u._showcelleditor(u.editcell.row, f, d, false, false)
+ }
+ return
+ }
+ }
+ } else {
+ if (u.editcell.row == u.getboundindex(j) && u.editcell.column == f.datafield) {
+ u.editcell.element = d;
+ if (u.editcell.editing) {
+ if (u._showcelleditor) {
+ if (!u.hScrollInstance.isScrolling() && !u.vScrollInstance.isScrolling()) {
+ u._showcelleditor(u.editcell.row, f, u.editcell.element, u.editcell.init)
+ } else {
+ u._showcelleditor(u.editcell.row, f, u.editcell.element, u.editcell.init, false)
+ }
+ return
+ }
+ }
+ }
+ }
+ }
+ var r = u._defaultcellsrenderer(s, f);
+ var n = u._cellscache[g];
+ if (n) {
+ if (f.columntype == "inline") {
+ u._renderinlinecell(u, d, f, j, s);
+ if (f.cellsrenderer != null) {
+ var h = f.cellsrenderer(u.getboundindex(j), f.datafield, s, r, f.getcolumnproperties(), j.bounddata);
+ if (h != undefined) {
+ d.innerHTML = h
+ }
+ }
+ return
+ } else {
+ if (f.columntype == "checkbox") {
+ if (u.host.jqxCheckBox) {
+ if (s === "") {
+ s = null
+ }
+ var m = d.innerHTML.toString().length == 0;
+ if (d.checkbox && !u.groupable && !m) {
+ d.checkboxrow = u.getboundindex(j);
+ if (s == "") {
+ s = false
+ }
+ if (s == "1") {
+ s = true
+ }
+ if (s == "0") {
+ s = false
+ }
+ if (s == 1) {
+ s = true
+ }
+ if (s == 0) {
+ s = false
+ }
+ if (s == "true") {
+ s = true
+ }
+ if (s == "false") {
+ s = false
+ }
+ if (s == null && !f.threestatecheckbox) {
+ s = false
+ }
+ if (f.checkboxcolumn) {
+ s = false;
+ if (u.dataview.filters.length > 0 && !u.virtualmode && j.bounddata.dataindex != undefined) {
+ if (u.selectedrowindexes.indexOf(j.bounddata.dataindex) != -1) {
+ s = true
+ }
+ } else {
+ if (u.selectedrowindexes.indexOf(j.bounddata.boundindex) != -1) {
+ s = true
+ }
+ }
+ }
+ if (!u.disabled) {
+ if (d.checkboxinstance) {
+ d.checkboxinstance._setState(s)
+ } else {
+ d.checkbox.jqxCheckBox("_setState", s)
+ }
+ }
+ } else {
+ u._rendercheckboxcell(u, d, f, j, s)
+ }
+ if (f.cellsrenderer != null) {
+ var h = f.cellsrenderer(u.getboundindex(j), f.datafield, s, r, f.getcolumnproperties(), j.bounddata);
+ if (h != undefined) {
+ d.innerHTML = h
+ }
+ }
+ return
+ }
+ } else {
+ if (f.columntype == "button") {
+ if (u.host.jqxButton) {
+ if (s == "") {
+ s = false
+ }
+ if (f.cellsrenderer != null) {
+ s = f.cellsrenderer(u.getboundindex(j), f.datafield, s, r, f.getcolumnproperties(), j.bounddata)
+ }
+ if (d.innerHTML == "") {
+ d.buttonrow = u.getboundindex(j);
+ d.button = null;
+ u._renderbuttoncell(u, d, f, j, s)
+ }
+ if (d.button && !u.groupable) {
+ d.buttonrow = u.getboundindex(j);
+ d.button.val(s)
+ } else {
+ u._renderbuttoncell(u, d, f, j, s)
+ }
+ return
+ }
+ }
+ }
+ }
+ var t = n.element;
+ if (f.cellsrenderer != null || (d.childNodes && d.childNodes.length == 0) || u.groupable || u.rowdetails) {
+ if (d.innerHTML != t) {
+ d.innerHTML = t
+ }
+ } else {
+ if (d.innerHTML.indexOf("editor") >= 0) {
+ d.innerHTML = t
+ } else {
+ if (q) {
+ var o = t.indexOf(">");
+ var l = t.indexOf("");
+ var p = t.substring(o + 1, l);
+ var i = d.childNodes[0];
+ if (p.indexOf(">") >= 0) {
+ d.innerHTML = t
+ } else {
+ if (i.childNodes[0]) {
+ if (p != i.childNodes[0].nodeValue) {
+ if (p.indexOf("&") >= 0) {
+ d.innerHTML = t
+ } else {
+ i.childNodes[0].nodeValue = p
+ }
+ }
+ } else {
+ var e = document.createTextNode(p);
+ i.appendChild(e)
+ }
+ }
+ } else {
+ if (d.innerHTML != t) {
+ d.innerHTML = t
+ }
+ }
+ }
+ }
+ if (u.enabletooltips && f.enabletooltips) {
+ d.title = n.title
+ }
+ return
+ }
+ if (f.columntype == "checkbox") {
+ u._rendercheckboxcell(u, d, f, j, s);
+ u._cellscache[g] = {
+ element: "",
+ title: s
+ };
+ if (u.enabletooltips && f.enabletooltips) {
+ d.title = s
+ }
+ return
+ } else {
+ if (f.columntype == "button") {
+ if (f.cellsrenderer != null) {
+ s = f.cellsrenderer(u.getboundindex(j), f.datafield, s, r, f.getcolumnproperties(), j.bounddata)
+ }
+ u._renderbuttoncell(u, d, f, j, s);
+ u._cellscache[g] = {
+ element: "",
+ title: s
+ };
+ if (u.enabletooltips && f.enabletooltips) {
+ d.title = s
+ }
+ return
+ } else {
+ if (f.columntype == "number") {
+ s = j.visibleindex
+ } else {
+ if (f.columntype == "inline") {
+ u._renderinlinecell(u, d, f, j, s);
+ u._cellscache[g] = {
+ element: "",
+ title: s
+ };
+ if (u.enabletooltips && f.enabletooltips) {
+ d.title = s
+ }
+ return
+ }
+ }
+ }
+ }
+ var t = null;
+ if (f.cellsrenderer != null) {
+ t = f.cellsrenderer(u.getboundindex(j), f.datafield, s, r, f.getcolumnproperties(), j.bounddata);
+ if (t && (t.indexOf("
= 0 || t.indexOf(" ng-") >= 0)) {
+ if (u.toCompile) {
+ u.toCompile.push({
+ cell: d,
+ value: t,
+ row: u.getboundindex(j)
+ })
+ }
+ return
+ }
+ } else {
+ t = r
+ }
+ if (t == null) {
+ t = r
+ }
+ var k = s;
+ if (u.enabletooltips && f.enabletooltips) {
+ if (f.cellsformat != "") {
+ if (b.jqx.dataFormat) {
+ if (b.jqx.dataFormat.isDate(s)) {
+ k = b.jqx.dataFormat.formatdate(k, f.cellsformat, u.gridlocalization)
+ } else {
+ if (b.jqx.dataFormat.isNumber(s)) {
+ k = b.jqx.dataFormat.formatnumber(k, f.cellsformat, u.gridlocalization)
+ }
+ }
+ }
+ }
+ d.title = k
+ }
+ if (u.WinJS) {
+ b(d).html(t)
+ } else {
+ d.innerHTML = t
+ }
+ u._cellscache[g] = {
+ element: d.innerHTML,
+ title: k
+ };
+ return true
+ },
+ _isIE10: function() {
+ if (this._browser == undefined) {
+ var e = b.jqx.utilities.getBrowser();
+ if (e.browser == "msie" && parseInt(e.version) > 9) {
+ this._browser = true
+ } else {
+ this._browser = false;
+ if (e.browser == "msie") {
+ var d = "Browser CodeName: " + navigator.appCodeName + "";
+ d += "Browser Name: " + navigator.appName + "";
+ d += "Browser Version: " + navigator.appVersion + "";
+ d += "Platform: " + navigator.platform + "";
+ d += "User-agent header: " + navigator.userAgent + "";
+ if (d.indexOf("Zune 4.7") != -1) {
+ this._browser = true
+ }
+ }
+ }
+ }
+ return this._browser
+ },
+ _renderinlinecell: function(f, d, e, i, g) {
+ var h = b(d);
+ d.innerHTML = ''
+ },
+ _rendercheckboxcell: function(g, e, f, k, h) {
+ if (g.host.jqxCheckBox) {
+ var j = b(e);
+ if (h === "") {
+ if (f.threestatecheckbox) {
+ h = null
+ } else {
+ h = false
+ }
+ }
+ if (h == "1") {
+ h = true
+ }
+ if (h == "0") {
+ h = false
+ }
+ if (h == 1) {
+ h = true
+ }
+ if (h == 0) {
+ h = false
+ }
+ if (h == "true") {
+ h = true
+ }
+ if (h == "false") {
+ h = false
+ }
+ if (f.checkboxcolumn) {
+ h = false;
+ var d = this.getboundindex(k);
+ if (this.selectedrowindexes.indexOf(d) != -1) {
+ h = true
+ }
+ }
+ if (j.find(".jqx-checkbox").length == 0) {
+ e.innerHTML = '';
+ b(e.firstChild).jqxCheckBox({
+ disabled: g.disabled,
+ _canFocus: false,
+ hasInput: false,
+ hasThreeStates: f.threestatecheckbox,
+ enableContainerClick: false,
+ animationShowDelay: 0,
+ animationHideDelay: 0,
+ locked: true,
+ theme: g.theme,
+ checked: h
+ });
+ if (this.editable && f.editable) {
+ b(e.firstChild).jqxCheckBox({
+ locked: false
+ })
+ }
+ if (f.checkboxcolumn) {
+ b(e.firstChild).jqxCheckBox({
+ locked: false
+ })
+ }
+ e.checkbox = b(e.firstChild);
+ e.checkboxinstance = e.checkbox.data().jqxCheckBox.instance;
+ e.checkboxrow = this.getboundindex(k);
+ var i = b.data(e.firstChild, "jqxCheckBox").instance;
+ i.updated = function(l, s, m) {
+ if (g.disabled) {
+ s = m;
+ var p = g.table[0].rows.length;
+ var r = g._getcolumnindex(f.datafield);
+ for (var o = 0; o < p; o++) {
+ var n = g.table[0].rows[o].cells[r].firstChild;
+ if (n) {
+ b(n).jqxCheckBox({
+ disabled: g.disabled
+ })
+ }
+ }
+ }
+ if (f.editable && !g.disabled) {
+ var p = g.table[0].rows.length;
+ var r = g._getcolumnindex(f.datafield);
+ if (g.editrow == undefined) {
+ if (f.cellbeginedit) {
+ var u = f.cellbeginedit(e.checkboxrow, f.datafield, f.columntype, !s);
+ if (u == false) {
+ g.setcellvalue(e.checkboxrow, f.datafield, !s, true);
+ return
+ }
+ }
+ if (f.cellvaluechanging) {
+ var t = f.cellvaluechanging(e.checkboxrow, f.datafield, f.columntype, m, s);
+ if (t != undefined) {
+ s = t
+ }
+ }
+ if (g.editmode !== "selectedrow") {
+ for (var o = 0; o < p; o++) {
+ var n = g.table[0].rows[o].cells[r].firstChild;
+ if (n) {
+ b(n).jqxCheckBox("destroy")
+ }
+ }
+ }
+ if (g.editcell && g.editcell.validated == false) {
+ g.setcellvalue(e.checkboxrow, f.datafield, !s, true)
+ } else {
+ if (g.editmode !== "selectedrow" || g.editcell == null) {
+ var q = g.getrowdata(e.checkboxrow);
+ g._raiseEvent(17, {
+ rowindex: e.checkboxrow,
+ row: q,
+ datafield: f.datafield,
+ value: m,
+ columntype: f.columntype
+ });
+ g.setcellvalue(e.checkboxrow, f.datafield, s, true);
+ g._raiseEvent(18, {
+ rowindex: e.checkboxrow,
+ row: q,
+ datafield: f.datafield,
+ oldvalue: m,
+ value: s,
+ columntype: f.columntype
+ })
+ } else {
+ g.setcellvalue(e.checkboxrow, f.datafield, s, false, false)
+ }
+ }
+ if (f.cellendedit) {
+ f.cellendedit(e.checkboxrow, f.datafield, f.columntype, s)
+ }
+ }
+ } else {
+ if (f.checkboxcolumn) {
+ if (g.editcell) {
+ g.endcelledit(g.editcell.row, g.editcell.column, false, true)
+ }
+ if (!g.disabled) {
+ if (s) {
+ g.selectrow(e.checkboxrow)
+ } else {
+ g.unselectrow(e.checkboxrow)
+ }
+ if (g.autosavestate) {
+ if (g.savestate) {
+ g.savestate()
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ e.checkboxrow = this.getboundindex(k);
+ b(e.firstChild).jqxCheckBox("_setState", h, !(this.editable && f.editable) && !f.checkboxcolumn)
+ }
+ }
+ },
+ _renderbuttoncell: function(h, e, g, k, i) {
+ if (h.host.jqxButton) {
+ var j = b(e);
+ if (i == "") {
+ i = false
+ }
+ if (j.find(".jqx-button").length == 0) {
+ e.innerHTML = '';
+ b(e.firstChild).val(i);
+ b(e.firstChild).attr("hideFocus", "true");
+ b(e.firstChild).jqxButton({
+ disabled: h.disabled,
+ theme: h.theme,
+ height: h.rowsheight - 4,
+ width: g.width - 4
+ });
+ e.button = b(e.firstChild);
+ e.buttonrow = h.getboundindex(k);
+ var d = this.isTouchDevice();
+ if (d) {
+ var f = b.jqx.mobile.getTouchEventName("touchend");
+ h.addHandler(b(e.firstChild), f,
+ function(l) {
+ if (g.buttonclick) {
+ g.buttonclick(e.buttonrow, l)
+ }
+ })
+ } else {
+ h.addHandler(b(e.firstChild), "click",
+ function(l) {
+ if (g.buttonclick) {
+ g.buttonclick(e.buttonrow, l)
+ }
+ })
+ }
+ } else {
+ e.buttonrow = h.getboundindex(k);
+ b(e.firstChild).val(i)
+ }
+ }
+ },
+ _clearvisualrow: function(g, f, o, i, n) {
+ var m = this.toTP("jqx-grid-cell");
+ if (f) {
+ m = " " + this.toTP("jqx-grid-group-cell")
+ }
+ m += " " + this.toTP("jqx-grid-cleared-cell");
+ var p = this.table[0].rows;
+ for (var k = 0; k < i + n; k++) {
+ if (p[o]) {
+ var e = p[o].cells[k];
+ if (e.className != m) {
+ e.className = m
+ }
+ var d = this.columns.records[k];
+ if (this._horizontalvalue != g && !d.pinned) {
+ if (this.oldhscroll == true) {
+ var h = -g;
+ e.style.marginLeft = -g + "px"
+ }
+ }
+ var l = d.width;
+ if (l < d.minwidth) {
+ l = d.minwidth
+ }
+ if (l > d.maxwidth) {
+ l = d.maxwidth
+ }
+ if (parseInt(e.style.width) != l) {
+ if (l != "auto") {
+ b(e)[0].style.width = l + "px"
+ } else {
+ b(e)[0].style.width = l
+ }
+ }
+ if (e.title != "") {
+ e.title = ""
+ }
+ if (e.innerHTML != "") {
+ e.innerHTML = ""
+ }
+ }
+ }
+ if (p[o]) {
+ if (parseInt(p[o].style.height) != this.rowsheight) {
+ p[o].style.height = parseInt(this.rowsheight) + "px"
+ }
+ }
+ },
+ _findgroupstate: function(e) {
+ var d = this._findgroup(e);
+ if (d == null) {
+ return false
+ }
+ return d.expanded
+ },
+ _findgroup: function(e) {
+ var d = null;
+ if (this.expandedgroups[e]) {
+ return this.expandedgroups[e]
+ }
+ return d
+ },
+ _clearcaches: function() {
+ this._columnsbydatafield = new Array();
+ this._pagescache = new Array();
+ this._pageviews = new Array();
+ this._cellscache = new Array();
+ this.heights = new Array();
+ this.hiddens = new Array();
+ this.hiddenboundrows = new Array();
+ this.heightboundrows = new Array();
+ this.detailboundrows = new Array();
+ this.details = new Array();
+ this.expandedgroups = new Array();
+ this._rowdetailscache = new Array();
+ this._rowdetailselementscache = new Array();
+ if (b.jqx.dataFormat) {
+ b.jqx.dataFormat.cleardatescache()
+ }
+ this.tableheight = null
+ },
+ _getColumnText: function(d) {
+ if (this._columnsbydatafield == undefined) {
+ this._columnsbydatafield = new Array()
+ }
+ if (this._columnsbydatafield[d]) {
+ return this._columnsbydatafield[d]
+ }
+ var f = d;
+ var e = null;
+ b.each(this.columns.records,
+ function() {
+ if (this.datafield == d || this.displayfield == d) {
+ f = this.text;
+ e = this;
+ return false
+ }
+ });
+ this._columnsbydatafield[d] = {
+ label: f,
+ column: e
+ };
+ return this._columnsbydatafield[d]
+ },
+ _getcolumnbydatafield: function(d) {
+ if (this.__columnsbydatafield == undefined) {
+ this.__columnsbydatafield = new Array()
+ }
+ if (this.__columnsbydatafield[d]) {
+ return this.__columnsbydatafield[d]
+ }
+ var f = d;
+ var e = null;
+ b.each(this.columns.records,
+ function() {
+ if (this.datafield == d || this.displayfield == d) {
+ f = this.text;
+ e = this;
+ return false
+ }
+ });
+ this.__columnsbydatafield[d] = e;
+ return this.__columnsbydatafield[d]
+ },
+ isscrollingvertically: function() {
+ var d = (this.vScrollBar.jqxScrollBar("isScrolling"));
+ return d
+ },
+ _renderrowdetails: function(q, y, d, x, n, A) {
+ if (y == undefined) {
+ return
+ }
+ var E = b(y);
+ var g = 0;
+ var t = this.rowdetails && this.showrowdetailscolumn ? (1 + this.groups.length) * this.groupindentwidth: (this.groups.length) * this.groupindentwidth;
+ if (this.groupable && this.groups.length > 0) {
+ for (var r = 0; r <= n; r++) {
+ var e = b(y.cells[r]);
+ e[0].innerHTML = "";
+ e[0].className = "jqx-grid-details-cell"
+ }
+ }
+ var e = b(y.cells[g]);
+ if (e[0].style.display == "none") {
+ var o = y.cells[g];
+ var B = 2;
+ var l = g;
+ while (o != undefined && o.style.display == "none" && B < 10) {
+ o = y.cells[l + B - 1];
+ B++
+ }
+ e = b(o)
+ }
+ if (this.rtl) {
+ for (var v = x; v < n; v++) {
+ y.cells[v].innerHTML = "";
+ y.cells[v].className = "jqx-grid-details-cell"
+ }
+ }
+ e.css("width", "100%");
+ E.height(d.rowdetailsheight);
+ e[0].className = q;
+ var p = this.getboundindex(d);
+ var j = p + "_";
+ if (this._rowdetailscache[j]) {
+ var u = this._rowdetailscache[j];
+ var C = u.html;
+ if (this.initrowdetails) {
+ if (this._rowdetailscache[j].element) {
+ var f = this._rowdetailscache[j].element;
+ var i = e.coord();
+ var z = this.gridcontent.coord();
+ var w = parseInt(i.top) - parseInt(z.top);
+ var k = parseInt(i.left) - parseInt(z.left);
+ if (this.rtl) {
+ k = 0
+ }
+ b(f).css("top", w);
+ b(f).css("left", k);
+ b(f).css("display", "block");
+ b(f).width(this.host.width() - t);
+ if (this.layoutrowdetails) {
+ this.layoutrowdetails(p, f, this.element, this.getrowdata(p))
+ }
+ }
+ } else {
+ e[0].innerHTML = C
+ }
+ return
+ }
+ e[0].innerHTML = "";
+ if (!this.enablerowdetailsindent) {
+ t = 0
+ }
+ var h = '' + d.rowdetails + "
";
+ if (this.rtl) {
+ var h = '' + d.rowdetails + "
"
+ }
+ this._rowdetailscache[j] = {
+ id: y.id,
+ html: h
+ };
+ if (this.initrowdetails) {
+ var f = b(h)[0];
+ b(this.gridcontent).prepend(b(f));
+ b(f).css("position", "absolute");
+ b(f).width(this.host.width() - t);
+ b(f).height(e.height());
+ var i = e.coord();
+ b(f).css("z-index", 9999);
+ if (this.isTouchDevice()) {
+ b(f).css("z-index", 99999)
+ }
+ b(f).addClass(this.toThemeProperty("jqx-widget-content"));
+ var i = e.coord();
+ var z = this.gridcontent.coord();
+ var w = parseInt(i.top) - parseInt(z.top);
+ var k = parseInt(i.left) - parseInt(z.left);
+ b(f).css("top", w);
+ b(f).css("left", k);
+ this.content[0].scrollTop = 0;
+ this.content[0].scrollLeft = 0;
+ var D = b(b(f).children()[0]);
+ if (D[0].id != "") {
+ D[0].id = D[0].id + p
+ }
+ this.initrowdetails(p, f, this.element, this.getrowdata(p));
+ this._rowdetailscache[j].element = f;
+ this._rowdetailselementscache[p] = f
+ } else {
+ e[0].innerHTML = h
+ }
+ },
+ _defaultcellsrenderer: function(f, d) {
+ if (d.cellsformat != "") {
+ if (b.jqx.dataFormat) {
+ if (b.jqx.dataFormat.isDate(f)) {
+ f = b.jqx.dataFormat.formatdate(f, d.cellsformat, this.gridlocalization)
+ } else {
+ if (b.jqx.dataFormat.isNumber(f)) {
+ f = b.jqx.dataFormat.formatnumber(f, d.cellsformat, this.gridlocalization)
+ }
+ }
+ }
+ }
+ var e = "4px";
+ if (this.rowsheight != 25) {
+ e = (this.rowsheight / 2 - this._cellheight / 2);
+ if (e < 0) {
+ e = 4
+ }
+ e += "px"
+ }
+ if (this.enableellipsis) {
+ if (d.cellsalign == "center" || d.cellsalign == "middle") {
+ return '' + f + "
"
+ }
+ if (d.cellsalign == "left") {
+ return '' + f + "
"
+ }
+ if (d.cellsalign == "right") {
+ return '' + f + "
"
+ }
+ }
+ if (d.cellsalign == "center" || d.cellsalign == "middle") {
+ return '' + f + "
"
+ }
+ return '' + f + ""
+ },
+ getcelltext: function(g, e) {
+ if (g == null || e == null) {
+ return null
+ }
+ var d = this.getcellvalue(g, e);
+ var f = this.getcolumn(e);
+ if (f && f.cellsformat != "") {
+ if (b.jqx.dataFormat) {
+ if (b.jqx.dataFormat.isDate(d)) {
+ d = b.jqx.dataFormat.formatdate(d, f.cellsformat, this.gridlocalization)
+ } else {
+ if (b.jqx.dataFormat.isNumber(d)) {
+ d = b.jqx.dataFormat.formatnumber(d, f.cellsformat, this.gridlocalization)
+ }
+ }
+ }
+ }
+ return d
+ },
+ getcelltextbyid: function(g, e) {
+ if (g == null || e == null) {
+ return null
+ }
+ var d = this.getcellvaluebyid(g, e);
+ var f = this.getcolumn(e);
+ if (f && f.cellsformat != "") {
+ if (b.jqx.dataFormat) {
+ if (b.jqx.dataFormat.isDate(d)) {
+ d = b.jqx.dataFormat.formatdate(d, f.cellsformat, this.gridlocalization)
+ } else {
+ if (b.jqx.dataFormat.isNumber(d)) {
+ d = b.jqx.dataFormat.formatnumber(d, f.cellsformat, this.gridlocalization)
+ }
+ }
+ }
+ }
+ return d
+ },
+ _getcellvalue: function(d, f) {
+ var e = null;
+ e = f.bounddata[d.datafield];
+ if (d.displayfield != null) {
+ e = f.bounddata[d.displayfield]
+ }
+ if (e == null) {
+ e = ""
+ }
+ return e
+ },
+ getcell: function(h, d) {
+ if (h == null || d == null) {
+ return null
+ }
+ var e = parseInt(h);
+ var g = h;
+ var f = "";
+ if (!isNaN(e)) {
+ g = this.getrowdata(e)
+ }
+ if (g != null) {
+ f = g[d]
+ }
+ return this._getcellresult(f, h, d)
+ },
+ getrenderedcell: function(h, d) {
+ if (h == null || d == null) {
+ return null
+ }
+ var e = parseInt(h);
+ var g = h;
+ var f = "";
+ if (!isNaN(e)) {
+ g = this.getrenderedrowdata(e)
+ }
+ if (g != null) {
+ f = g[d]
+ }
+ return this._getcellresult(f, h, d)
+ },
+ _getcellresult: function(k, n, e) {
+ var f = this.getcolumn(e);
+ if (f == null || f == undefined) {
+ return null
+ }
+ var i = f.getcolumnproperties();
+ var g = i.hidden;
+ var d = i.width;
+ var m = i.pinned;
+ var h = i.cellsalign;
+ var j = i.cellsformat;
+ var l = this.getrowheight(n);
+ if (l == false) {
+ return null
+ }
+ return {
+ value: k,
+ row: n,
+ column: e,
+ datafield: e,
+ width: d,
+ height: l,
+ hidden: g,
+ pinned: m,
+ align: h,
+ format: j
+ }
+ },
+ setcellvaluebyid: function(i, d, h, f, g) {
+ var e = this.getrowboundindexbyid(i);
+ return this.setcellvalue(e, d, h, f, g)
+ },
+ getcellvaluebyid: function(f, d) {
+ var e = this.getrowboundindexbyid(f);
+ return this.getcellvalue(e, d)
+ },
+ setcellvalue: function(m, D, F, N, i) {
+ if (m == null || D == null) {
+ return false
+ }
+ var h = parseInt(m);
+ var r = h;
+ var A = m;
+ if (!isNaN(h)) {
+ A = this.getrowdata(h)
+ }
+ var L = false;
+ if (this.filterable && this._initfilterpanel && this.dataview.filters.length) {
+ L = true
+ }
+ if (this.virtualmode) {
+ this._pagescache = new Array()
+ }
+ if (this.sortcache) {
+ this.sortcache = {}
+ }
+ var n = "";
+ var d = "";
+ if (A != null && A[D] !== F) {
+ if (A[D] === null && F === "") {
+ return
+ }
+ var G = this._getcolumnbydatafield(D);
+ var O = "string";
+ var t = this.source.datafields || ((this.source._source) ? this.source._source.datafields: null);
+ if (t) {
+ var B = "";
+ b.each(t,
+ function() {
+ if (this.name == G.displayfield) {
+ if (this.type) {
+ B = this.type
+ }
+ return false
+ }
+ });
+ if (B) {
+ O = B
+ }
+ d = A[G.displayfield]
+ }
+ n = A[D];
+ if (!G.nullable || (F != null && F !== "" && G.nullable && F.label === undefined)) {
+ if (b.jqx.dataFormat.isNumber(n) || O == "number" || O == "float" || O == "int" || O == "decimal" && O != "date") {
+ if (this.gridlocalization && this.gridlocalization.decimalseparator == ",") {
+ if (F && F.indexOf && F.indexOf(",") >= 0) {
+ F = F.replace(",", ".")
+ }
+ }
+ F = new Number(F);
+ F = parseFloat(F);
+ if (isNaN(F)) {
+ F = 0
+ }
+ } else {
+ if (b.jqx.dataFormat.isDate(n) || O == "date") {
+ if (F != "") {
+ var J = F;
+ J = new Date(J);
+ if (J != "Invalid Date" && J != null) {
+ F = J
+ } else {
+ if (J == "Invalid Date") {
+ J = new Date();
+ F = J
+ }
+ }
+ }
+ }
+ }
+ if (A[D] === F) {
+ if (!this._updating && N != false) {
+ this._renderrows(this.virtualsizeinfo)
+ }
+ return
+ }
+ }
+ var y = this.source && this.source._source.localdata && this.source._source.localdata.name === "observableArray";
+ A[D] = F;
+ if (y) {
+ var M = this.source._source.localdata;
+ if (!M._updating) {
+ M._updating = true;
+ M[m][D] = F;
+ M._updating = false
+ }
+ }
+ var k = this.getrenderedrowdata(h, true);
+ if (!k) {
+ return
+ }
+ k[D] = F;
+ if (F != null && F.label != null) {
+ var G = this._getcolumnbydatafield(D);
+ A[G.displayfield] = F.label;
+ k[G.displayfield] = F.label;
+ A[D] = F.value;
+ k[D] = F.value;
+ if (y && !M._updating) {
+ M._updating = true;
+ M[m][D] = F.value;
+ M[m][G.displayfield] = F.label;
+ M._updating = false
+ }
+ }
+ if (L) {
+ if (A.dataindex != undefined) {
+ r = A.dataindex;
+ this.dataview.cachedrecords[A.dataindex][D] = F;
+ if (F != null && F.label != undefined) {
+ this.dataview.cachedrecords[A.dataindex][D] = F.value;
+ this.dataview.cachedrecords[A.dataindex][G.displayfield] = F.label
+ }
+ }
+ }
+ } else {
+ if (!this._updating && N != false) {
+ this._renderrows(this.virtualsizeinfo)
+ }
+ return false
+ }
+ if (this.source && this.source._knockoutdatasource && !this._updateFromAdapter && this.autokoupdates) {
+ if (this.source._source._localdata) {
+ var C = h;
+ if (L) {
+ if (A.dataindex != undefined) {
+ C = A.dataindex
+ }
+ }
+ var g = this.source._source._localdata()[C];
+ this.source.suspendKO = true;
+ var E = g;
+ if (E[D] && E[D].subscribe) {
+ if (F != null && F.label != null) {
+ E[G.displayfield](F.label);
+ E[D](F.value)
+ } else {
+ E[D](F)
+ }
+ } else {
+ var t = this.source._source.datafields;
+ var z = null;
+ var v = null;
+ if (t) {
+ b.each(t,
+ function() {
+ if (this.name == D) {
+ v = this.map;
+ return false
+ }
+ })
+ }
+ if (v == null) {
+ if (F != null && F.label != null) {
+ E[D] = F.value;
+ E[G.displayfield] = F.label
+ } else {
+ E[D] = F
+ }
+ } else {
+ var f = v.split(this.source.mapChar);
+ if (f.length > 0) {
+ var l = E;
+ for (var K = 0; K < f.length - 1; K++) {
+ l = l[f[K]]
+ }
+ l[f[f.length - 1]] = F
+ }
+ }
+ this.source._source._localdata.replace(g, b.extend({},
+ E))
+ }
+ this.source.suspendKO = false
+ }
+ }
+ if (this.sortcolumn && this.dataview.sortby && !this._updating) {
+ var x = this.getsortinformation();
+ if (this.sortcolumn == D) {
+ this.dataview.clearsortdata();
+ this.dataview.sortby(x.sortcolumn, x.sortdirection.ascending)
+ }
+ } else {
+ if (!this._updating) {
+ if (this.dataview.sortby) {
+ if (this.dataview.sortcache[D]) {
+ this.dataview.sortcache[D] = null
+ }
+ }
+ }
+ }
+ this._cellscache = new Array();
+ this._pagescache = new Array();
+ if (this.source.updaterow && (i == undefined || i == true)) {
+ var H = false;
+ var o = this.that;
+ var q = function(p) {
+ if (false == p) {
+ o.setcellvalue(m, D, n, true, false);
+ if (n != d) {
+ o.setcellvalue(m, o.getcolumn(D).displayfield, d, true, false)
+ }
+ }
+ };
+ try {
+ var j = this.getrowid(h);
+ H = this.source.updaterow(j, A, q);
+ if (H == undefined) {
+ H = true
+ }
+ } catch(u) {
+ H = false;
+ o.setcellvalue(m, D, n, true, false);
+ if (n != d) {
+ o.setcellvalue(m, o.getcolumn(D).displayfield, d, true, false)
+ }
+ return
+ }
+ }
+ var I = this.vScrollInstance.value;
+ if (this._updating && N != true) {
+ N = false
+ }
+ if (N == true || N == undefined) {
+ var o = this.that;
+ var e = function() {
+ if (o.pageable && o.updatepagerdetails) {
+ o.updatepagerdetails();
+ if (o.autoheight || o.autorowheight) {
+ o._updatepageviews()
+ }
+ }
+ };
+ var s = this.groupable && this.groups.length > 0;
+ if (L && !s) {
+ if (this.autoheight || this.autorowheight) {
+ this.prerenderrequired = true
+ }
+ this.dataview.refresh();
+ this.rendergridcontent(true, false);
+ e();
+ this._renderrows(this.virtualsizeinfo)
+ } else {
+ if (this.sortcolumn && !s) {
+ if (this.autoheight || this.autorowheight) {
+ this.prerenderrequired = true
+ }
+ this.dataview.reloaddata();
+ this.rendergridcontent(true, false);
+ e();
+ this._renderrows(this.virtualsizeinfo)
+ } else {
+ if (this.groupable && this.groups.length > 0) {
+ if (this.autoheight || this.autorowheight) {
+ this.prerenderrequired = true
+ }
+ if (this.pageable) {
+ if (this.groups.indexOf(D) != -1) {
+ this._pagescache = new Array();
+ this._cellscache = new Array();
+ this.dataview.refresh();
+ this._render(true, true, false, false)
+ } else {
+ this._pagescache = new Array();
+ this._cellscache = new Array();
+ this.dataview.updateview();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ } else {
+ this._pagescache = new Array();
+ this._cellscache = new Array();
+ this.dataview.updateview();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ } else {
+ this.dataview.updateview();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ }
+ }
+ }
+ this.vScrollInstance.setPosition(I);
+ if (this.showaggregates && this._updatecolumnsaggregates) {
+ this._updatecolumnsaggregates()
+ }
+ if (this.showfilterrow && this.filterable && this.filterrow) {
+ var w = this.getcolumn(D).filtertype;
+ if (w == "list" || w == "checkedlist") {
+ this._updatelistfilters(true)
+ }
+ }
+ this._raiseEvent(19, {
+ rowindex: m,
+ datafield: D,
+ newvalue: F,
+ value: F,
+ oldvalue: n
+ });
+ return true
+ },
+ getcellvalue: function(h, d) {
+ if (h == null || d == null) {
+ return null
+ }
+ var e = parseInt(h);
+ var g = h;
+ if (!isNaN(e)) {
+ g = this.getrowdata(e)
+ }
+ if (g != null) {
+ var f = g[d];
+ return f
+ }
+ return null
+ },
+ getrows: function() {
+ var h = this.dataview.records.length;
+ if (this.virtualmode) {
+ var j = new Array();
+ for (var e = 0; e < this.dataview.records.length; e++) {
+ var d = this.dataview.records[e];
+ if (d) {
+ j.push(d)
+ }
+ }
+ if (this.dataview.records.length === undefined) {
+ b.each(this.dataview.records,
+ function() {
+ var i = this;
+ if (i) {
+ j.push(i)
+ }
+ })
+ }
+ var g = 0;
+ if (this.pageable) {
+ g = this.dataview.pagenum * this.dataview.pagesize
+ }
+ if (j.length > this.source._source.totalrecords - g) {
+ return j.slice(0, this.source._source.totalrecords - g)
+ }
+ return j
+ }
+ if (this.dataview.sortdata) {
+ var j = new Array();
+ for (var e = 0; e < h; e++) {
+ var f = {};
+ f = b.extend({},
+ this.dataview.sortdata[e].value);
+ j[e] = f
+ }
+ return j
+ } else {
+ return this.dataview.records
+ }
+ },
+ getrowboundindexbyid: function(g) {
+ var f = this.dataview.recordsbyid["id" + g];
+ if (f) {
+ if (f.boundindex) {
+ return this.getboundindex(f)
+ }
+ }
+ var e = this.getboundrows();
+ for (var d = 0; d < e.length; d++) {
+ if (e[d]) {
+ if (e[d].uid == g) {
+ return d
+ }
+ }
+ }
+ return - 1
+ },
+ getrowdatabyid: function(f) {
+ var e = this.dataview.recordsbyid["id" + f];
+ if (e) {
+ return e
+ } else {
+ var d = this.getrowboundindexbyid(f);
+ return this.getboundrows()[d]
+ }
+ return null
+ },
+ getrowdata: function(d) {
+ if (d == undefined) {
+ d = 0
+ }
+ if (this.virtualmode) {
+ var e = this.dataview.records[d];
+ return e
+ } else {
+ var e = this.getboundrows()[d];
+ return e
+ }
+ return null
+ },
+ getrenderedrowdata: function(d, f) {
+ if (d == undefined) {
+ d = 0
+ }
+ if (this.virtualmode) {
+ var g = this.getrowvisibleindex(d);
+ var e = this.dataview.loadedrecords[g];
+ return e
+ }
+ var g = this.getrowvisibleindex(d);
+ if (g >= 0) {
+ if (this.groupable && this.groups.length > 0) {
+ var e = this.dataview.loadedrecords[g]
+ } else {
+ var e = this.dataview.loadedrecords[g];
+ if (this.pageable && (f == undefined || f == false)) {
+ var e = this.dataview.loadedrecords[this.dataview.pagesize * this.dataview.pagenum + d]
+ }
+ }
+ return e
+ }
+ return null
+ },
+ getboundrows: function() {
+ return this.dataview.cachedrecords
+ },
+ getrowdisplayindex: function(d) {
+ var f = this.getdisplayrows();
+ for (var e = 0; e < f.length; e++) {
+ if (!f[e]) {
+ continue
+ }
+ if (f[e].dataindex !== undefined) {
+ if (f[e].dataindex == d) {
+ return f[e].visibleindex
+ }
+ } else {
+ if (f[e].boundindex == d) {
+ return f[e].visibleindex
+ }
+ }
+ }
+ return - 1
+ },
+ getboundindex: function(e) {
+ var d = e.boundindex;
+ if (this.groupable && this.groups.length > 0 && this.pageable) {
+ if (e.bounddata) {
+ d = this.getrowboundindexbyid(e.bounddata.uid)
+ }
+ }
+ if (this.dataview.filters.length > 0) {
+ if (e.bounddata) {
+ if (e.bounddata.dataindex !== undefined) {
+ d = e.bounddata.dataindex
+ }
+ } else {
+ if (e.dataindex !== undefined) {
+ d = e.dataindex
+ }
+ }
+ }
+ return d
+ },
+ getrowboundindex: function(d) {
+ var e = this.getdisplayrows()[d];
+ if (e) {
+ if (e.dataindex !== undefined) {
+ return e.dataindex
+ }
+ return e.boundindex
+ }
+ return - 1
+ },
+ getdisplayrows: function() {
+ return this.dataview.loadedrecords
+ },
+ getloadedrows: function() {
+ return this.getdisplayrows()
+ },
+ getvisiblerowdata: function(e) {
+ var d = this.getvisiblerows();
+ if (d) {
+ return d[e]
+ }
+ return null
+ },
+ getloadedrowdata: function(e) {
+ var d = this.getloadedrows();
+ if (d) {
+ return d[e]
+ }
+ return null
+ },
+ getvisiblerows: function() {
+ if (this.virtualmode) {
+ return this.dataview.loadedrecords
+ }
+ if (this.pageable) {
+ var f = [];
+ for (var e = 0; e < this.dataview.pagesize; e++) {
+ var d = this.dataview.loadedrecords[e + (this.dataview.pagesize * this.dataview.pagenum)];
+ if (d == undefined) {
+ break
+ }
+ f.push(d)
+ }
+ return f
+ } else {
+ if (this._startboundindex != undefined && this._endboundindex != undefined) {
+ var f = [];
+ for (var e = this._startvisibleindex; e <= this._endvisibleindex; e++) {
+ var d = this.dataview.loadedrecords[e];
+ if (d == undefined) {
+ break
+ }
+ f.push(d)
+ }
+ return f
+ }
+ }
+ return this.dataview.loadedrecords
+ },
+ getrowid: function(d) {
+ if (d == undefined) {
+ d = 0
+ }
+ if (this.virtualmode) {
+ var g = this.getrowvisibleindex(d);
+ var f = this.dataview.loadedrecords[g];
+ if (f) {
+ return f.uid
+ }
+ } else {
+ var f = null;
+ var e = this.dataview.filters.length > 0;
+ if (d >= 0 && d < this.dataview.bounditems.length && !e) {
+ if (this.groupable && this.groups.length > 0) {
+ var g = this.getrowvisibleindex(d);
+ var f = this.dataview.loadedrecords[g]
+ } else {
+ var g = this.getrowvisibleindex(d);
+ var f = this.dataview.loadedrecords[g]
+ }
+ if (f) {
+ return f.uid
+ }
+ }
+ if (this.dataview.filters.length > 0) {
+ var f = this.getboundrows()[d];
+ if (f) {
+ if (f.uid != null) {
+ return f.uid
+ }
+ }
+ return null
+ }
+ }
+ return null
+ },
+ _updateGridData: function(e) {
+ var d = false;
+ if (this.filterable && this._initfilterpanel && this.dataview.filters.length) {
+ d = true
+ }
+ if (d) {
+ this.dataview.refresh();
+ if (e == "updaterow") {
+ this._render(true, true, false, false, false);
+ this.invalidate()
+ } else {
+ this.render()
+ }
+ } else {
+ if (this.sortcolumn || (this.groupable && this.groups.length > 0)) {
+ this.dataview.reloaddata();
+ this.render()
+ } else {
+ this._cellscache = new Array();
+ this._pagescache = new Array();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ }
+ if (this.showfilterrow && this.filterable && this.filterrow) {
+ this._updatelistfilters(true)
+ }
+ },
+ updaterow: function(i, k, g) {
+ if (i != undefined && k != undefined) {
+ var h = this.that;
+ var j = false;
+ h._datachanged = true;
+ var e = function(q, l, u) {
+ if (q._loading) {
+ throw new Error("jqxGrid: " + q.loadingerrormessage);
+ return false
+ }
+ var s = false;
+ if (!b.isArray(l)) {
+ s = q.dataview.updaterow(l, u)
+ } else {
+ b.each(l,
+ function(v, w) {
+ s = q.dataview.updaterow(this, u[v], false)
+ });
+ q._cellscache = new Array();
+ q._pagescache = new Array();
+ q.dataview.refresh()
+ }
+ var m = q.vScrollInstance.value;
+ if (g == undefined || g == true) {
+ if (q._updating == undefined || q._updating == false) {
+ q._updateGridData("updaterow")
+ }
+ }
+ if (q.showaggregates && q._updatecolumnsaggregates) {
+ q._updatecolumnsaggregates()
+ }
+ if (q.source && q.source._knockoutdatasource && !q._updateFromAdapter && q.autokoupdates) {
+ if (q.source._source._localdata) {
+ var n = q.dataview.recordsbyid["id" + l];
+ var o = q.dataview.records.indexOf(n);
+ var p = q.source._source._localdata()[o];
+ q.source.suspendKO = true;
+ q.source._source._localdata.replace(p, b.extend({},
+ n));
+ q.source.suspendKO = false
+ }
+ }
+ var r = q.source && q.source._source.localdata && q.source._source.localdata.name === "observableArray";
+ if (r) {
+ if (!q.source._source.localdata._updating) {
+ q.source._source.localdata._updating = true;
+ var t = q.getrowboundindexbyid(l);
+ q.source._source.localdata.set(t, u);
+ q.source._source.localdata._updating = false
+ }
+ }
+ q.vScrollInstance.setPosition(m);
+ return s
+ };
+ if (this.source.updaterow) {
+ var d = function(l) {
+ if (l == true || l == undefined) {
+ e(h, i, k)
+ } else {
+ j = false
+ }
+ };
+ try {
+ j = this.source.updaterow(i, k, d);
+ if (j == undefined) {
+ j = true
+ }
+ } catch(f) {
+ j = false
+ }
+ } else {
+ j = e(h, i, k)
+ }
+ return j
+ }
+ return false
+ },
+ deleterow: function(d, k) {
+ if (d != undefined) {
+ this._datachanged = true;
+ var o = false;
+ var m = this.that;
+ var p = this.getrowboundindexbyid(d);
+ var e = new Array();
+ var j = new Array();
+ if (p != undefined) {
+ if (this.selectedrowindexes.indexOf(p) >= 0) {
+ this.selectedrowindexes.splice(this.selectedrowindexes.indexOf(p), 1)
+ }
+ if (this.selectedrowindex == p) {
+ this.selectedrowindex = -1
+ }
+ if (!this.virtualmode) {
+ if (m.selectionmode.indexOf("row") >= 0) {
+ b.each(this.selectedrowindexes,
+ function() {
+ var q = m.getrowid(this);
+ e.push(q)
+ });
+ this.selectedrowindexes = new Array();
+ this.selectedrowindex = -1
+ } else {
+ if (m.selectionmode.indexOf("cell") >= 0) {
+ for (var i in m.selectedcells) {
+ var n = m.selectedcells[i];
+ var h = m.getrowid(n.rowindex);
+ n.rowid = h
+ }
+ }
+ }
+ }
+ }
+ var f = function(w, r) {
+ if (w._loading) {
+ throw new Error("jqxGrid: " + w.loadingerrormessage);
+ return false
+ }
+ var z = false;
+ var t = w.vScrollInstance.value;
+ if (!b.isArray(r)) {
+ var z = w.dataview.deleterow(r)
+ } else {
+ b.each(r,
+ function() {
+ z = w.dataview.deleterow(this, false)
+ });
+ w._cellscache = new Array();
+ w._pagescache = new Array();
+ w.dataview.refresh()
+ }
+ if (!w.virtualmode) {
+ if (w.selectionmode.indexOf("row") >= 0) {
+ b.each(e,
+ function() {
+ var B = w.getrowboundindexbyid(this);
+ if (B != -1) {
+ w.selectrow(B, false)
+ }
+ })
+ } else {
+ var A = new Array();
+ for (var v in w.selectedcells) {
+ var y = w.selectedcells[v];
+ var u = y.rowid;
+ var s = w.getrowboundindexbyid(u);
+ if (s != -1) {
+ y.rowindex = s;
+ A[s + "_" + y.datafield] = y
+ }
+ }
+ w.selectedcells = A
+ }
+ }
+ if (w._updating == undefined || w._updating == false) {
+ if (k == undefined || k == true) {
+ w._render(true, true, false, false);
+ if (w.vScrollBar.css("visibility") != "visible") {
+ w._arrange();
+ w._updatecolumnwidths();
+ w._updatecellwidths();
+ w._renderrows(w.virtualsizeinfo)
+ }
+ }
+ }
+ if (w.source && w.source._knockoutdatasource && !w._updateFromAdapter && w.autokoupdates) {
+ if (w.source._source._localdata) {
+ w.source.suspendKO = true;
+ w.source._source._localdata.pop(rowdata);
+ w.source.suspendKO = false
+ }
+ }
+ var x = w.source && w.source._source.localdata && w.source._source.localdata.name === "observableArray";
+ if (x) {
+ if (!w.source._source.localdata._updating) {
+ w.source._source.localdata._updating = true;
+ w.source._source.localdata.splice(p, 1);
+ w.source._source.localdata._updating = false
+ }
+ }
+ if (w.dataview.sortby) {
+ var q = w.getsortinformation();
+ w.dataview.clearsortdata();
+ w.dataview.sortby(q.sortcolumn, q.sortdirection ? q.sortdirection.ascending: null)
+ }
+ w.vScrollInstance.setPosition(t);
+ return z
+ };
+ if (this.source.deleterow) {
+ var g = function(q) {
+ if (q == true || q == undefined) {
+ f(m, d)
+ }
+ };
+ try {
+ this.source.deleterow(d, g);
+ if (o == undefined) {
+ o = true
+ }
+ } catch(l) {
+ o = false
+ }
+ } else {
+ o = f(m, d)
+ }
+ return o
+ }
+ return false
+ },
+ addrow: function(f, o, j) {
+ if (o != undefined) {
+ this._datachanged = true;
+ if (j == undefined) {
+ j = "last"
+ }
+ var n = false;
+ var m = this.that;
+ if (f == null) {
+ var g = this.dataview.filters && this.dataview.filters.length > 0;
+ var l = !g ? this.dataview.totalrecords: this.dataview.cachedrecords.length;
+ if (!b.isArray(o)) {
+ f = this.dataview.getid(this.dataview.source.id, o, l);
+ while (null != this.dataview.recordsbyid["id" + f]) {
+ f++
+ }
+ } else {
+ var d = new Array();
+ b.each(o,
+ function(e, p) {
+ var q = m.dataview.getid(m.dataview.source.id, o[e], l + e);
+ d.push(q)
+ });
+ f = d
+ }
+ }
+ var h = function(s, r, v, e) {
+ if (s._loading) {
+ throw new Error("jqxGrid: " + s.loadingerrormessage);
+ return false
+ }
+ var u = s.vScrollInstance.value;
+ var t = false;
+ if (!b.isArray(v)) {
+ if (v != undefined && v.dataindex != undefined) {
+ delete v.dataindex
+ }
+ t = s.dataview.addrow(r, v, e)
+ } else {
+ b.each(v,
+ function(w, x) {
+ if (this.dataindex != undefined) {
+ delete this.dataindex
+ }
+ var y = null;
+ if (r != null && r[w] != null) {
+ y = r[w]
+ }
+ t = s.dataview.addrow(y, this, e, false)
+ });
+ s._cellscache = new Array();
+ s._pagescache = new Array();
+ s.dataview.refresh()
+ }
+ if (s._updating == undefined || s._updating == false) {
+ s._render(true, true, false, false);
+ s.invalidate()
+ }
+ if (s.source && s.source._knockoutdatasource && !s._updateFromAdapter && s.autokoupdates) {
+ if (s.source._source._localdata) {
+ s.source.suspendKO = true;
+ s.source._source._localdata.push(v);
+ s.source.suspendKO = false
+ }
+ }
+ var p = s.source && s.source._source.localdata && s.source._source.localdata.name === "observableArray";
+ if (p) {
+ if (!s.source._source.localdata._updating) {
+ s.source._source.localdata._updating = true;
+ var q = s.getrowboundindexbyid(r);
+ s.source._source.localdata.set(q, v);
+ s.source._source.localdata._updating = false
+ }
+ }
+ if (s.scrollmode != "deferred") {
+ s.vScrollInstance.setPosition(u)
+ } else {
+ s.vScrollInstance.setPosition(0)
+ }
+ return t
+ };
+ if (this.source.addrow) {
+ var i = function(e, p) {
+ if (e == true || e == undefined) {
+ if (p != undefined) {
+ f = p
+ }
+ h(m, f, o, j)
+ }
+ };
+ try {
+ n = this.source.addrow(f, o, j, i);
+ if (n == undefined) {
+ n = true
+ }
+ } catch(k) {
+ n = false
+ }
+ if (n == false) {
+ return false
+ }
+ } else {
+ h(this, f, o, j)
+ }
+ return n
+ }
+ return false
+ },
+ _findvisiblerow: function(g, h) {
+ if (g == undefined) {
+ g = parseInt(this.vScrollInstance.value)
+ }
+ var e = 0;
+ if (h == undefined || h == null) {
+ h = this.rows.records
+ }
+ var d = h.length;
+ while (e <= d) {
+ mid = parseInt((e + d) / 2);
+ var f = h[mid];
+ if (f == undefined) {
+ break
+ }
+ if (f.top > g && f.top + f.height > g) {
+ d = mid - 1
+ } else {
+ if (f.top < g && f.top + f.height < g) {
+ e = mid + 1
+ } else {
+ return mid;
+ break
+ }
+ }
+ }
+ return - 1
+ },
+ _updatecellwidths: function() {
+ var f = this.virtualsizeinfo;
+ if (!f) {
+ return
+ }
+ var p = this.that;
+ if (p.gridcontent == undefined) {
+ return
+ }
+ if (p.table == undefined) {
+ p.table = p.gridcontent.find("#contenttable" + p.element.id)
+ }
+ var k = p.groupable && p.groups.length > 0;
+ var q = 0;
+ var l = f.visiblerecords;
+ if (p.pageable && (p.autoheight || p.autorowheight)) {
+ l = p.dataview.pagesize;
+ if (p.groupable) {
+ p.dataview.updateview();
+ l = p.dataview.rows.length
+ }
+ }
+ if (!p.groupable && !p.pageable && (p.autoheight || p.autorowheight)) {
+ l = p.dataview.totalrecords
+ }
+ if (p.rowdetails) {
+ l += p.dataview.pagesize
+ }
+ if (!p.columns.records) {
+ return
+ }
+ var r = p.columns.records.length;
+ var t = p.table[0].rows;
+ for (var n = 0; n < l; n++) {
+ var d = t[n];
+ if (!d) {
+ break
+ }
+ var s = d.cells;
+ var h = 0;
+ for (var m = 0; m < r; m++) {
+ var g = p.columns.records[m];
+ var e = g.width;
+ var o = s[m];
+ if (parseInt(o.style.left) != h) {
+ o.style.left = h + "px"
+ }
+ if (parseInt(o.style.width) != e) {
+ o.style.width = e + "px"
+ }
+ if (! (g.hidden && g.hideable)) {
+ h += parseFloat(e)
+ } else {
+ o.style.display = "none"
+ }
+ }
+ if (q == 0) {
+ p.table.width(parseFloat(h) + 2);
+ q = h
+ }
+ }
+ if (p.showaggregates && p._updateaggregates) {
+ p._updateaggregates()
+ }
+ if (p.showfilterrow && p.filterable && p._updatefilterrowui) {
+ p._updatefilterrowui()
+ }
+ if (p.showeverpresentrow) {
+ p._updateaddnewrowui()
+ }
+ p._updatescrollbarsafterrowsprerender();
+ if (k) {
+ p._renderrows(p.virtualsizeinfo)
+ }
+ },
+ _updatescrollbarsafterrowsprerender: function() {
+ var g = this.that;
+ var f = g.hScrollBar[0].style.visibility;
+ var i = 0;
+ var d = g.vScrollBar[0].style.visibility;
+ if (d == "visible") {
+ i = g.scrollbarsize + 3
+ }
+ if (g.scrollbarautoshow) {
+ i = 0
+ }
+ var e = g.element.style.width;
+ if (e.toString().indexOf("%") >= 0) {
+ e = g.host.width()
+ } else {
+ e = parseInt(e)
+ }
+ if (parseInt(g.table[0].style.width) - 2 > e - i) {
+ if (f != "visible") {
+ if (!g.autowidth) {
+ g.hScrollBar[0].style.visibility = "visible"
+ }
+ g._arrange()
+ }
+ if (d == "visible") {
+ if (g.scrollmode != "deferred" && !g.virtualmode) {
+ if (g.virtualsizeinfo) {
+ var h = g.virtualsizeinfo.virtualheight - g._gettableheight();
+ if (!isNaN(h) && h > 0) {
+ if (f != "hidden") {
+ g.vScrollBar.jqxScrollBar("max", h + g.scrollbarsize + 4)
+ } else {
+ g.vScrollBar.jqxScrollBar("max", h)
+ }
+ }
+ }
+ } else {
+ g._updatevscrollbarmax()
+ }
+ } else {
+ i = -2
+ }
+ g.hScrollBar.jqxScrollBar("max", i + g.table.width() - g.host.width())
+ } else {
+ if (f != "hidden") {
+ g.hScrollBar.css("visibility", "hidden");
+ g._arrange()
+ }
+ }
+ g._renderhorizontalscroll()
+ },
+ _prerenderrows: function(o) {
+ var B = this.that;
+ if (B.prerenderrequired == true) {
+ B.prerenderrequired = false;
+ if (B.editable && B._destroyeditors) {
+ B._destroyeditors()
+ }
+ if (B.gridcontent == undefined) {
+ return
+ }
+ B.gridcontent.find("#contenttable" + B.element.id).remove();
+ if (B.table != null) {
+ B.table.remove();
+ B.table = null
+ }
+ B.table = b('');
+ B.gridcontent.addClass(B.toTP("jqx-grid-content"));
+ B.gridcontent.addClass(B.toTP("jqx-widget-content"));
+ B.gridcontent.append(B.table);
+ var A = B.groupable && B.groups.length > 0;
+ var p = 0;
+ B.table[0].rows = new Array();
+ var l = B.toTP("jqx-grid-cell");
+ if (A) {
+ l = " " + B.toTP("jqx-grid-group-cell")
+ }
+ var u = o.visiblerecords;
+ if (B.pageable && (B.autoheight || B.autorowheight)) {
+ u = B.dataview.pagesize;
+ if (B.groupable) {
+ B.dataview.updateview();
+ u = B.dataview.rows.length;
+ if (u < B.dataview.pagesize) {
+ u = B.dataview.pagesize
+ }
+ }
+ }
+ if (!B.pageable && (B.autoheight || B.autorowheight)) {
+ u = B.dataview.totalrecords
+ }
+ if (B.groupable && B.groups.length > 0 && (B.autoheight || B.autorowheight) && !B.pageable) {
+ u = B.dataview.rows.length
+ }
+ if (B.rowdetails) {
+ if (B.autoheight || B.autorowheight) {
+ u += B.dataview.pagesize
+ } else {
+ u += u
+ }
+ }
+ if (!B.columns.records) {
+ return
+ }
+ var z = B.columns.records.length;
+ if (b.jqx.browser.msie && b.jqx.browser.version > 8) {
+ B.table.css("opacity", "0.99")
+ }
+ if (b.jqx.browser.mozilla) {}
+ if (navigator.userAgent.indexOf("Safari") != -1) {
+ B.table.css("opacity", "0.99")
+ }
+ var r = b.jqx.browser.msie && b.jqx.browser.version < 8;
+ if (r) {
+ B.host.attr("hideFocus", "true")
+ }
+ var k = B.tableZIndex;
+ if (u * z > k) {
+ k = u * z
+ }
+ var g = B.dataview.records.length == 0;
+ var n = B.isTouchDevice();
+ var v = "";
+ B._hiddencolumns = false;
+ for (var y = 0; y < u; y++) {
+ var s = '';
+ if (r) {
+ var s = '
';
+ k--
+ }
+ var f = 0;
+ for (var w = 0; w < z; w++) {
+ var x = B.columns.records[w];
+ var t = x.width;
+ if (t < x.minwidth) {
+ t = x.minwidth
+ }
+ if (t > x.maxwidth) {
+ t = x.maxwidth
+ }
+ if (B.rtl) {
+ var q = k - z + 2 * w;
+ var d = '
';
+ s += d
+ }
+ if (p == 0) {
+ B.table.width(parseInt(f) + 2);
+ p = f
+ }
+ s += "
";
+ v += s
+ }
+ if (B.WinJS) {
+ MSApp.execUnsafeLocalFunction(function() {
+ B.table.html(v)
+ })
+ } else {
+ B.table[0].innerHTML = v
+ }
+ B.table[0].rows = new Array();
+ var m = B.table.children();
+ for (var y = 0; y < u; y++) {
+ var h = m[y];
+ B.table[0].rows.push(h);
+ h.cells = new Array();
+ var e = b(h).children();
+ for (var w = 0; w < z; w++) {
+ h.cells.push(e[w])
+ }
+ }
+ if (u == 0) {
+ var f = 0;
+ if (B.showemptyrow) {
+ var s = b('
');
+ B.table.append(s);
+ s.height(B.rowsheight);
+ B.table[0].rows[0] = s[0];
+ B.table[0].rows[0].cells = new Array()
+ }
+ for (var w = 0; w < z; w++) {
+ var x = B.columns.records[w];
+ var t = x.width;
+ if (B.showemptyrow) {
+ var d = b('
');
+ d.height(B.rowsheight);
+ s.append(d);
+ B.table[0].rows[0].cells[w] = d[0]
+ }
+ if (t < x.minwidth) {
+ t = x.minwidth
+ }
+ if (t > x.maxwidth) {
+ t = x.maxwidth
+ }
+ if (! (x.hidden && x.hideable)) {
+ f += t
+ }
+ }
+ B.table.width(parseInt(f) + 2);
+ p = f
+ }
+ B._updatescrollbarsafterrowsprerender();
+ if (B.rendered) {
+ B.rendered("rows")
+ }
+ B.toCompile = new Array();
+ B._addoverlayelement()
+ }
+ },
+ _groupsheader: function() {
+ return this.groupable && this.showgroupsheader
+ },
+ _arrange: function() {
+ var A = null;
+ var x = null;
+ this.tableheight = null;
+ var F = this.that;
+ var n = false;
+ var m = false;
+ if (F.width != null && F.width.toString().indexOf("px") != -1) {
+ A = F.width
+ } else {
+ if (F.width != undefined && !isNaN(F.width)) {
+ A = F.width
+ }
+ }
+ if (F.width != null && F.width.toString().indexOf("%") != -1) {
+ A = F.width;
+ n = true
+ }
+ if (F.scrollbarautoshow) {
+ F.vScrollBar[0].style.display = "none";
+ F.hScrollBar[0].style.display = "none";
+ F.vScrollBar[0].style.zIndex = F.tableZIndex + F.headerZIndex;
+ F.hScrollBar[0].style.zIndex = F.tableZIndex + F.headerZIndex
+ }
+ if (F.autowidth) {
+ var p = 0;
+ for (var B = 0; B < F.columns.records.length; B++) {
+ var e = F.columns.records[B].width;
+ if (e == "auto") {
+ e = F._measureElementWidth(F.columns.records[B].text);
+ p += e
+ } else {
+ p += e
+ }
+ }
+ if (F.vScrollBar.css("visibility") != "hidden") {
+ p += F.scrollbarsize + 4
+ }
+ A = p;
+ F.width = A
+ }
+ if (F.height != null && F.height.toString().indexOf("px") != -1) {
+ x = F.height
+ } else {
+ if (F.height != undefined && !isNaN(F.height)) {
+ x = F.height
+ }
+ }
+ if (F.height != null && F.height.toString().indexOf("%") != -1) {
+ x = F.height;
+ m = true
+ }
+ var k = function() {
+ var i = 0;
+ var w = F.showheader ? F.columnsheader != null ? F.columnsheader.height() + 2 : 0 : 0;
+ i += w;
+ if (F.pageable) {
+ i += F.pagerheight
+ }
+ if (F._groupsheader()) {
+ i += F.groupsheaderheight
+ }
+ if (F.showtoolbar) {
+ i += F.toolbarheight
+ }
+ if (F.showstatusbar) {
+ i += F.statusbarheight
+ }
+ if (F.showeverpresentrow && F.everpresentrowposition === "bottom") {
+ i += F.everpresentrowheight
+ }
+ if (F.hScrollBar[0].style.visibility == "visible") {
+ i += 20
+ }
+ return i
+ };
+ if (F.autoheight && F.virtualsizeinfo) {
+ if (F.pageable && F.gotopage) {
+ var C = 0;
+ x = C + (F._pageviews[0] ? F._pageviews[0].height: 0);
+ x += k();
+ if (F.showemptyrow && F.dataview.totalrecords == 0) {
+ x += F.rowsheight
+ }
+ } else {
+ var C = F.host.height() - F._gettableheight();
+ if (F._pageviews.length > 0) {
+ x = C + F._pageviews[F._pageviews.length - 1].height + F._pageviews[F._pageviews.length - 1].top;
+ F.vScrollBar[0].style.visibility = "hidden"
+ } else {
+ x = k();
+ if (F.showemptyrow) {
+ x += F.rowsheight
+ }
+ }
+ }
+ } else {
+ if (F.autoheight) {
+ x = F.dataview.totalrecords * F.rowsheight;
+ if (F.pageable && F.gotopage) {
+ x = F.pagesize * F.rowsheight
+ }
+ if (F._loading) {
+ x = 250;
+ F.dataloadelement.height(x)
+ }
+ x += k();
+ if (x > 10000) {
+ x = 10000
+ }
+ }
+ }
+ if (A != null) {
+ A = parseInt(A);
+ if (!n) {
+ if (F.element.style.width != parseInt(F.width) + "px") {
+ F.element.style.width = parseInt(F.width) + "px"
+ }
+ } else {
+ F.element.style.width = F.width
+ }
+ if (n) {
+ A = F.host.width();
+ if (A <= 2) {
+ A = 600;
+ F.host.width(A)
+ }
+ if (!F._oldWidth) {
+ F._oldWidth = A
+ }
+ }
+ } else {
+ F.host.width(250)
+ }
+ if (x != null) {
+ if (!m) {
+ x = parseInt(x)
+ }
+ if (!m) {
+ if (F.element.style.height != parseInt(x) + "px") {
+ F.element.style.height = parseInt(x) + "px"
+ }
+ } else {
+ F.element.style.height = F.height
+ }
+ if (m && !F.autoheight) {
+ x = F.host.height();
+ if (x == 0) {
+ x = 400;
+ F.host.height(x)
+ }
+ if (!F._oldHeight) {
+ F._oldHeight = x
+ }
+ }
+ } else {
+ F.host.height(250)
+ }
+ if (F.autoheight) {
+ F.tableheight = null;
+ F._gettableheight()
+ }
+ var v = 0;
+ if (F.showtoolbar) {
+ F.toolbar.width(A);
+ F.toolbar.height(F.toolbarheight - 1);
+ F.toolbar.css("top", 0);
+ v += F.toolbarheight;
+ x -= parseInt(F.toolbarheight)
+ } else {
+ F.toolbar[0].style.height = "0px"
+ }
+ if (F.showstatusbar) {
+ if (F.showaggregates) {
+ F.statusbar.width(!F.table ? A: Math.max(A, F.table.width()))
+ } else {
+ F.statusbar.width(A)
+ }
+ F.statusbar.height( - 1 + F.statusbarheight)
+ } else {
+ F.statusbar[0].style.height = "0px"
+ }
+ if (F.showeverpresentrow && F.everpresentrowposition === "bottom") {
+ F.addnewrow.width(A);
+ F.addnewrow.height(F.everpresentrowheight)
+ } else {
+ F.addnewrow[0].style.height = "0px"
+ }
+ if (F._groupsheader()) {
+ F.groupsheader.width(A);
+ F.groupsheader.height(F.groupsheaderheight);
+ F.groupsheader.css("top", v);
+ var y = F.groupsheader.height() + 1;
+ v += y;
+ if (x > y) {
+ x -= parseInt(y)
+ }
+ } else {
+ if (F.groupsheader[0].style.width != A + "px") {
+ F.groupsheader[0].style.width = parseInt(A) + "px"
+ }
+ F.groupsheader[0].style.height = "0px";
+ if (F.groupsheader[0].style.top != v + "px") {
+ F.groupsheader.css("top", v)
+ }
+ var y = F.showgroupsheader && F.groupable ? F.groupsheaderheight: 0;
+ var f = v + y + "px";
+ if (F.content[0].style.top != f) {
+ F.content.css("top", v + F.groupsheaderheight)
+ }
+ }
+ var d = F.scrollbarsize;
+ if (isNaN(d)) {
+ d = parseInt(d);
+ if (isNaN(d)) {
+ d = "17px"
+ } else {
+ d = d + "px"
+ }
+ }
+ d = parseInt(d);
+ var s = 4;
+ var h = 2;
+ var j = 0;
+ if (F.vScrollBar[0].style.visibility == "visible") {
+ j = d + s
+ }
+ if (F.hScrollBar[0].style.visibility == "visible") {
+ h = d + s + 2
+ }
+ var r = 0;
+ if (F.pageable) {
+ r = F.pagerheight;
+ h += F.pagerheight
+ }
+ if (F.showstatusbar) {
+ h += F.statusbarheight;
+ r += F.statusbarheight
+ }
+ if (F.showeverpresentrow && F.everpresentrowposition === "bottom") {
+ h += F.everpresentrowheight;
+ r += F.everpresentrowheight
+ }
+ if (F.hScrollBar[0].style.height != d + "px") {
+ F.hScrollBar[0].style.height = parseInt(d) + "px"
+ }
+ if (F.hScrollBar[0].style.top != v + x - s - d - r + "px" || F.hScrollBar[0].style.left != "0px") {
+ F.hScrollBar.css({
+ top: v + x - s - d - r + "px",
+ left: "0px"
+ })
+ }
+ var q = F.hScrollBar[0].style.width;
+ var l = false;
+ var D = false;
+ if (j == 0) {
+ if (q != (A - 2) + "px") {
+ F.hScrollBar.width(A - 2);
+ l = true
+ }
+ } else {
+ if (q != (A - d - s) + "px") {
+ F.hScrollBar.width(A - d - s + "px");
+ l = true
+ }
+ }
+ if (!F.autoheight) {
+ if (F.vScrollBar[0].style.width != d + "px") {
+ F.vScrollBar.width(d);
+ D = true
+ }
+ if (F.vScrollBar[0].style.height != parseInt(x) - h + "px") {
+ F.vScrollBar.height(parseInt(x) - h + "px");
+ D = true
+ }
+ if (F.vScrollBar[0].style.left != parseInt(A) - parseInt(d) - s + "px" || F.vScrollBar[0].style.top != v + "px") {
+ F.vScrollBar.css({
+ left: parseInt(A) - parseInt(d) - s + "px",
+ top: v
+ })
+ }
+ }
+ if (F.rtl) {
+ F.vScrollBar.css({
+ left: "0px",
+ top: v
+ });
+ if (F.vScrollBar.css("visibility") != "hidden") {
+ F.hScrollBar.css({
+ left: d + 2
+ })
+ }
+ }
+ var o = F.vScrollInstance;
+ o.disabled = F.disabled;
+ if (!F.autoheight) {
+ if (D) {
+ o.refresh()
+ }
+ }
+ var z = F.hScrollInstance;
+ z.disabled = F.disabled;
+ if (l) {
+ z.refresh()
+ }
+ if (F.autowidth) {
+ F.hScrollBar[0].style.visibility = "hidden"
+ }
+ F.statusbarheight = parseInt(F.statusbarheight);
+ F.toolbarheight = parseInt(F.toolbarheight);
+ var t = function(w) {
+ if ((w.vScrollBar[0].style.visibility == "visible") && (w.hScrollBar[0].style.visibility == "visible")) {
+ w.bottomRight[0].style.visibility = "visible";
+ w.bottomRight.css({
+ left: 1 + parseInt(w.vScrollBar.css("left")),
+ top: parseInt(w.hScrollBar.css("top"))
+ });
+ if (w.rtl) {
+ w.bottomRight.css("left", "0px")
+ }
+ w.bottomRight.width(parseInt(d) + 3);
+ w.bottomRight.height(parseInt(d) + 4);
+ var G = w.showeverpresentrow && w.everpresentrowposition == "bottom";
+ var i = G ? w.everpresentrowheight: 0;
+ if (i > 0 && !w.showaggregates) {
+ w.bottomRight.css("z-index", 99);
+ w.bottomRight.height(parseInt(d) + 4 + i);
+ w.bottomRight.css({
+ top: parseInt(w.hScrollBar.css("top")) - i
+ })
+ }
+ if (w.showaggregates) {
+ w.bottomRight.css("z-index", 99);
+ w.bottomRight.height(parseInt(d) + 4 + w.statusbarheight + i);
+ w.bottomRight.css({
+ top: parseInt(w.hScrollBar.css("top")) - w.statusbarheight - i
+ })
+ }
+ } else {
+ w.bottomRight[0].style.visibility = "hidden"
+ }
+ };
+ t(this);
+ if (F.content[0].style.width != A - j + "px") {
+ F.content.width(A - j)
+ }
+ if (F.content[0].style.height != x - h + 3 + "px") {
+ F.content.height(x - h + 3)
+ }
+ if (F.scrollbarautoshow) {
+ if (F.content[0].style.width != A + "px") {
+ F.content.width(A)
+ }
+ if (F.content[0].style.height != x + "px") {
+ F.content.height(x)
+ }
+ }
+ if (F.content[0].style.top != v + "px") {
+ F.content.css("top", v)
+ }
+ if (F.rtl) {
+ F.content.css("left", j);
+ if (F.scrollbarautoshow) {
+ F.content.css("left", "0px")
+ }
+ if (F.table) {
+ var u = F.table.width();
+ if (u < A - j) {
+ F.content.css("left", A - u)
+ }
+ }
+ }
+ if (F.showstatusbar) {
+ F.statusbar.css("top", v + x - F.statusbarheight - (F.pageable ? F.pagerheight: 0));
+ if (F.showaggregates) {
+ if (F.hScrollBar.css("visibility") == "visible") {
+ F.hScrollBar.css({
+ top: v + x - s - d - r + F.statusbarheight + "px"
+ });
+ F.statusbar.css("top", 1 + v + x - d - 5 - F.statusbarheight - (F.pageable ? F.pagerheight: 0))
+ }
+ t(this)
+ }
+ if (F.rtl) {
+ if (F.hScrollBar.css("visibility") != "visible") {
+ F.statusbar.css("left", F.content.css("left"))
+ } else {
+ F.statusbar.css("left", "0px")
+ }
+ }
+ }
+ if (F.showeverpresentrow && F.everpresentrowposition === "bottom") {
+ F.addnewrow.css("top", v + x - (F.showstatusbar ? F.statusbarheight: 0) - (F.pageable ? F.pagerheight: 0) - F.everpresentrowheight);
+ if (F.rtl) {
+ if (F.hScrollBar.css("visibility") != "visible") {
+ F.addnewrow.css("left", F.content.css("left"))
+ } else {
+ F.addnewrow.css("left", "0px")
+ }
+ }
+ }
+ if (F.pageable) {
+ F.pager.width(A);
+ F.pager.height(F.pagerheight);
+ F.pager.css("top", v + x - F.pagerheight - 1)
+ } else {
+ F.pager[0].style.height = "0px"
+ }
+ if (F.table != null) {
+ var g = -2;
+ if (F.vScrollBar[0].style.visibility == "visible") {
+ g = F.scrollbarsize + 3
+ }
+ if (F.hScrollBar[0].style.visibility == "visible") {
+ var E = g + F.table.width() - F.host.width();
+ if (E >= 0) {
+ F.hScrollBar.jqxScrollBar("max", E)
+ }
+ if (F.hScrollBar[0].style.visibility == "visible" && E == 0) {
+ F.hScrollBar[0].style.visibility = "hidden";
+ F._arrange()
+ }
+ }
+ }
+ if (A != parseInt(F.dataloadelement[0].style.width)) {
+ F.dataloadelement[0].style.width = F.element.style.width
+ }
+ if (x != parseInt(F.dataloadelement[0].style.height)) {
+ F.dataloadelement[0].style.height = F.element.style.height
+ }
+ F._hostwidth = A
+ },
+ destroy: function() {
+ delete b.jqx.dataFormat.datescache;
+ delete this.gridlocalization;
+ b.jqx.utilities.resize(this.host, null, true);
+ if (this.table && this.table[0]) {
+ var m = this.table[0].rows.length;
+ for (var k = 0; k < m; k++) {
+ var q = this.table[0].rows[k];
+ var p = q.cells;
+ var f = p.length;
+ for (var h = 0; h < f; h++) {
+ b(q.cells[h]).remove();
+ q.cells[h] = null;
+ delete q.cells[h]
+ }
+ q.cells = null;
+ if (q.cells) {
+ delete q.cells
+ }
+ b(this.table[0].rows[k]).remove();
+ this.table[0].rows[k] = null
+ }
+ try {
+ delete this.table[0].rows
+ } catch(n) {}
+ this.table.remove();
+ delete this.table
+ }
+ if (this.columns && this.columns.records) {
+ for (var k = 0; k < this.columns.records.length; k++) {
+ var e = this.columns.records[k];
+ if (e.addnewrowwidget) {
+ if (e.destroyeverpresentrowwidget) {
+ e.destroyeverpresentrowwidget(e.addnewrowwidget)
+ }
+ }
+ this._removecolumnhandlers(this.columns.records[k]);
+ if (e.element) {
+ b(e.element).remove();
+ b(e.sortasc).remove();
+ b(e.sortdesc).remove();
+ b(e.filtericon).remove();
+ b(e.menu).remove();
+ e.element = null;
+ e.uielement = null;
+ e.sortasc = null;
+ e.sortdesc = null;
+ e.filtericon = null;
+ e.menu = null;
+ delete e.element;
+ delete e.uielement;
+ delete e.sortasc;
+ delete e.sortdesc;
+ delete e.filtericon;
+ delete e.menu;
+ delete this.columnsrow[0].cells[k]
+ }
+ }
+ try {
+ delete this.columnsrow[0].cells
+ } catch(n) {}
+ delete this.columnsrow
+ }
+ b.removeData(document.body, "contextmenu" + this.element.id);
+ if (this.host.jqxDropDownList) {
+ if (this._destroyfilterpanel) {
+ this._destroyfilterpanel()
+ }
+ }
+ if (this.editable && this._destroyeditors) {
+ this._destroyeditors()
+ }
+ if (this.filterable && this._destroyedfilters && this.showfilterrow) {
+ this._destroyedfilters()
+ }
+ if (this.host.jqxMenu) {
+ if (this.gridmenu) {
+ this.removeHandler(b(document), "click.menu" + this.element.id);
+ this.removeHandler(this.gridmenu, "keydown");
+ this.removeHandler(this.gridmenu, "closed");
+ this.removeHandler(this.gridmenu, "itemclick");
+ this.gridmenu.jqxMenu("destroy");
+ this.gridmenu = null
+ }
+ }
+ if (this.pagershowrowscombo) {
+ this.pagershowrowscombo.jqxDropDownList("destroy");
+ this.pagershowrowscombo = null
+ }
+ if (this.pagerrightbutton) {
+ this.removeHandler(this.pagerrightbutton, "mousedown");
+ this.removeHandler(this.pagerrightbutton, "mouseup");
+ this.removeHandler(this.pagerrightbutton, "click");
+ this.pagerrightbutton.jqxButton("destroy");
+ this.pagerrightbutton = null
+ }
+ if (this.pagerleftbutton) {
+ this.removeHandler(this.pagerleftbutton, "mousedown");
+ this.removeHandler(this.pagerleftbutton, "mouseup");
+ this.removeHandler(this.pagerleftbutton, "click");
+ this.pagerleftbutton.jqxButton("destroy");
+ this.removeHandler(b(document), "mouseup.pagerbuttons" + this.element.id);
+ this.pagerleftbutton = null
+ }
+ this.removeHandler(b(document), "selectstart." + this.element.id);
+ this.removeHandler(b(document), "mousedown.resize" + this.element.id);
+ this.removeHandler(b(document), "mouseup.resize" + this.element.id);
+ this.removeHandler(b(document), "mousemove.resize" + this.element.id);
+ if (this.isTouchDevice()) {
+ var l = b.jqx.mobile.getTouchEventName("touchmove") + ".resize" + this.element.id;
+ var d = b.jqx.mobile.getTouchEventName("touchstart") + ".resize" + this.element.id;
+ var g = b.jqx.mobile.getTouchEventName("touchend") + ".resize" + this.element.id;
+ this.removeHandler(b(document), l);
+ this.removeHandler(b(document), d);
+ this.removeHandler(b(document), g)
+ }
+ this.removeHandler(b(document), "mousedown.reorder" + this.element.id);
+ this.removeHandler(b(document), "mouseup.reorder" + this.element.id);
+ this.removeHandler(b(document), "mousemove.reorder" + this.element.id);
+ if (this.isTouchDevice()) {
+ var l = b.jqx.mobile.getTouchEventName("touchmove") + ".reorder" + this.element.id;
+ var d = b.jqx.mobile.getTouchEventName("touchstart") + ".reorder" + this.element.id;
+ var g = b.jqx.mobile.getTouchEventName("touchend") + ".reorder" + this.element.id;
+ this.removeHandler(b(document), l);
+ this.removeHandler(b(document), d);
+ this.removeHandler(b(document), g)
+ }
+ this.removeHandler(b(window), "resize." + this.element.id);
+ if (this.groupable) {
+ var l = "mousemove.grouping" + this.element.id;
+ var d = "mousedown.grouping" + this.element.id;
+ var g = "mouseup.grouping" + this.element.id;
+ this.removeHandler(b(document), l);
+ this.removeHandler(b(document), d);
+ this.removeHandler(b(document), g)
+ }
+ if (this.columnsreorder) {
+ var l = "mousemove.reorder" + this.element.id;
+ var d = "mousedown.reorder" + this.element.id;
+ var g = "mouseup.reorder" + this.element.id;
+ this.removeHandler(b(document), l);
+ this.removeHandler(b(document), d);
+ this.removeHandler(b(document), g);
+ delete this.columnsbounds
+ }
+ if (this.content) {
+ this.removeHandler(this.content, "mousedown");
+ this.removeHandler(this.content, "scroll")
+ }
+ this._removeHandlers();
+ this.hScrollInstance.destroy();
+ this.vScrollInstance.destroy();
+ this.hScrollBar.remove();
+ this.vScrollBar.remove();
+ this._clearcaches();
+ delete this.hScrollInstance;
+ delete this.vScrollInstance;
+ delete this.visiblerows;
+ delete this.hittestinfo;
+ delete this.rows;
+ delete this.columns;
+ delete this.columnsbydatafield;
+ delete this.pagescache;
+ delete this.pageviews;
+ delete this.cellscache;
+ delete this.heights;
+ delete this.hiddens;
+ delete this.hiddenboundrows;
+ delete this.heightboundrows;
+ delete this.detailboundrows;
+ delete this.details;
+ delete this.expandedgroups;
+ delete this._rowdetailscache;
+ delete this._rowdetailselementscache;
+ delete this.columnsmenu;
+ if (this.columnsheader) {
+ this.columnsheader.remove();
+ delete this.columnsheader
+ }
+ if (this.selectionarea) {
+ this.selectionarea.remove();
+ delete this.selectionarea
+ }
+ if (this.menuitemsarray && this.menuitemsarray.length) {
+ var o = this.menuitemsarray.length;
+ for (var k = 0; k < o; k++) {
+ b(this.menuitemsarray[k]).remove()
+ }
+ }
+ delete this.menuitemsarray;
+ this.dataview._clearcaches();
+ this.content.removeClass();
+ this.content.remove();
+ this.content = null;
+ delete this.content;
+ this.vScrollBar = null;
+ this.hScrollBar = null;
+ delete this.hScrollBar;
+ delete this.hScrollBar;
+ if (this.gridcontent) {
+ this.gridcontent.remove();
+ delete this.gridcontent
+ }
+ if (this.gridmenu) {
+ this.gridmenu = null;
+ delete this.gridmenu
+ }
+ delete this._mousemovefunc;
+ delete this._mousewheelfunc;
+ this.dataview.destroy();
+ delete this.dataview;
+ this.bottomRight.remove();
+ delete this.bottomRight;
+ this.wrapper.remove();
+ delete this.wrapper;
+ if (this.pagerdiv) {
+ this.pagerdiv.remove();
+ delete this.pagerdiv
+ }
+ if (this.pagerpageinput) {
+ this.pagerpageinput.remove();
+ delete this.pagerpageinput
+ }
+ if (this.pagergoto) {
+ this.pagergoto.remove();
+ delete this.pagergoto
+ }
+ if (this.pagershowrows) {
+ this.pagershowrows.remove();
+ delete this.pagershowrows
+ }
+ if (this.pagerfirstbutton) {
+ this.pagerfirstbutton.remove();
+ delete this.pagerfirstbutton
+ }
+ if (this.pagerlastbutton) {
+ this.pagerlastbutton.remove();
+ delete this.pagerlastbutton
+ }
+ if (this.pagerbuttons) {
+ this.pagerbuttons.remove();
+ delete this.pagerbuttons
+ }
+ if (this.pagerdetails) {
+ this.pagerdetails.remove();
+ delete this.pagerdetails
+ }
+ if (this.pagergotoinput) {
+ this.pagergotoinput.remove();
+ delete this.pagergotoinput
+ }
+ this.pager.remove();
+ delete this.pager;
+ this.groupsheader.remove();
+ delete this.groupsheader;
+ this.dataloadelement.remove();
+ delete this.dataloadelement;
+ this.toolbar.remove();
+ delete this.toolbar;
+ this.statusbar.remove();
+ delete this.statusbar;
+ this.host.removeData();
+ this.host.removeClass();
+ this.host.remove();
+ this.host = null;
+ delete this.host;
+ delete this.element;
+ delete this.set;
+ delete this.get;
+ delete this.that;
+ delete this.call
+ },
+ _initializeColumns: function() {
+ var f = this.source ? this.source.datafields: null;
+ if (f == null && this.source && this.source._source) {
+ f = this.source._source.datafields
+ }
+ var j = f ? f.length > 0 : false;
+ if (this.autogeneratecolumns) {
+ var l = new Array();
+ if (f) {
+ b.each(f,
+ function() {
+ var i = {
+ datafield: this.name,
+ text: this.text || this.name,
+ cellsformat: this.format || ""
+ };
+ l.push(i)
+ })
+ } else {
+ if (this.source.records.length > 0) {
+ var n = this.source.records[0];
+ for (obj in n) {
+ if (obj != "uid") {
+ var g = {
+ width: 100,
+ datafield: obj,
+ text: obj
+ };
+ l.push(g)
+ }
+ }
+ }
+ }
+ this.columns = l
+ }
+ if (this.columns && this.columns.records) {
+ for (var h = 0; h < this.columns.records.length; h++) {
+ this._removecolumnhandlers(this.columns.records[h])
+ }
+ }
+ var k = this.that;
+ var e = new b.jqx.collection(this.element);
+ var d = 0;
+ this._haspinned = false;
+ if (!this._columns) {
+ this._columns = this.columns
+ } else {
+ this.columns = this._columns
+ }
+ if (this.groupable) {
+ b.each(this.groups,
+ function(i) {
+ var o = new c(k, this);
+ o.visibleindex = d++;
+ o.width = k.groupindentwidth;
+ e.add(o);
+ o.grouped = true;
+ o.filterable = false;
+ o.sortable = false;
+ o.editable = false;
+ o.resizable = false;
+ o.draggable = false
+ })
+ }
+ if (this.rowdetails && this.showrowdetailscolumn) {
+ var g = new c(k, this);
+ g.visibleindex = d++;
+ g.width = k.groupindentwidth;
+ g.pinned = true;
+ g.editable = false;
+ g.filterable = false;
+ g.draggable = false;
+ g.groupable = false;
+ g.resizable = false;
+ e.add(g);
+ k._haspinned = true
+ }
+ if (this.selectionmode == "checkbox") {
+ var g = new c(k, null);
+ g.visibleindex = d++;
+ g.width = k.groupindentwidth;
+ g.checkboxcolumn = true;
+ g.editable = false;
+ g.columntype = "checkbox";
+ g.groupable = false;
+ g.draggable = false;
+ g.filterable = false;
+ g.resizable = false;
+ g.datafield = "_checkboxcolumn";
+ e.add(g)
+ }
+ var m = new Array();
+ b.each(this.columns,
+ function(i) {
+ if (k.columns[i] != undefined) {
+ var o = new c(k, this);
+ o.visibleindex = d++;
+ if (this.dataField != undefined) {
+ this.datafield = this.dataField
+ }
+ if (this.pinned) {
+ k._haspinned = true
+ }
+ if (k.showeverpresentrow) {
+ if (this.datafield === "addButtonColumn" || this.datafield === "resetButtonColumn" || this.datafield === "updateButtonColumn" || this.datafield === "deleteButtonColumn") {
+ o.editable = false;
+ o.groupable = false;
+ o.draggable = false;
+ o.filterable = false;
+ o.resizable = false;
+ o.menu = false
+ }
+ }
+ if (this.datafield == null) {
+ if (k.source && k.source._source && (k.source._source.datatype == "array")) {
+ if (!j) {
+ if (!k.source._source.datafields) {
+ k.source._source.datafields = new Array();
+ k.source._source.datafields.push({
+ name: i.toString()
+ })
+ } else {
+ k.source._source.datafields.push({
+ name: i.toString()
+ })
+ }
+ }
+ this.datafield = i.toString();
+ this.displayfield = i.toString();
+ o.datafield = this.datafield;
+ o.displayfield = this.displayfield
+ }
+ } else {
+ if (m[this.datafield]) {
+ throw new Error("jqxGrid: Invalid column 'datafield' setting. jqxGrid's columns should be initialized with unique data fields.");
+ k.host.remove();
+ return false
+ } else {
+ m[this.datafield] = true
+ }
+ }
+ e.add(o)
+ }
+ });
+ if (this.rtl) {
+ e.records.reverse()
+ }
+ this.columns = e
+ },
+ _initializeRows: function() {
+ var d = new b.jqx.collection(this.element);
+ if (this.rows) {
+ this.rows.clear()
+ }
+ this.rows = d
+ },
+ _raiseEvent: function(i, e) {
+ if (e == undefined) {
+ e = {
+ owner: null
+ }
+ }
+ if (this._trigger === false) {
+ return
+ }
+ var f = this.events[i];
+ if (!this._camelCase) {
+ f = f.toLowerCase()
+ }
+ if (i == 2 || i == 15) {
+ if (this.showeverpresentrow && (this.everpresentrowactions.indexOf("delete") >= 0 || this.everpresentrowactions.indexOf("update") >= 0)) {
+ if (this.updateeverpresentrow) {
+ var h = this
+ }
+ setTimeout(function() {
+ h.updateeverpresentrow()
+ },
+ 50)
+ }
+ }
+ args = e;
+ args.owner = this;
+ var g = new b.Event(f);
+ g.owner = this;
+ g.args = args;
+ var d = this.host.trigger(g);
+ e = g.args;
+ return d
+ },
+ wheel: function(f, e) {
+ if (e.autoheight && e.hScrollBar.css("visibility") != "visible") {
+ f.returnValue = true;
+ return true
+ }
+ var g = 0;
+ if (!f) {
+ f = window.event
+ }
+ if (f.originalEvent && f.originalEvent.wheelDelta) {
+ f.wheelDelta = f.originalEvent.wheelDelta
+ }
+ if (f.wheelDelta) {
+ g = f.wheelDelta / 120
+ } else {
+ if (f.detail) {
+ g = -f.detail / 3
+ }
+ }
+ if (g) {
+ var d = e._handleDelta(g);
+ if (d) {
+ if (f.preventDefault) {
+ f.preventDefault()
+ }
+ if (f.originalEvent != null) {
+ f.originalEvent.mouseHandled = true
+ }
+ if (f.stopPropagation != undefined) {
+ f.stopPropagation()
+ }
+ }
+ if (d) {
+ d = false;
+ f.returnValue = d;
+ return d
+ } else {
+ return false
+ }
+ }
+ if (f.preventDefault) {
+ f.preventDefault()
+ }
+ f.returnValue = false
+ },
+ _handleDelta: function(f) {
+ if (this.vScrollBar.css("visibility") != "hidden") {
+ var e = this.vScrollInstance.value;
+ if (f < 0) {
+ this.scrollDown()
+ } else {
+ this.scrollUp()
+ }
+ var d = this.vScrollInstance.value;
+ if (e != d) {
+ return true
+ }
+ } else {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ var e = this.hScrollInstance.value;
+ if (f > 0) {
+ if (this.hScrollInstance.value > 2 * this.horizontalscrollbarstep) {
+ this.hScrollInstance.setPosition(this.hScrollInstance.value - 2 * this.horizontalscrollbarstep)
+ } else {
+ this.hScrollInstance.setPosition(0)
+ }
+ } else {
+ if (this.hScrollInstance.value < this.hScrollInstance.max) {
+ this.hScrollInstance.setPosition(this.hScrollInstance.value + 2 * this.horizontalscrollbarstep)
+ } else {
+ this.hScrollInstance.setPosition(this.hScrollInstance.max)
+ }
+ }
+ var d = this.hScrollInstance.value;
+ if (e != d) {
+ return true
+ }
+ }
+ }
+ return false
+ },
+ scrollDown: function() {
+ if (this.vScrollBar.css("visibility") == "hidden") {
+ return
+ }
+ var d = this.vScrollInstance;
+ if (d.value + this.rowsheight <= d.max) {
+ d.setPosition(parseInt(d.value) + this.rowsheight)
+ } else {
+ d.setPosition(d.max)
+ }
+ },
+ scrollUp: function() {
+ if (this.vScrollBar.css("visibility") == "hidden") {
+ return
+ }
+ var d = this.vScrollInstance;
+ if (d.value - this.rowsheight >= d.min) {
+ d.setPosition(parseInt(d.value) - this.rowsheight)
+ } else {
+ d.setPosition(d.min)
+ }
+ },
+ _removeHandlers: function() {
+ var d = this.that;
+ d.removeHandler(b(window), "orientationchange.jqxgrid" + d.element.id);
+ d.removeHandler(b(window), "orientationchanged.jqxgrid" + d.element.id);
+ d.removeHandler(d.vScrollBar, "valueChanged");
+ d.removeHandler(d.hScrollBar, "valueChanged");
+ d.vScrollInstance.valueChanged = null;
+ d.hScrollInstance.valueChanged = null;
+ var e = "mousedown.jqxgrid";
+ if (d.isTouchDevice()) {
+ e = b.jqx.mobile.getTouchEventName("touchend")
+ }
+ d.removeHandler(d.host, "dblclick.jqxgrid");
+ d.removeHandler(d.host, e);
+ d.removeHandler(d.content, "mousemove", d._mousemovefunc);
+ d.removeHandler(d.host, "mouseleave.jqxgrid");
+ d.removeHandler(d.content, "mouseenter");
+ d.removeHandler(d.content, "mouseleave");
+ d.removeHandler(d.content, "mousedown");
+ d.removeHandler(d.content, "scroll");
+ d.removeHandler(d.content, "selectstart." + d.element.id);
+ d.removeHandler(d.host, "dragstart." + d.element.id);
+ d.removeHandler(d.host, "keydown.edit" + d.element.id);
+ d.removeHandler(b(document), "keydown.edit" + d.element.id);
+ d.removeHandler(b(document), "keyup.edit" + d.element.id);
+ if (d._mousemovedocumentfunc) {
+ d.removeHandler(b(document), "mousemove.selection" + d.element.id, d._mousemovedocumentfunc)
+ }
+ d.removeHandler(b(document), "mouseup.selection" + d.element.id);
+ if (d._mousewheelfunc) {
+ d.removeHandler(d.host, "mousewheel", d._mousewheelfunc)
+ }
+ if (d.editable) {
+ d.removeHandler(b(document), "mousedown.gridedit" + d.element.id)
+ }
+ if (d.host.off) {
+ d.content.off("mousemove");
+ d.host.off("mousewheel")
+ }
+ },
+ _addHandlers: function() {
+ var e = this.that;
+ var d = e.isTouchDevice();
+ if (!d) {
+ e.addHandler(e.host, "dragstart." + e.element.id,
+ function(j) {
+ return false
+ })
+ }
+ if (e.scrollbarautoshow) {
+ e.addHandler(e.host, "mouseenter.gridscroll" + e.element.id,
+ function(j) {
+ e.vScrollBar.fadeIn("fast");
+ e.hScrollBar.fadeIn("fast")
+ });
+ e.addHandler(e.host, "mouseleave.gridscroll" + e.element.id,
+ function(j) {
+ if (!e.vScrollInstance.isScrolling() && !e.hScrollInstance.isScrolling()) {
+ e.vScrollBar.fadeOut("fast");
+ e.hScrollBar.fadeOut("fast")
+ }
+ })
+ }
+ if (e.editable) {
+ e.addHandler(b(document), "mousedown.gridedit" + e.element.id,
+ function(m) {
+ if (e.editable && e.begincelledit) {
+ if (e.editcell) {
+ if (!e.vScrollInstance.isScrolling() && !e.vScrollInstance.isScrolling()) {
+ var r = e.host.coord();
+ var q = e.host.width();
+ var n = e.host.height();
+ var v = false;
+ var k = false;
+ var t = false;
+ if (m.pageY < r.top || m.pageY > r.top + n) {
+ v = true;
+ k = true
+ }
+ if (m.pageX < r.left || m.pageX > r.left + q) {
+ v = true;
+ t = true
+ }
+ if (v) {
+ var u = false;
+ if (e.editcell && e.editcell.editor) {
+ switch (e.editcell.columntype) {
+ case "datetimeinput":
+ if (e.editcell.editor.jqxDateTimeInput && e.editcell.editor.jqxDateTimeInput("container") && e.editcell.editor.jqxDateTimeInput("container")[0].style.display == "block") {
+ var s = e.editcell.editor.jqxDateTimeInput("container").coord().top;
+ var j = e.editcell.editor.jqxDateTimeInput("container").coord().top + e.editcell.editor.jqxDateTimeInput("container").height();
+ if (k && (m.pageY < s || m.pageY > j)) {
+ v = true;
+ e.editcell.editor.jqxDateTimeInput("close")
+ } else {
+ return
+ }
+ }
+ break;
+ case "combobox":
+ if (e.editcell.editor.jqxComboBox && e.editcell.editor.jqxComboBox("container") && e.editcell.editor.jqxComboBox("container")[0].style.display == "block") {
+ var s = e.editcell.editor.jqxComboBox("container").coord().top;
+ var j = e.editcell.editor.jqxComboBox("container").coord().top + e.editcell.editor.jqxComboBox("container").height();
+ if (k && (m.pageY < s || m.pageY > j)) {
+ v = true;
+ e.editcell.editor.jqxComboBox("close")
+ } else {
+ return
+ }
+ }
+ break;
+ case "dropdownlist":
+ if (e.editcell.editor.jqxDropDownList && e.editcell.editor.jqxDropDownList("container") && e.editcell.editor.jqxDropDownList("container")[0].style.display == "block") {
+ var s = e.editcell.editor.jqxDropDownList("container").coord().top;
+ var j = e.editcell.editor.jqxDropDownList("container").coord().top + e.editcell.editor.jqxDropDownList("container").height();
+ if (k && (m.pageY < s || m.pageY > j)) {
+ v = true;
+ e.editcell.editor.jqxDropDownList("close")
+ } else {
+ return
+ }
+ }
+ break;
+ case "template":
+ case "custom":
+ var l = ["jqxDropDownList", "jqxComboBox", "jqxDropDownButton", "jqxDateTimeInput"];
+ var p = function(A) {
+ var z = e.editcell.editor.data();
+ if (z[A] && z[A].instance.container && z[A].instance.container[0].style.display == "block") {
+ var x = z[A].instance;
+ var B = x.container.coord().top;
+ var y = x.container.coord().top + x.container.height();
+ if (k && (m.pageY < B || m.pageY > y)) {
+ v = true;
+ x.close();
+ return true
+ } else {
+ return false
+ }
+ }
+ };
+ for (var o = 0; o < l.length; o++) {
+ var w = p(l[o]);
+ if (w == false) {
+ return
+ }
+ }
+ break
+ }
+ }
+ e.endcelledit(e.editcell.row, e.editcell.column, false, true);
+ e._oldselectedcell = null
+ }
+ }
+ }
+ }
+ })
+ }
+ e.vScrollInstance.valueChanged = function(j) {
+ if (e.virtualsizeinfo) {
+ e._closemenu();
+ if (e.scrollmode != "physical") {
+ e._renderrows(e.virtualsizeinfo);
+ e.currentScrollValue = j.currentValue
+ } else {
+ if (e.currentScrollValue != undefined && Math.abs(e.currentScrollValue - j.currentValue) >= 5) {
+ e._renderrows(e.virtualsizeinfo);
+ e.currentScrollValue = j.currentValue
+ } else {
+ e._renderrows(e.virtualsizeinfo);
+ e.currentScrollValue = j.currentValue
+ }
+ }
+ if (!e.pageable && !e.groupable && e.dataview.virtualmode) {
+ if (e.loadondemandupdate) {
+ clearTimeout(e.loadondemandupdate)
+ }
+ e.loadondemandupdate = setTimeout(function() {
+ e.loadondemand = true;
+ e._renderrows(e.virtualsizeinfo)
+ },
+ 100)
+ }
+ if (d) {
+ e._lastScroll = new Date()
+ }
+ }
+ };
+ e.hScrollInstance.valueChanged = function(l) {
+ if (e.virtualsizeinfo) {
+ e._closemenu();
+ var k = function() {
+ e._renderhorizontalscroll();
+ e._renderrows(e.virtualsizeinfo);
+ if (e.editcell && !e.editrow) {
+ if (e._showcelleditor && e.editcell.editing) {
+ if (!e.hScrollInstance.isScrolling()) {
+ e._showcelleditor(e.editcell.row, e.getcolumn(e.editcell.column), e.editcell.element, e.editcell.init)
+ }
+ }
+ }
+ };
+ var j = e._browser == undefined ? e._isIE10() : e._browser;
+ if (navigator && navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1) {
+ if (e._hScrollTimer) {
+ clearTimeout(e._hScrollTimer)
+ }
+ e._hScrollTimer = setTimeout(function() {
+ k()
+ },
+ 1)
+ } else {
+ if (b.jqx.browser.msie) {
+ if (e._hScrollTimer) {
+ clearTimeout(e._hScrollTimer)
+ }
+ e._hScrollTimer = setTimeout(function() {
+ k()
+ },
+ 0.01)
+ } else {
+ k()
+ }
+ }
+ if (d) {
+ e._lastScroll = new Date()
+ }
+ }
+ };
+ e._mousewheelfunc = e._mousewheelfunc ||
+ function(j) {
+ if (!e.editcell && e.enablemousewheel) {
+ e.wheel(j, e);
+ return false
+ }
+ };
+ e.removeHandler(e.host, "mousewheel", e._mousewheelfunc);
+ e.addHandler(e.host, "mousewheel", e._mousewheelfunc);
+ var h = "mousedown.jqxgrid";
+ if (d) {
+ h = b.jqx.mobile.getTouchEventName("touchend")
+ }
+ e.addHandler(e.host, h,
+ function(k) {
+ if (e.isTouchDevice()) {
+ e._newScroll = new Date();
+ if (e._newScroll - e._lastScroll < 500) {
+ return false
+ }
+ if (b(k.target).ischildof(e.vScrollBar)) {
+ return false
+ }
+ if (b(k.target).ischildof(e.hScrollBar)) {
+ return false
+ }
+ }
+ e._mousedown = new Date();
+ var j = e._handlemousedown(k, e);
+ if (e.isNestedGrid) {
+ if (!e.resizablecolumn && !e.columnsreorder) {
+ k.stopPropagation()
+ }
+ }
+ e._lastmousedown = new Date();
+ return j
+ });
+ if (!d) {
+ e.addHandler(e.host, "dblclick.jqxgrid",
+ function(k) {
+ if (e.editable && e.begincelledit && e.editmode == "dblclick") {
+ e._handledblclick(k, e)
+ } else {
+ if (b.jqx.browser.msie && b.jqx.browser.version < 9) {
+ var j = e._handlemousedown(k, e)
+ }
+ }
+ e.mousecaptured = false;
+ e._lastmousedown = new Date();
+ return true
+ });
+ e._mousemovefunc = function(j) {
+ if (e._handlemousemove) {
+ return e._handlemousemove(j, e)
+ }
+ };
+ e.addHandler(e.content, "mousemove", e._mousemovefunc);
+ if (e._handlemousemoveselection) {
+ e._mousemovedocumentfunc = function(j) {
+ if (e._handlemousemoveselection) {
+ return e._handlemousemoveselection(j, e)
+ }
+ };
+ e.addHandler(b(document), "mousemove.selection" + e.element.id, e._mousemovedocumentfunc)
+ }
+ e.addHandler(b(document), "mouseup.selection" + e.element.id,
+ function(j) {
+ if (e._handlemouseupselection) {
+ e._handlemouseupselection(j, e)
+ }
+ })
+ }
+ try {
+ if (document.referrer != "" || window.frameElement) {
+ if (window.top != null && window.top != window.self) {
+ var i = null;
+ if (window.parent && document.referrer) {
+ i = document.referrer
+ }
+ if (i && i.indexOf(document.location.host) != -1) {
+ var g = function(k) {
+ if (e._handlemouseupselection) {
+ try {
+ e._handlemouseupselection(k, e)
+ } catch(j) {}
+ }
+ };
+ if (window.top.document.addEventListener) {
+ window.top.document.addEventListener("mouseup", g, false)
+ } else {
+ if (window.top.document.attachEvent) {
+ window.top.document.attachEvent("onmouseup", g)
+ }
+ }
+ }
+ }
+ }
+ } catch(f) {}
+ e.focused = false;
+ if (!d) {
+ e.addHandler(e.content, "mouseenter",
+ function(j) {
+ e.focused = true;
+ if (e.wrapper) {
+ e.wrapper.attr("tabindex", 1);
+ e.content.attr("tabindex", 2)
+ }
+ if (e._overlayElement) {
+ if (e.vScrollInstance.isScrolling() || e.hScrollInstance.isScrolling()) {
+ e._overlayElement[0].style.visibility = "visible"
+ } else {
+ e._overlayElement[0].style.visibility = "hidden"
+ }
+ }
+ });
+ e.addHandler(e.content, "mouseleave",
+ function(j) {
+ if (e._handlemousemove) {
+ if (e.enablehover) {
+ e._clearhoverstyle()
+ }
+ }
+ if (e._overlayElement) {
+ e._overlayElement[0].style.visibility = "hidden"
+ }
+ e.focused = false
+ });
+ if (e.groupable || e.columnsreorder) {
+ e.addHandler(b(document), "selectstart." + e.element.id,
+ function(j) {
+ if (e.__drag === true) {
+ return false
+ }
+ })
+ }
+ e.addHandler(e.content, "selectstart." + e.element.id,
+ function(j) {
+ if (e.enablebrowserselection) {
+ return true
+ }
+ if (e.showfilterrow) {
+ if (b(j.target).ischildof(e.filterrow)) {
+ return true
+ }
+ }
+ if (e.showeverpresentrow) {
+ if (b(j.target).ischildof(e.addnewrow)) {
+ return true
+ }
+ if (e.addnewrowtop) {
+ if (b(j.target).ischildof(e.addnewrowtop)) {
+ return true
+ }
+ }
+ }
+ if (!e.editcell) {
+ return false
+ }
+ if (j.stopPropagation) {
+ j.stopPropagation()
+ }
+ });
+ e.addHandler(b(document), "keyup.edit" + e.element.id,
+ function(j) {
+ e._keydown = false
+ });
+ e.addHandler(b(document), "keydown.edit" + e.element.id,
+ function(l) {
+ e._keydown = true && !e.editcell;
+ var k = l.charCode ? l.charCode: l.keyCode ? l.keyCode: 0;
+ if (e.handlekeyboardnavigation) {
+ var m = e.handlekeyboardnavigation(l);
+ if (m == true) {
+ return false
+ }
+ }
+ if (e.editable && e.editcell) {
+ if (k == 13 || k == 27) {
+ if (e._handleeditkeydown) {
+ j = e._handleeditkeydown(l, e)
+ }
+ }
+ }
+ if (k == 27) {
+ e.mousecaptured = false;
+ if (e.selectionarea.css("visibility") == "visible") {
+ e.selectionarea.css("visibility", "hidden")
+ }
+ }
+ if (b.jqx.browser.msie && b.jqx.browser.version < 12 && e.focused && !e.isNestedGrid) {
+ if (k == 13 && j == false) {
+ return j
+ }
+ var j = true;
+ var k = l.charCode ? l.charCode: l.keyCode ? l.keyCode: 0;
+ if (!e.editcell && e.editable && e.editmode != "programmatic") {
+ if (e._handleeditkeydown) {
+ j = e._handleeditkeydown(l, e)
+ }
+ }
+ if (j && e.keyboardnavigation && e._handlekeydown) {
+ j = e._handlekeydown(l, e);
+ if (!j) {
+ if (l.preventDefault) {
+ l.preventDefault()
+ }
+ if (l.stopPropagation != undefined) {
+ l.stopPropagation()
+ }
+ }
+ return j
+ }
+ }
+ return true
+ });
+ e.addHandler(e.host, "keydown.edit" + e.element.id,
+ function(k) {
+ var j = true;
+ if (e.handlekeyboardnavigation) {
+ var l = e.handlekeyboardnavigation(k);
+ if (l == true) {
+ return false
+ }
+ }
+ if (e.editable && e.editmode != "programmatic") {
+ if (e._handleeditkeydown) {
+ j = e._handleeditkeydown(k, e);
+ if (e.isNestedGrid) {
+ k.stopPropagation()
+ }
+ }
+ }
+ if (! (b.jqx.browser.msie && b.jqx.browser.version < 8)) {
+ if (j && e.keyboardnavigation && e._handlekeydown) {
+ j = e._handlekeydown(k, e);
+ if (e.isNestedGrid) {
+ k.stopPropagation()
+ }
+ }
+ } else {
+ if (e.isNestedGrid) {
+ if (j && e.keyboardnavigation && e._handlekeydown) {
+ j = e._handlekeydown(k, e);
+ k.stopPropagation()
+ }
+ }
+ }
+ if (!j) {
+ if (k.preventDefault) {
+ k.preventDefault()
+ }
+ if (k.stopPropagation != undefined) {
+ k.stopPropagation()
+ }
+ }
+ return j
+ })
+ }
+ },
+ _hittestrow: function(s, q) {
+ if (this.vScrollInstance == null || this.hScrollInstance == null) {
+ return
+ }
+ if (s == undefined) {
+ s = 0
+ }
+ if (q == undefined) {
+ q == 0
+ }
+ var l = this.vScrollInstance;
+ var k = this.hScrollInstance;
+ var f = l.value;
+ if (this.vScrollBar.css("visibility") != "visible") {
+ f = 0
+ }
+ var m = k.value;
+ if (this.hScrollBar.css("visibility") != "visible") {
+ m = 0
+ }
+ if (this.scrollmode == "deferred" && this._newmax != null) {
+ if (f > this._newmax) {
+ f = this._newmax
+ }
+ }
+ var r = parseInt(f) + q;
+ var j = parseInt(m) + s;
+ if (this.visiblerows == null) {
+ return
+ }
+ if (this.visiblerows.length == 0) {
+ return
+ }
+ var e = false;
+ var i = this._findvisiblerow(r, this.visiblerows);
+ if (i >= 0) {
+ var o = this.visiblerows[i];
+ var d = this.rowdetails && o.rowdetails;
+ var n = !o.rowdetailshidden;
+ if (d) {
+ var g = this.visiblerows[i - 1];
+ if (g == o) {
+ o = g;
+ i--
+ }
+ if (n) {
+ var h = b(this.hittestinfo[i].visualrow).position().top + parseInt(this.table.css("top"));
+ var p = b(this.hittestinfo[i].visualrow).height();
+ if (! (q >= h && q <= h + p)) {
+ i++;
+ o = this.visiblerows[i];
+ e = true
+ }
+ }
+ }
+ }
+ return {
+ index: i,
+ row: o,
+ details: e
+ }
+ },
+ getcellatposition: function(j, q) {
+ var r = this.that;
+ var z = this.showheader ? this.columnsheader.height() + 2 : 0;
+ var s = this._groupsheader() ? this.groupsheader.height() : 0;
+ var B = this.showtoolbar ? this.toolbarheight: 0;
+ s += B;
+ var g = this.host.coord();
+ if (this.hasTransform) {
+ g = b.jqx.utilities.getOffset(this.host)
+ }
+ var p = j - g.left;
+ var n = q - z - g.top - s;
+ var d = this._hittestrow(p, n);
+ var k = d.row;
+ var l = d.index;
+ var t = this.table[0].rows[l];
+ if (this.dataview && this.dataview.records.length == 0) {
+ var o = this.table[0].rows;
+ var C = 0;
+ for (var w = 0; w < o.length; w++) {
+ if (n >= C && n < C + this.rowsheight) {
+ t = o[w];
+ break
+ }
+ C += this.rowsheight
+ }
+ k = {
+ boundindex: w
+ }
+ }
+ if (t == null) {
+ return true
+ }
+ var u = this.hScrollInstance;
+ var v = u.value;
+ var f = 0;
+ var m = this.groupable ? this.groups.length: 0;
+ for (var w = 0; w < t.cells.length; w++) {
+ var h = parseInt(b(this.columnsrow[0].cells[w]).css("left"));
+ var j = h - v;
+ if (r.columns.records[w].pinned) {
+ j = h
+ }
+ if (r.columns.records[w].hidden) {
+ continue
+ }
+ var A = j + b(this.columnsrow[0].cells[w]).width();
+ if (A >= p && p >= j) {
+ f = w;
+ break
+ }
+ }
+ if (k != null) {
+ var e = this._getcolumnat(f);
+ return {
+ row: this.getboundindex(k),
+ column: e.datafield,
+ value: this.getcellvalue(this.getboundindex(k), e.datafield)
+ }
+ }
+ return null
+ },
+ _handlemousedown: function(P, l) {
+ if (P.target == null) {
+ return true
+ }
+ if (l.disabled) {
+ return true
+ }
+ if (b(P.target).ischildof(this.columnsheader) || b(P.target).ischildof(this.hScrollBar) || b(P.target).ischildof(this.vScrollBar)) {
+ return true
+ }
+ var m;
+ if (P.which) {
+ m = (P.which == 3)
+ } else {
+ if (P.button) {
+ m = (P.button == 2)
+ }
+ }
+ var I;
+ if (P.which) {
+ I = (P.which == 2)
+ } else {
+ if (P.button) {
+ I = (P.button == 1)
+ }
+ }
+ if (I) {
+ return true
+ }
+ if (this.showstatusbar) {
+ if (b(P.target).ischildof(this.statusbar)) {
+ return true
+ }
+ if (P.target == this.statusbar[0]) {
+ return true
+ }
+ }
+ if (this.showtoolbar) {
+ if (b(P.target).ischildof(this.toolbar)) {
+ return true
+ }
+ if (P.target == this.toolbar[0]) {
+ return true
+ }
+ }
+ if (this.pageable) {
+ if (b(P.target).ischildof(this.pager)) {
+ return true
+ }
+ if (P.target == this.pager[0]) {
+ return true
+ }
+ }
+ if (!this.columnsheader) {
+ return true
+ }
+ if (!this.editcell) {
+ if (this.pageable) {
+ if (b(P.target).ischildof(this.pager)) {
+ return true
+ }
+ }
+ }
+ var N = this.showheader ? this.columnsheader.height() + 2 : 0;
+ var u = this._groupsheader() ? this.groupsheader.height() : 0;
+ var z = this.showtoolbar ? this.toolbarheight: 0;
+ u += z;
+ var L = this.host.coord();
+ if (this.hasTransform) {
+ L = b.jqx.utilities.getOffset(this.host);
+ var R = this._getBodyOffset();
+ L.left -= R.left;
+ L.top -= R.top
+ }
+ var h = parseInt(P.pageX);
+ var j = parseInt(P.pageY);
+ if (this.isTouchDevice()) {
+ var Q = l.getTouches(P);
+ var H = Q[0];
+ h = parseInt(H.pageX);
+ j = parseInt(H.pageY);
+ if (l.touchmode == true) {
+ if (H._pageX != undefined) {
+ h = parseInt(H._pageX);
+ j = parseInt(H._pageY)
+ }
+ }
+ }
+ var C = h - L.left;
+ var B = j - N - L.top - u;
+ if (this.pageable && !this.autoheight && this.gotopage) {
+ var d = this.pager.coord().top - L.top - u - N;
+ if (B > d) {
+ return
+ }
+ }
+ var M = this._hittestrow(C, B);
+ if (!M) {
+ return
+ }
+ if (M.details) {
+ return
+ }
+ var p = M.row;
+ var w = M.index;
+ var q = P.target.className;
+ var g = this.table[0].rows[w];
+ if (g == null) {
+ if (l.editable && l.begincelledit) {
+ if (l.editcell) {
+ l.endcelledit(l.editcell.row, l.editcell.column, false, true)
+ }
+ }
+ return true
+ }
+ l.mousecaptured = true;
+ l.mousecaptureposition = {
+ left: P.pageX,
+ top: P.pageY - u,
+ clickedrow: g
+ };
+ var k = this.hScrollInstance;
+ var s = k.value;
+ if (this.rtl) {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ s = k.max - k.value
+ }
+ }
+ var A = -1;
+ var v = this.groupable ? this.groups.length: 0;
+ if (this.rtl) {
+ if (this.vScrollBar[0].style.visibility != "hidden") {
+ s -= this.scrollbarsize + 4
+ }
+ if (this.hScrollBar[0].style.visibility == "hidden") {
+ s = -parseInt(this.content.css("left"))
+ }
+ }
+ for (var J = 0; J < g.cells.length; J++) {
+ var K = parseInt(b(this.columnsrow[0].cells[J]).css("left"));
+ var h = K - s;
+ if (l.columns.records[J].pinned && !l.rtl) {
+ h = K
+ }
+ var D = this._getcolumnat(J);
+ if (D != null && D.hidden) {
+ continue
+ }
+ var E = h + b(this.columnsrow[0].cells[J]).width();
+ if (E >= C && C >= h) {
+ A = J;
+ l.mousecaptureposition.clickedcell = J;
+ break
+ }
+ }
+ if (this.rtl && this._haspinned) {
+ for (var J = g.cells.length - 1; J >= 0; J--) {
+ if (!l.columns.records[J].pinned) {
+ break
+ }
+ var K = b(this.columnsrow[0].cells[J]).coord().left - this.host.coord().left;
+ var h = K;
+ var D = this._getcolumnat(J);
+ if (D != null && D.hidden) {
+ continue
+ }
+ var E = h + b(this.columnsrow[0].cells[J]).width();
+ if (E >= C && C >= h) {
+ A = J;
+ l.mousecaptureposition.clickedcell = J;
+ break
+ }
+ }
+ }
+ if (p != null && A >= 0) {
+ this._raiseEvent(1, {
+ rowindex: this.getboundindex(p),
+ visibleindex: p.visibleindex,
+ row: p,
+ group: p.group,
+ rightclick: m,
+ originalEvent: P
+ });
+ var D = this._getcolumnat(A);
+ var F = this.getcellvalue(this.getboundindex(p), D.datafield);
+ if (this.editable && this.editcell) {
+ if (D.datafield == this.editcell.column) {
+ if (this.getboundindex(p) == this.editcell.row) {
+ this.mousecaptured = false
+ }
+ }
+ }
+ this._raiseEvent(8, {
+ rowindex: this.getboundindex(p),
+ column: D ? D.getcolumnproperties() : null,
+ row: p,
+ visibleindex: p.visibleindex,
+ datafield: D ? D.datafield: null,
+ columnindex: A,
+ value: F,
+ rightclick: m,
+ originalEvent: P
+ });
+ if (this.isTouchDevice()) {
+ if (D.columntype == "checkbox" && this.editable && this._overlayElement) {
+ if (!this.editcell) {
+ this._overlayElement.css("visibility", "hidden");
+ this.editcell = this.getcell(w, D.datafield);
+ return true
+ }
+ } else {
+ if (D.columntype == "button" && this._overlayElement) {
+ if (D.buttonclick) {
+ D.buttonclick(g.cells[A].buttonrow, P)
+ }
+ return true
+ }
+ }
+ }
+ var f = false;
+ if (this._lastmousedown != null) {
+ if (this._mousedown - this._lastmousedown < 300) {
+ if (this._clickedrowindex == this.getboundindex(p)) {
+ this._raiseEvent(22, {
+ rowindex: this.getboundindex(p),
+ row: p,
+ visibleindex: p.visibleindex,
+ group: p.group,
+ rightclick: m,
+ originalEvent: P
+ });
+ if (this._clickedcolumn == D.datafield) {
+ this._raiseEvent(23, {
+ rowindex: this.getboundindex(p),
+ row: p,
+ visibleindex: p.visibleindex,
+ column: D ? D.getcolumnproperties() : null,
+ datafield: D ? D.datafield: null,
+ columnindex: A,
+ value: F,
+ rightclick: m,
+ originalEvent: P
+ })
+ }
+ f = true;
+ this._clickedrowindex = -1;
+ this._clickedcolumn = null;
+ if (P.isPropagationStopped && P.isPropagationStopped()) {
+ return false
+ }
+ }
+ }
+ }
+ if (m) {
+ return true
+ }
+ if (!f) {
+ this._clickedrowindex = this.getboundindex(p);
+ this._clickedcolumn = D.datafield
+ }
+ var e = b.jqx.utilities.getBrowser();
+ if (e.browser == "msie" && parseInt(e.version) <= 7) {
+ if (A == 0 && this.rowdetails) {
+ q = "jqx-grid-group-collapse"
+ }
+ if (v > 0) {
+ if (A <= v) {
+ q = "jqx-grid-group-collapse"
+ }
+ }
+ }
+ if (q.indexOf("jqx-grid-group-expand") != -1 || q.indexOf("jqx-grid-group-collapse") != -1) {
+ if (!this.rtl) {
+ if (v > 0 && A < v && this._togglegroupstate) {
+ this._togglegroupstate(p.bounddata, true)
+ } else {
+ if (A == v && this.rowdetails && this.showrowdetailscolumn) {
+ this._togglerowdetails(p.bounddata, true);
+ this.gridcontent[0].scrollTop = 0;
+ this.gridcontent[0].scrollLeft = 0
+ }
+ }
+ } else {
+ if (v > 0 && A > g.cells.length - v - 1 && this._togglegroupstate) {
+ this._togglegroupstate(p.bounddata, true)
+ } else {
+ if (A == g.cells.length - 1 - v && this.rowdetails && this.showrowdetailscolumn) {
+ this._togglerowdetails(p.bounddata, true);
+ this.gridcontent[0].scrollTop = 0;
+ this.gridcontent[0].scrollLeft = 0
+ }
+ }
+ }
+ } else {
+ if (p.boundindex != -1) {
+ var n = this.selectedrowindexes.slice(0);
+ var O = false;
+ if (l.selectionmode != "none" && l.selectionmode != "checkbox" && this._selectrowwithmouse) {
+ if (l.selectionmode == "multiplecellsadvanced" || l.selectionmode == "multiplecellsextended" || l.selectionmode == "multiplerowsextended" || l.selectionmode == "multiplerowsadvanced") {
+ if (!P.ctrlKey && !P.shiftKey && !P.metaKey) {
+ l.selectedrowindexes = new Array();
+ l.selectedcells = new Array()
+ }
+ }
+ var t = false;
+ var o = this.getboundindex(p);
+ if (l._oldselectedrow === o || l.selectionmode === "none") {
+ t = true
+ }
+ if (l.selectionmode.indexOf("cell") == -1) {
+ if ((l.selectionmode != "singlerow") || (l.selectedrowindex != o && l.selectionmode == "singlerow")) {
+ this._applyrowselection(o, true, false, null, D.datafield);
+ this._selectrowwithmouse(l, M, n, D.datafield, P.ctrlKey || P.metaKey, P.shiftKey)
+ }
+ } else {
+ if (D.datafield != null) {
+ this._selectrowwithmouse(l, M, n, D.datafield, P.ctrlKey || P.metaKey, P.shiftKey);
+ if (!P.shiftKey) {
+ this._applycellselection(o, D.datafield, true, false)
+ }
+ }
+ }
+ if (l._oldselectedcell) {
+ if (l._oldselectedcell.datafield == l.selectedcell.datafield && l._oldselectedcell.rowindex == l.selectedcell.rowindex) {
+ O = true
+ }
+ }
+ l._oldselectedcell = l.selectedcell;
+ l._oldselectedrow = o
+ }
+ if (l.autosavestate) {
+ if (l.savestate) {
+ l.savestate()
+ }
+ }
+ if (l.editable && l.begincelledit && l.editmode != "programmatic") {
+ if (P.isPropagationStopped && P.isPropagationStopped()) {
+ return false
+ }
+ if (l.editmode == "selectedrow") {
+ if (t && !l.editcell) {
+ if (D.columntype !== "checkbox") {
+ var r = l.beginrowedit(this.getboundindex(p))
+ }
+ } else {
+ if (l.editcell && !t && l.selectionmode != "none") {
+ var r = l.endrowedit(l.editcell.row)
+ }
+ }
+ } else {
+ var G = l.editmode == "click" || (O && l.editmode == "selectedcell");
+ if (l.selectionmode.indexOf("cell") == -1) {
+ if (l.editmode != "dblclick") {
+ G = true
+ }
+ }
+ if (G) {
+ if (p.boundindex != undefined && D.editable) {
+ var r = l.begincelledit(this.getboundindex(p), D.datafield, D.defaulteditorvalue);
+ if (l.selectionmode.indexOf("cell") != -1) {
+ l._applycellselection(o, D.datafield, false, false)
+ }
+ }
+ }
+ if (l.selectionmode.indexOf("cell") != -1) {
+ if (l.editmode == "selectedcell" && !O && l.editcell) {
+ l.endcelledit(l.editcell.row, l.editcell.column, false, true)
+ }
+ }
+ }
+ return true
+ }
+ }
+ }
+ }
+ return true
+ },
+ _columnPropertyChanged: function(e, d, g, f) {},
+ _rowPropertyChanged: function(g, d, f, e) {},
+ _serializeObject: function(d) {
+ if (d == null) {
+ return ""
+ }
+ var e = "";
+ b.each(d,
+ function(g) {
+ var h = this;
+ if (g > 0) {
+ e += ", "
+ }
+ e += "[";
+ var f = 0;
+ for (obj in h) {
+ if (f > 0) {
+ e += ", "
+ }
+ e += "{" + obj + ":" + h[obj] + "}";
+ f++
+ }
+ e += "]"
+ });
+ return e
+ },
+ isbindingcompleted: function() {
+ return ! this._loading
+ },
+ propertyChangedHandler: function(e, f, i, h) {
+ if (this.isInitialized == undefined || this.isInitialized == false) {
+ return
+ }
+ f = f.toLowerCase();
+ switch (f) {
+ case "editable":
+ e.refresh();
+ break;
+ case "everpresentrowactionsmode":
+ if (i != h) {
+ e._removeaddnewrow();
+ e.render()
+ }
+ break;
+ case "everpresentrowactions":
+ e._updateaddnewrowui();
+ break;
+ case "showeverpresentrow":
+ case "everpresentrowposition":
+ case "everpresentrowheight":
+ if (i != h) {
+ e._removeaddnewrow();
+ e.render()
+ }
+ break;
+ case "rtl":
+ e.content.css("left", "");
+ e.columns = e._columns;
+ e._filterrowcache = [];
+ e.vScrollBar.jqxScrollBar({
+ rtl: h
+ });
+ e.hScrollBar.jqxScrollBar({
+ rtl: h
+ });
+ if (e._initpager) {
+ e._initpager()
+ }
+ if (e._initgroupsheader) {
+ e._initgroupsheader()
+ }
+ e.render();
+ break;
+ case "enablebrowserselection":
+ if (!e.showfilterrow) {
+ if (!e.showstatusbar && !e.showtoolbar) {
+ e.host.addClass("jqx-disableselect")
+ }
+ e.content.addClass("jqx-disableselect")
+ }
+ if (e.enablebrowserselection) {
+ e.content.removeClass("jqx-disableselect");
+ e.host.removeClass("jqx-disableselect")
+ }
+ break;
+ case "columnsheight":
+ if (e.columnsheight != 25 || e.columngroups) {
+ e._measureElement("column")
+ }
+ e._render(true, true, true, false, false);
+ break;
+ case "rowsheight":
+ if (h != i) {
+ if (e.rowsheight != 25) {
+ e._measureElement("cell")
+ }
+ e.virtualsizeinfo = null;
+ e.rendergridcontent(true, false);
+ e.refresh()
+ }
+ break;
+ case "scrollMode":
+ e.vScrollInstance.thumbStep = e.rowsheight;
+ break;
+ case "showdefaultloadelement":
+ e._builddataloadelement();
+ break;
+ case "showfiltermenuitems":
+ case "showsortmenuitems":
+ case "showgroupmenuitems":
+ case "filtermode":
+ e._initmenu();
+ break;
+ case "touchmode":
+ if (i != h) {
+ e._removeHandlers();
+ e.touchDevice = null;
+ e.vScrollBar.jqxScrollBar({
+ touchMode: h
+ });
+ e.hScrollBar.jqxScrollBar({
+ touchMode: h
+ });
+ e._updateTouchScrolling();
+ e._arrange();
+ e._updatecolumnwidths();
+ e._updatecellwidths();
+ e._addHandlers()
+ }
+ break;
+ case "autoshowcolumnsmenubutton":
+ if (i != h) {
+ e._rendercolumnheaders()
+ }
+ break;
+ case "rendergridrows":
+ if (i != h) {
+ e.updatebounddata()
+ }
+ break;
+ case "editmode":
+ if (i != h) {
+ e._removeHandlers();
+ e._addHandlers()
+ }
+ break;
+ case "source":
+ e.updatebounddata();
+ if (e.virtualmode && !e._loading) {
+ e.loadondemand = true;
+ e._renderrows(e.virtualsizeinfo)
+ }
+ break;
+ case "horizontalscrollbarstep":
+ case "verticalscrollbarstep":
+ case "horizontalscrollbarlargestep":
+ case "verticalscrollbarlargestep":
+ this.vScrollBar.jqxScrollBar({
+ step:
+ this.verticalscrollbarstep,
+ largestep: this.verticalscrollbarlargestep
+ });
+ this.hScrollBar.jqxScrollBar({
+ step: this.horizontalscrollbarstep,
+ largestep: this.horizontalscrollbarlargestep
+ });
+ break;
+ case "closeablegroups":
+ if (e._initgroupsheader) {
+ e._initgroupsheader()
+ }
+ break;
+ case "showgroupsheader":
+ if (i != h) {
+ e._arrange();
+ if (e._initgroupsheader) {
+ e._initgroupsheader()
+ }
+ e._renderrows(e.virtualsizeinfo)
+ }
+ break;
+ case "theme":
+ if (h != i) {
+ b.jqx.utilities.setTheme(i, h, e.host);
+ if (e.gridmenu) {
+ e.gridmenu.jqxMenu({
+ theme: h
+ })
+ }
+ if (e.pageable) {
+ e._updatepagertheme()
+ }
+ if (e.filterable) {
+ e._updatefilterrowui(true)
+ }
+ if (e.showeverpresentrow) {
+ e._updateaddnewrowui(true)
+ }
+ }
+ break;
+ case "showtoolbar":
+ case "toolbarheight":
+ if (i != h) {
+ e._arrange();
+ e.refresh()
+ }
+ break;
+ case "showstatusbar":
+ if (i != h) {
+ if (e.statusbar) {
+ if (h) {
+ e.statusbar.show()
+ } else {
+ e.statusbar.hide()
+ }
+ }
+ e._arrange();
+ e.refresh()
+ }
+ break;
+ case "statusbarheight":
+ if (i != h) {
+ e._arrange();
+ e.refresh()
+ }
+ break;
+ case "filterable":
+ case "showfilterrow":
+ if (i != h) {
+ e.render()
+ }
+ break;
+ case "autoshowfiltericon":
+ case "showfiltercolumnbackground":
+ case "showpinnedcolumnbackground":
+ case "showsortcolumnbackground":
+ if (i != h) {
+ e.rendergridcontent()
+ }
+ break;
+ case "showrowdetailscolumn":
+ if (i != h) {
+ e.render()
+ }
+ break;
+ case "scrollbarsize":
+ if (i != h) {
+ e._arrange()
+ }
+ break;
+ case "width":
+ case "height":
+ if (i != h) {
+ e._updatesize(true, true);
+ e._resizeWindow();
+ if (e.virtualmode && !e._loading) {
+ e.vScrollInstance.setPosition(0)
+ } else {
+ setTimeout(function() {
+ e._renderrows(e.virtualsizeinfo)
+ },
+ 100)
+ }
+ }
+ break;
+ case "altrows":
+ case "altstart":
+ case "altstep":
+ if (i != h) {
+ e._renderrows(e.virtualsizeinfo)
+ }
+ break;
+ case "groupsheaderheight":
+ if (i != h) {
+ e._arrange();
+ if (e._initgroupsheader) {
+ e._initgroupsheader()
+ }
+ }
+ break;
+ case "pagerheight":
+ if (i != h) {
+ e._initpager()
+ }
+ break;
+ case "selectedrowindex":
+ e.selectrow(h);
+ break;
+ case "selectionmode":
+ if (i != h) {
+ if (h == "none") {
+ e.selectedrowindexes = new Array();
+ e.selectedcells = new Array();
+ e.selectedrowindex = -1
+ }
+ e._renderrows(e.virtualsizeinfo);
+ if (h == "checkbox") {
+ e._render(false, false, true, false, false)
+ }
+ }
+ break;
+ case "showheader":
+ if (h) {
+ e.columnsheader.css("display", "block")
+ } else {
+ e.columnsheader.css("display", "none")
+ }
+ break;
+ case "virtualmode":
+ if (i != h) {
+ e.dataview.virtualmode = e.virtualmode;
+ e.dataview.refresh(false);
+ e._render(false, false, false)
+ }
+ break;
+ case "columnsmenu":
+ if (i != h) {
+ e.render()
+ }
+ break;
+ case "columngroups":
+ e._render(true, true, true, false, false);
+ break;
+ case "columns":
+ if (e._serializeObject(e._cachedcolumns) !== e._serializeObject(h)) {
+ var d = false;
+ if (e.filterable) {
+ if (i && i.records) {
+ b.each(i.records,
+ function() {
+ if (this.filter) {
+ d = true
+ }
+ e.dataview.removefilter(this.displayfield, this.filter)
+ })
+ }
+ }
+ e._columns = null;
+ e._filterrowcache = [];
+ e.render();
+ if (d) {
+ e.applyfilters()
+ }
+ e._cachedcolumns = e.columns;
+ if (e.removesort) {
+ e.removesort()
+ }
+ } else {
+ e[f] = i
+ }
+ break;
+ case "autoheight":
+ if (i != h) {
+ e._render(false, false, true)
+ }
+ break;
+ case "pagermode":
+ case "pagerbuttonscount":
+ if (i != h) {
+ if (e._initpager) {
+ if (e.pagershowrowscombo) {
+ e.pagershowrowscombo.jqxDropDownList("destroy");
+ e.pagershowrowscombo = null
+ }
+ if (e.pagerrightbutton) {
+ e.removeHandler(e.pagerrightbutton, "mousedown");
+ e.removeHandler(e.pagerrightbutton, "mouseup");
+ e.removeHandler(e.pagerrightbutton, "click");
+ e.pagerrightbutton.jqxButton("destroy");
+ e.pagerrightbutton = null
+ }
+ if (e.pagerleftbutton) {
+ e.removeHandler(e.pagerleftbutton, "mousedown");
+ e.removeHandler(e.pagerleftbutton, "mouseup");
+ e.removeHandler(e.pagerleftbutton, "click");
+ e.pagerleftbutton.jqxButton("destroy");
+ e.removeHandler(b(document), "mouseup.pagerbuttons" + e.element.id);
+ e.pagerleftbutton = null
+ }
+ e.pagerdiv.remove();
+ e._initpager()
+ }
+ }
+ break;
+ case "pagesizeoptions":
+ case "pageable":
+ case "pagesize":
+ if (i != h) {
+ if (e._loading) {
+ throw new Error("jqxGrid: " + e.loadingerrormessage);
+ return
+ }
+ if (!e.host.jqxDropDownList || !e.host.jqxListBox) {
+ e._testmodules();
+ return
+ }
+ if (e._initpager) {
+ if (f != "pageable" && f != "pagermode") {
+ if (typeof(h) == "string") {
+ var g = "The expected value type is: Int.";
+ if (f != "pagesize") {
+ var g = "The expected value type is: Array of Int values."
+ }
+ throw new Error("Invalid Value for: " + f + ". " + g)
+ }
+ }
+ e.dataview.pageable = e.pageable;
+ e.dataview.pagenum = 0;
+ e.dataview.pagesize = e._getpagesize();
+ if (e.virtualmode) {
+ e.updatebounddata()
+ }
+ e.dataview.refresh(true);
+ e._initpager();
+ if (f == "pagesizeoptions") {
+ if (h != null && h.length > 0) {
+ e.pagesize = parseInt(h[0]);
+ e.dataview.pagesize = parseInt(h[0]);
+ e.prerenderrequired = true;
+ e._requiresupdate = true;
+ e.dataview.pagenum = -1;
+ e.gotopage(0)
+ }
+ }
+ }
+ e._render(false, false, false)
+ }
+ break;
+ case "groups":
+ if (e._serializeObject(i) !== e._serializeObject(h)) {
+ e.dataview.groups = h;
+ e._refreshdataview();
+ e._render(true, true, true, false)
+ }
+ break;
+ case "groupable":
+ if (i != h) {
+ e.dataview.groupable = e.groupable;
+ e.dataview.pagenum = 0;
+ e.dataview.refresh(false);
+ e._render(false, false, true)
+ }
+ break;
+ case "renderstatusbar":
+ if (h != null) {
+ e.renderstatusbar(e.statusbar)
+ }
+ break;
+ case "rendertoolbar":
+ if (h != null) {
+ e.rendertoolbar(e.toolbar)
+ }
+ break;
+ case "disabled":
+ if (h) {
+ e.host.addClass(e.toThemeProperty("jqx-fill-state-disabled"))
+ } else {
+ e.host.removeClass(e.toThemeProperty("jqx-fill-state-disabled"))
+ }
+ b.jqx.aria(e, "aria-disabled", e.disabled);
+ if (e.pageable) {
+ if (e.pagerrightbutton) {
+ e.pagerrightbutton.jqxButton({
+ disabled: h
+ });
+ e.pagerleftbutton.jqxButton({
+ disabled: h
+ });
+ e.pagershowrowscombo.jqxDropDownList({
+ disabled: h
+ });
+ e.pagergotoinput.attr("disabled", h)
+ }
+ if (e.pagerfirstbutton) {
+ e.pagerfirstbutton.jqxButton({
+ disabled: h
+ });
+ e.pagerlastbutton.jqxButton({
+ disabled: h
+ })
+ }
+ }
+ e.vScrollBar.jqxScrollBar({
+ disabled: h
+ });
+ e.hScrollBar.jqxScrollBar({
+ disabled: h
+ });
+ if (e.filterable && e.showfilterrow) {
+ e._updatefilterrowui(true)
+ }
+ if (e.showeverpresentrow) {
+ e._updateaddnewrowui(true)
+ }
+ break
+ }
+ }
+ });
+ function c(d, e) {
+ this.owner = d;
+ this.datafield = null;
+ this.displayfield = null;
+ this.text = "";
+ this.createfilterpanel = null;
+ this.sortable = true;
+ this.hideable = true;
+ this.editable = true;
+ this.hidden = false;
+ this.groupable = true;
+ this.renderer = null;
+ this.cellsrenderer = null;
+ this.checkchange = null,
+ this.threestatecheckbox = false;
+ this.buttonclick = null,
+ this.columntype = null;
+ this.cellsformat = "";
+ this.align = "left";
+ this.cellsalign = "left";
+ this.width = "auto";
+ this.minwidth = 25;
+ this.maxwidth = "auto";
+ this.pinned = false;
+ this.visibleindex = -1;
+ this.filterable = true;
+ this.filter = null;
+ this.filteritems = [];
+ this.resizable = true;
+ this.initeditor = null;
+ this.createeditor = null;
+ this.destroyeditor = null;
+ this.geteditorvalue = null;
+ this.validation = null;
+ this.classname = "";
+ this.cellclassname = "";
+ this.cellendedit = null;
+ this.cellbeginedit = null;
+ this.cellvaluechanging = null;
+ this.aggregates = null;
+ this.aggregatesrenderer = null;
+ this.menu = true;
+ this.createfilterwidget = null;
+ this.filtertype = "default";
+ this.filtercondition = null;
+ this.rendered = null;
+ this.exportable = true;
+ this.exporting = false;
+ this.draggable = true;
+ this.nullable = true;
+ this.clipboard = true;
+ this.enabletooltips = true;
+ this.columngroup = null;
+ this.filterdelay = 800;
+ this.reseteverpresentrowwidgetvalue = null;
+ this.geteverpresentrowwidgetvalue = null;
+ this.createeverpresentrowwidget = null;
+ this.initeverpresentrowwidget = null;
+ this.validateeverpresentrowwidgetvalue = null;
+ this.destroyeverpresentrowwidget = null;
+ this.getcolumnproperties = function() {
+ return {
+ nullable: this.nullable,
+ sortable: this.sortable,
+ hideable: this.hideable,
+ hidden: this.hidden,
+ groupable: this.groupable,
+ width: this.width,
+ align: this.align,
+ editable: this.editable,
+ minwidth: this.minwidth,
+ maxwidth: this.maxwidth,
+ resizable: this.resizable,
+ datafield: this.datafield,
+ text: this.text,
+ exportable: this.exportable,
+ cellsalign: this.cellsalign,
+ pinned: this.pinned,
+ cellsformat: this.cellsformat,
+ columntype: this.columntype,
+ classname: this.classname,
+ cellclassname: this.cellclassname,
+ menu: this.menu
+ }
+ },
+ this.setproperty = function(f, g) {
+ if (this[f]) {
+ var h = this[f];
+ this[f] = g;
+ this.owner._columnPropertyChanged(this, f, g, h)
+ } else {
+ if (this[f.toLowerCase()]) {
+ var h = this[f.toLowerCase()];
+ this[f.toLowerCase()] = g;
+ this.owner._columnPropertyChanged(this, f.toLowerCase(), g, h)
+ }
+ }
+ };
+ this._initfields = function(g) {
+ if (g != null) {
+ var f = this.that;
+ if (b.jqx.hasProperty(g, "dataField")) {
+ this.datafield = b.jqx.get(g, "dataField")
+ }
+ if (b.jqx.hasProperty(g, "displayField")) {
+ this.displayfield = b.jqx.get(g, "displayField")
+ } else {
+ this.displayfield = this.datafield
+ }
+ if (b.jqx.hasProperty(g, "enableTooltips")) {
+ this.enabletooltips = b.jqx.get(g, "enableTooltips")
+ }
+ if (b.jqx.hasProperty(g, "text")) {
+ this.text = b.jqx.get(g, "text")
+ } else {
+ this.text = this.displayfield
+ }
+ if (b.jqx.hasProperty(g, "createfilterpanel")) {
+ this.createfilterpanel = b.jqx.get(g, "createfilterpanel")
+ }
+ if (b.jqx.hasProperty(g, "sortable")) {
+ this.sortable = b.jqx.get(g, "sortable")
+ }
+ if (b.jqx.hasProperty(g, "hideable")) {
+ this.hideable = b.jqx.get(g, "hideable")
+ }
+ if (b.jqx.hasProperty(g, "hidden")) {
+ this.hidden = b.jqx.get(g, "hidden")
+ }
+ if (b.jqx.hasProperty(g, "groupable")) {
+ this.groupable = b.jqx.get(g, "groupable")
+ }
+ if (b.jqx.hasProperty(g, "renderer")) {
+ this.renderer = b.jqx.get(g, "renderer")
+ }
+ if (b.jqx.hasProperty(g, "align")) {
+ this.align = b.jqx.get(g, "align")
+ }
+ if (b.jqx.hasProperty(g, "cellsAlign")) {
+ this.cellsalign = b.jqx.get(g, "cellsAlign")
+ }
+ if (b.jqx.hasProperty(g, "clipboard")) {
+ this.cellsalign = b.jqx.get(g, "clipboard")
+ }
+ if (b.jqx.hasProperty(g, "cellsFormat")) {
+ this.cellsformat = b.jqx.get(g, "cellsFormat")
+ }
+ if (b.jqx.hasProperty(g, "width")) {
+ this.width = b.jqx.get(g, "width")
+ }
+ if (b.jqx.hasProperty(g, "minWidth")) {
+ this.minwidth = parseInt(b.jqx.get(g, "minWidth"));
+ if (isNaN(this.minwidth)) {
+ this.minwidth = 25
+ }
+ }
+ if (b.jqx.hasProperty(g, "maxWidth")) {
+ this.maxwidth = parseInt(b.jqx.get(g, "maxWidth"));
+ if (isNaN(this.maxwidth)) {
+ this.maxwidth = "auto"
+ }
+ }
+ if (b.jqx.hasProperty(g, "cellsRenderer")) {
+ this.cellsrenderer = b.jqx.get(g, "cellsRenderer")
+ } else {
+ if (g.cellsRenderer) {
+ this.cellsrenderer = g.cellsRenderer
+ }
+ }
+ if (b.jqx.hasProperty(g, "columnType")) {
+ this.columntype = b.jqx.get(g, "columnType")
+ }
+ if (b.jqx.hasProperty(g, "checkChange")) {
+ this.checkchange = b.jqx.get(g, "checkChange")
+ }
+ if (b.jqx.hasProperty(g, "buttonClick")) {
+ this.buttonclick = b.jqx.get(g, "buttonClick")
+ } else {
+ if (g.buttonClick) {
+ this.buttonclick = g.buttonClick
+ }
+ }
+ if (b.jqx.hasProperty(g, "pinned")) {
+ this.pinned = b.jqx.get(g, "pinned")
+ }
+ if (b.jqx.hasProperty(g, "visibleIndex")) {
+ this.visibleindex = b.jqx.get(g, "visibleIndex")
+ }
+ if (b.jqx.hasProperty(g, "filterable")) {
+ this.filterable = b.jqx.get(g, "filterable")
+ }
+ if (b.jqx.hasProperty(g, "filter")) {
+ this.filter = b.jqx.get(g, "filter")
+ }
+ if (b.jqx.hasProperty(g, "resizable")) {
+ this.resizable = b.jqx.get(g, "resizable")
+ }
+ if (b.jqx.hasProperty(g, "editable")) {
+ this.editable = b.jqx.get(g, "editable")
+ }
+ if (b.jqx.hasProperty(g, "initEditor")) {
+ this.initeditor = b.jqx.get(g, "initEditor")
+ } else {
+ if (g.initEditor) {
+ this.initeditor = g.initEditor
+ }
+ }
+ if (b.jqx.hasProperty(g, "createEditor")) {
+ this.createeditor = b.jqx.get(g, "createEditor")
+ } else {
+ if (g.createEditor) {
+ this.createeditor = g.createEditor
+ }
+ }
+ if (b.jqx.hasProperty(g, "reseteverpresentrowwidgetvalue") || b.jqx.hasFunction(g, "reseteverpresentrowwidgetvalue")) {
+ this.reseteverpresentrowwidgetvalue = b.jqx.get(g, "reseteverpresentrowwidgetvalue")
+ } else {
+ if (g.resetEverPresentRowWidgetValue) {
+ this.reseteverpresentrowwidgetvalue = g.resetEverPresentRowWidgetValue
+ }
+ }
+ if (b.jqx.hasProperty(g, "geteverpresentrowwidgetvalue") || b.jqx.hasFunction(g, "geteverpresentrowwidgetvalue")) {
+ this.geteverpresentrowwidgetvalue = b.jqx.get(g, "geteverpresentrowwidgetvalue")
+ } else {
+ if (g.getEverPresentRowWidgetValue) {
+ this.geteverpresentrowwidgetvalue = g.getEverPresentRowWidgetValue
+ }
+ }
+ if (b.jqx.hasProperty(g, "createeverpresentrowwidget") || b.jqx.hasFunction(g, "createeverpresentrowwidget")) {
+ this.createeverpresentrowwidget = b.jqx.get(g, "createeverpresentrowwidget")
+ } else {
+ if (g.createEverPresentRowWidget) {
+ this.createeverpresentrowwidget = g.createEverPresentRowWidget
+ }
+ }
+ if (b.jqx.hasProperty(g, "initeverpresentrowwidget") || b.jqx.hasFunction(g, "initeverpresentrowwidget")) {
+ this.initeverpresentrowwidget = b.jqx.get(g, "initeverpresentrowwidget")
+ } else {
+ if (g.initEverPresentRowWidget) {
+ this.initeverpresentrowwidget = g.initEverPresentRowWidget
+ }
+ }
+ if (b.jqx.hasProperty(g, "validateeverpresentrowwidgetvalue")) {
+ this.validateeverpresentrowwidgetvalue = b.jqx.get(g, "validateeverpresentrowwidgetvalue")
+ } else {
+ if (g.validateEverPresentRowWidgetValue) {
+ this.validateeverpresentrowwidgetvalue = g.validateEverPresentRowWidgetValue
+ }
+ }
+ if (b.jqx.hasProperty(g, "destroyeverpresentrowwidget") || b.jqx.hasFunction(g, "destroyeverpresentrowwidget")) {
+ this.destroyeverpresentrowwidget = b.jqx.get(g, "destroyeverpresentrowwidget")
+ } else {
+ if (g.destroyEverPresentRowWidget) {
+ this.destroyEverPresentRowWidget = g.destroyEverPresentRowWidget
+ }
+ }
+ if (b.jqx.hasProperty(g, "destroyEditor")) {
+ this.destroyeditor = b.jqx.get(g, "destroyEditor")
+ } else {
+ if (g.destroyEditor) {
+ this.destroyeditor = g.destroyEditor
+ }
+ }
+ if (b.jqx.hasProperty(g, "getEditorValue")) {
+ this.geteditorvalue = b.jqx.get(g, "getEditorValue")
+ } else {
+ if (g.getEditorValue) {
+ this.geteditorvalue = g.getEditorValue
+ }
+ }
+ if (b.jqx.hasProperty(g, "validation")) {
+ this.validation = b.jqx.get(g, "validation")
+ } else {
+ if (g.validation) {
+ this.validation = g.validation
+ }
+ }
+ if (b.jqx.hasProperty(g, "cellBeginEdit")) {
+ this.cellbeginedit = b.jqx.get(g, "cellBeginEdit")
+ } else {
+ if (g.cellBeginEdit) {
+ this.cellbeginedit = g.cellBeginEdit
+ }
+ }
+ if (b.jqx.hasProperty(g, "cellEndEdit")) {
+ this.cellendedit = b.jqx.get(g, "cellEndEdit")
+ } else {
+ if (g.cellEndEdit) {
+ this.cellendedit = g.cellEndEdit
+ }
+ }
+ if (b.jqx.hasProperty(g, "className")) {
+ this.classname = b.jqx.get(g, "className")
+ }
+ if (b.jqx.hasProperty(g, "cellClassName")) {
+ this.cellclassname = b.jqx.get(g, "cellClassName")
+ } else {
+ if (g.cellClassName) {
+ this.cellclassname = g.cellClassName
+ }
+ }
+ if (b.jqx.hasProperty(g, "menu")) {
+ this.menu = b.jqx.get(g, "menu")
+ }
+ if (b.jqx.hasProperty(g, "aggregates")) {
+ this.aggregates = b.jqx.get(g, "aggregates")
+ }
+ if (b.jqx.hasProperty(g, "aggregatesRenderer")) {
+ this.aggregatesrenderer = b.jqx.get(g, "aggregatesRenderer")
+ }
+ if (b.jqx.hasProperty(g, "createFilterWidget")) {
+ this.createfilterwidget = b.jqx.get(g, "createFilterWidget")
+ }
+ if (b.jqx.hasProperty(g, "filterType")) {
+ this.filtertype = b.jqx.get(g, "filterType")
+ }
+ if (b.jqx.hasProperty(g, "filterDelay")) {
+ this.filterdelay = b.jqx.get(g, "filterDelay")
+ }
+ if (b.jqx.hasProperty(g, "rendered")) {
+ this.rendered = b.jqx.get(g, "rendered")
+ }
+ if (b.jqx.hasProperty(g, "exportable")) {
+ this.exportable = b.jqx.get(g, "exportable")
+ }
+ if (b.jqx.hasProperty(g, "filterItems")) {
+ this.filteritems = b.jqx.get(g, "filterItems")
+ }
+ if (b.jqx.hasProperty(g, "cellValueChanging")) {
+ this.cellvaluechanging = b.jqx.get(g, "cellValueChanging")
+ }
+ if (b.jqx.hasProperty(g, "draggable")) {
+ this.draggable = b.jqx.get(g, "draggable")
+ }
+ if (b.jqx.hasProperty(g, "filterCondition")) {
+ this.filtercondition = b.jqx.get(g, "filterCondition")
+ }
+ if (b.jqx.hasProperty(g, "threeStateCheckbox")) {
+ this.threestatecheckbox = b.jqx.get(g, "threeStateCheckbox")
+ }
+ if (b.jqx.hasProperty(g, "nullable")) {
+ this.nullable = b.jqx.get(g, "nullable")
+ }
+ if (b.jqx.hasProperty(g, "columnGroup")) {
+ this.columngroup = b.jqx.get(g, "columnGroup")
+ }
+ if (!g instanceof String && !(typeof g == "string")) {
+ for (var h in g) {
+ if (!f.hasOwnProperty(h)) {
+ if (!f.hasOwnProperty(h.toLowerCase())) {
+ d.host.remove();
+ throw new Error("jqxGrid: Invalid property name - " + h + ".")
+ }
+ }
+ }
+ }
+ }
+ };
+ this._initfields(e);
+ return this
+ }
+ function a(d, e) {
+ this.setdata = function(f) {
+ if (f != null) {
+ this.bounddata = f;
+ this.boundindex = f.boundindex;
+ this.visibleindex = f.visibleindex;
+ this.group = f.group;
+ this.parentbounddata = f.parentItem;
+ this.uniqueid = f.uniqueid;
+ this.level = f.level
+ }
+ };
+ this.setdata(e);
+ this.parentrow = null;
+ this.subrows = new Array();
+ this.owner = d;
+ this.height = 25;
+ this.hidden = false;
+ this.rowdetails = null;
+ this.rowdetailsheight = 100;
+ this.rowdetailshidden = true;
+ this.top = -1;
+ this.setrowinfo = function(f) {
+ this.hidden = f.hidden;
+ this.rowdetails = f.rowdetails;
+ this.rowdetailsheight = f.rowdetailsheight;
+ this.rowdetailshidden = !f.showdetails;
+ this.height = f.height
+ };
+ return this
+ }
+ b.jqx.collection = function(d) {
+ this.records = new Array();
+ this.owner = d;
+ this.updating = false;
+ this.beginupdate = function() {
+ this.updating = true
+ };
+ this.resumeupdate = function() {
+ this.updating = false
+ };
+ this._raiseEvent = function(e) {};
+ this.clear = function() {
+ this.records = new Array()
+ };
+ this.replace = function(f, e) {
+ this.records[f] = e;
+ if (!this.updating) {
+ this._raiseEvent({
+ type: "replace",
+ element: e
+ })
+ }
+ };
+ this.isempty = function(e) {
+ if (this.records[e] == undefined) {
+ return true
+ }
+ return false
+ };
+ this.initialize = function(e) {
+ if (e < 1) {
+ e = 1
+ }
+ this.records[e - 1] = -1
+ };
+ this.length = function() {
+ return this.records.length
+ };
+ this.indexOf = function(e) {
+ return this.records.indexOf(e)
+ };
+ this.add = function(e) {
+ if (e == null) {
+ return false
+ }
+ this.records[this.records.length] = e;
+ if (!this.updating) {
+ this._raiseEvent({
+ type: "add",
+ element: e
+ })
+ }
+ return true
+ };
+ this.insertAt = function(f, e) {
+ if (f == null || f == undefined) {
+ return false
+ }
+ if (e == null) {
+ return false
+ }
+ if (f >= 0) {
+ if (f < this.records.length) {
+ this.records.splice(f, 0, e);
+ if (!this.updating) {
+ this._raiseEvent({
+ type: "insert",
+ index: f,
+ element: e
+ })
+ }
+ return true
+ } else {
+ return this.add(e)
+ }
+ }
+ return false
+ };
+ this.remove = function(f) {
+ if (f == null || f == undefined) {
+ return false
+ }
+ var e = this.records.indexOf(f);
+ if (e != -1) {
+ this.records.splice(e, 1);
+ if (!this.updating) {
+ this._raiseEvent({
+ type: "remove",
+ element: f
+ })
+ }
+ return true
+ }
+ return false
+ };
+ this.removeAt = function(f) {
+ if (f == null || f == undefined) {
+ return false
+ }
+ if (f < 0) {
+ return false
+ }
+ if (f < this.records.length) {
+ var e = this.records[f];
+ this.records.splice(f, 1);
+ if (!this.updating) {
+ this._raiseEvent({
+ type: "removeAt",
+ index: f,
+ element: e
+ })
+ }
+ return true
+ }
+ return false
+ };
+ return this
+ };
+ b.jqx.dataview = function() {
+ this.self = this;
+ this.grid = null;
+ this.uniqueId = "id";
+ this.records = [];
+ this.rows = [];
+ this.columns = [];
+ this.groups = [];
+ this.filters = new Array();
+ this.updated = null;
+ this.update = null;
+ this.suspend = false;
+ this.pagesize = 0;
+ this.pagenum = 0;
+ this.totalrows = 0;
+ this.totalrecords = 0;
+ this.groupable = true;
+ this.loadedrecords = [];
+ this.loadedrootgroups = [];
+ this.loadedgroups = [];
+ this.loadedgroupsByKey = [];
+ this.virtualmode = true;
+ this._cachegrouppages = new Array();
+ this.source = null;
+ this.changedrecords = new Array();
+ this.rowschangecallback = null;
+ this.that = this;
+ this.destroy = function() {
+ delete this.self;
+ delete this.grid;
+ delete this.uniqueId;
+ delete this.records;
+ delete this.rows;
+ delete this.columns;
+ delete this.groups;
+ delete this.filters;
+ delete this.updated;
+ delete this.update;
+ delete this.suspend;
+ delete this.pagesize;
+ delete this.pagenum;
+ delete this.totalrows;
+ delete this.totalrecords;
+ delete this.groupable;
+ delete this.loadedrecords;
+ delete this.loadedrootgroups;
+ delete this.loadedgroups;
+ delete this.loadedgroupsByKey;
+ delete this.virtualmode;
+ delete this._cachegrouppages;
+ delete this.source;
+ delete this.changedrecords;
+ delete this.rowschangecallback;
+ delete this.that
+ },
+ this.suspendupdate = function() {
+ this.suspend = true
+ },
+ this.isupdating = function() {
+ return this.suspend
+ },
+ this.resumeupdate = function(d) {
+ this.suspend = false;
+ if (d == undefined) {
+ d = true
+ }
+ this.refresh(d)
+ },
+ this.getrecords = function() {
+ return this.records
+ },
+ this.clearrecords = function() {
+ this.recordids = new Array()
+ };
+ this.databind = function(q, l) {
+ var p = q._source ? true: false;
+ var g = null;
+ if (p) {
+ g = q;
+ q = q._source
+ } else {
+ g = new b.jqx.dataAdapter(q, {
+ autoBind: false
+ })
+ }
+ var e = function(m) {
+ g.recordids = [];
+ g.records = new Array();
+ g.cachedrecords = new Array();
+ g.originaldata = new Array();
+ g._options.virtualmode = m.virtualmode;
+ g._options.totalrecords = m.totalrecords;
+ g._options.originaldata = m.originaldata;
+ g._options.recordids = m.recordids;
+ g._options.cachedrecords = new Array();
+ g._options.pagenum = m.pagenum;
+ g._options.pageable = m.pageable;
+ if (q.type != undefined) {
+ g._options.type = q.type
+ }
+ if (q.formatdata != undefined) {
+ g._options.formatData = q.formatdata
+ }
+ if (q.contenttype != undefined) {
+ g._options.contentType = q.contenttype
+ }
+ if (q.async != undefined) {
+ g._options.async = q.async
+ }
+ if (q.updaterow != undefined) {
+ g._options.updaterow = q.updaterow
+ }
+ if (q.addrow != undefined) {
+ g._options.addrow = q.addrow
+ }
+ if (q.deleterow != undefined) {
+ g._options.deleterow = q.deleterow
+ }
+ if (m.pagesize == 0) {
+ m.pagesize = 10
+ }
+ g._options.pagesize = m.pagesize
+ };
+ var t = function(C) {
+ C.totalrecords = g.totalrecords;
+ if (!C.virtualmode) {
+ C.originaldata = g.originaldata;
+ C.records = g.records;
+ C.recordids = g.recordids;
+ C.cachedrecords = g.cachedrecords
+ } else {
+ var x = {
+ startindex: C.pagenum * C.pagesize,
+ endindex: (C.pagenum * C.pagesize + C.pagesize)
+ };
+ if (q.recordstartindex != undefined) {
+ x.startindex = parseInt(q.recordstartindex)
+ }
+ if (q.recordendindex != undefined) {
+ x.endindex = parseInt(q.recordendindex)
+ } else {
+ if (!C.grid.pageable) {
+ x.endindex = x.startindex + 100;
+ if (C.grid.autoheight) {
+ x.endindex = x.startindex + C.totalrecords
+ }
+ }
+ }
+ if (!q.recordendindex) {
+ if (!C.grid.pageable) {
+ x.endindex = x.startindex + 100;
+ if (C.grid.autoheight) {
+ x.endindex = x.startindex + C.totalrecords
+ }
+ } else {
+ x = {
+ startindex: C.pagenum * C.pagesize,
+ endindex: (C.pagenum * C.pagesize + C.pagesize)
+ }
+ }
+ }
+ x.data = g.records;
+ if (C.grid.rendergridrows && C.totalrecords > 0) {
+ var E = 0;
+ q.records = C.grid.rendergridrows(x);
+ if (q.records.length) {
+ E = q.records.length
+ }
+ if (q.records && !q.records[x.startindex]) {
+ var m = new Array();
+ var D = x.startindex;
+ b.each(q.records,
+ function() {
+ m[D] = this;
+ D++;
+ E++
+ });
+ q.records = m
+ }
+ if (E == 0) {
+ if (q.records) {
+ b.each(q.records,
+ function() {
+ E++
+ })
+ }
+ }
+ if (E > 0 && E < x.endindex - x.startindex && !C.grid.groupable) {
+ var A = q.records[0];
+ for (var z = 0; z < x.endindex - x.startindex - E; z++) {
+ var B = {};
+ for (obj in A) {
+ B[obj] = ""
+ }
+ if (q.records.push) {
+ q.records.push(B)
+ }
+ }
+ }
+ }
+ if (!q.records || C.totalrecords == 0) {
+ q.records = new Array()
+ }
+ C.originaldata = q.records;
+ C.records = q.records;
+ C.cachedrecords = q.records
+ }
+ };
+ e(this);
+ this.source = q;
+ if (l !== undefined) {
+ uniqueId = l
+ }
+ var y = this.that;
+ switch (q.datatype) {
+ case "local":
+ case "array":
+ default:
+ if (q.localdata == null) {
+ q.localdata = []
+ }
+ if (q.localdata != null) {
+ g.unbindBindingUpdate(y.grid.element.id);
+ if ((!y.grid.autobind && y.grid.isInitialized) || y.grid.autobind) {
+ g.dataBind()
+ }
+ var k = function(x) {
+ if (x != undefined && x != "") {
+ var z = g._changedrecords[0];
+ if (z) {
+ var A = new Array();
+ b.each(g._changedrecords,
+ function(E) {
+ var B = this.index;
+ var C = this.record;
+ y.grid._updateFromAdapter = true;
+ switch (x) {
+ case "update":
+ var D = y.grid.getrowid(B);
+ if (E == g._changedrecords.length - 1) {
+ y.grid.updaterow(D, C)
+ } else {
+ y.grid.updaterow(D, C, false)
+ }
+ y.grid._updateFromAdapter = false;
+ return;
+ case "add":
+ y.grid.addrow(null, C);
+ y.grid._updateFromAdapter = false;
+ return;
+ case "remove":
+ var D = y.grid.getrowid(B);
+ A.push(D);
+ return
+ }
+ });
+ if (A.length > 0) {
+ y.grid.deleterow(A, false);
+ y.grid._updateFromAdapter = false
+ }
+ }
+ if (x == "update") {
+ return
+ }
+ }
+ var m = y.totalrecords;
+ t(y, x);
+ if (q.localdata.notifier === null && q.localdata.name == "observableArray") {
+ q.localdata.notifier = function(F) {
+ if (this._updating) {
+ return
+ }
+ this._updating = true;
+ var E = y.grid.getrowid(F.index);
+ switch (F.type) {
+ case "add":
+ var B = b.extend({},
+ F.object[F.index]);
+ var D = g.getid(q.id, B, F.index);
+ if (F.index === 0) {
+ y.grid.addrow(D, B, "first")
+ } else {
+ y.grid.addrow(D, B)
+ }
+ break;
+ case "delete":
+ y.grid.deleterow(E);
+ break;
+ case "update":
+ if (F.path && F.path.split(".").length > 1) {
+ var C = F.path.split(".");
+ y.grid.setcellvalue(F.index, C[C.length - 1], F.newValue)
+ } else {
+ var B = b.extend({},
+ F.object[F.index]);
+ y.grid.updaterow(E, B)
+ }
+ break
+ }
+ this._updating = false
+ }
+ }
+ if (x == "updateData") {
+ y.refresh();
+ y.grid._updateGridData()
+ } else {
+ if (q.recordstartindex && this.virtualmode) {
+ y.updateview(q.recordstartindex, q.recordstartindex + y.pagesize)
+ } else {
+ y.refresh()
+ }
+ y.update(m != y.totalrecords)
+ }
+ };
+ k();
+ g.bindBindingUpdate(y.grid.element.id, k)
+ }
+ break;
+ case "json":
+ case "jsonp":
+ case "xml":
+ case "xhtml":
+ case "script":
+ case "text":
+ case "csv":
+ case "tab":
+ if (q.localdata != null) {
+ g.unbindBindingUpdate(y.grid.element.id);
+ if ((!y.grid.autobind && y.grid.isInitialized) || y.grid.autobind) {
+ g.dataBind()
+ }
+ var k = function(x) {
+ var m = y.totalrecords;
+ t(y);
+ if (x == "updateData") {
+ y.refresh();
+ y.grid._updateGridData()
+ } else {
+ if (q.recordstartindex && y.virtualmode) {
+ y.updateview(q.recordstartindex, q.recordstartindex + y.pagesize)
+ } else {
+ y.refresh()
+ }
+ y.update(m != y.totalrecords)
+ }
+ };
+ k();
+ g.bindBindingUpdate(y.grid.element.id, k);
+ return
+ }
+ var u = {};
+ var o = 0;
+ var v = {};
+ for (var i = 0; i < this.filters.length; i++) {
+ var f = this.filters[i].datafield;
+ var j = this.filters[i].filter;
+ if (!j.getfilters) {
+ continue
+ }
+ var h = j.getfilters();
+ v[f + "operator"] = j.operator;
+ for (var s = 0; s < h.length; s++) {
+ h[s].datafield = f;
+ var n = h[s].value;
+ if (h[s].type == "datefilter") {
+ if (h[s].value && h[s].value.toLocaleString) {
+ var d = this.grid.getcolumn(h[s].datafield);
+ if (d && d.cellsformat) {
+ var r = this.grid.source.formatDate(h[s].value, d.cellsformat, this.grid.gridlocalization);
+ if (r) {
+ v["filtervalue" + o] = r
+ } else {
+ v["filtervalue" + o] = h[s].value.toLocaleString()
+ }
+ } else {
+ v["filtervalue" + o] = n.toString()
+ }
+ } else {
+ v["filtervalue" + o] = n.toString()
+ }
+ } else {
+ v["filtervalue" + o] = n.toString();
+ if (h[s].data) {
+ v["filterid" + o] = h[s].data.toString()
+ }
+ if (h[s].id) {
+ v["filterid" + o] = h[s].id.toString()
+ }
+ }
+ v["filtercondition" + o] = h[s].condition;
+ v["filteroperator" + o] = h[s].operator;
+ v["filterdatafield" + o] = f;
+ o++
+ }
+ }
+ v.filterscount = o;
+ v.groupscount = y.groups.length;
+ for (var i = 0; i < y.groups.length; i++) {
+ v["group" + i] = y.groups[i]
+ }
+ if (q.recordstartindex == undefined) {
+ q.recordstartindex = 0
+ }
+ if (q.recordendindex == undefined || q.recordendindex == 0) {
+ if (y.grid.height && y.grid.height.toString().indexOf("%") == -1) {
+ q.recordendindex = parseInt(y.grid.height) / y.grid.rowsheight;
+ q.recordendindex += 2;
+ q.recordendindex = parseInt(q.recordendindex)
+ } else {
+ q.recordendindex = b(window).height() / y.grid.rowsheight;
+ q.recordendindex = parseInt(q.recordendindex)
+ }
+ if (this.pageable) {
+ q.recordendindex = this.pagesize
+ }
+ }
+ if (this.pageable) {
+ q.recordstartindex = (this.pagenum) * this.pagesize;
+ q.recordendindex = (this.pagenum + 1) * this.pagesize
+ }
+ b.extend(v, {
+ sortdatafield: y.sortfield,
+ sortorder: y.sortfielddirection,
+ pagenum: y.pagenum,
+ pagesize: y.grid.pagesize,
+ recordstartindex: q.recordstartindex,
+ recordendindex: q.recordendindex
+ });
+ var w = g._options.data;
+ if (g._options.data) {
+ b.extend(g._options.data, v)
+ } else {
+ if (q.data) {
+ b.extend(v, q.data)
+ }
+ g._options.data = v
+ }
+ var k = function() {
+ var x = b.jqx.browser.msie && b.jqx.browser.version < 9;
+ var z = function() {
+ var A = y.totalrecords;
+ t(y);
+ if (q.recordstartindex && y.virtualmode) {
+ y.updateview(q.recordstartindex, q.recordstartindex + y.pagesize)
+ } else {
+ y.refresh()
+ }
+ y.update(A != y.totalrecords)
+ };
+ if (x) {
+ try {
+ z()
+ } catch(m) {}
+ } else {
+ z()
+ }
+ };
+ g.unbindDownloadComplete(y.grid.element.id);
+ g.bindDownloadComplete(y.grid.element.id, k);
+ if ((!y.grid.autobind && y.grid.isInitialized) || y.grid.autobind) {
+ g.dataBind()
+ } else {
+ if (!y.grid.isInitialized && !y.grid.autobind) {
+ k()
+ }
+ }
+ g._options.data = w
+ }
+ };
+ this.getid = function(g, e, f) {
+ if (b(g, e).length > 0) {
+ return b(g, e).text()
+ }
+ if (g) {
+ if (g.toString().length > 0) {
+ var d = b(e).attr(g);
+ if (d != null && d.toString().length > 0) {
+ return d
+ }
+ }
+ }
+ return f
+ };
+ this.getvaluebytype = function(g, d) {
+ var e = g;
+ if (d.type == "date") {
+ var f = new Date(g);
+ if (f.toString() == "NaN" || f.toString() == "Invalid Date") {
+ if (b.jqx.dataFormat) {
+ g = b.jqx.dataFormat.tryparsedate(g)
+ } else {
+ g = f
+ }
+ } else {
+ g = f
+ }
+ if (g == null) {
+ g = e
+ }
+ } else {
+ if (d.type == "float") {
+ var g = parseFloat(g);
+ if (isNaN(g)) {
+ g = e
+ }
+ } else {
+ if (d.type == "int") {
+ var g = parseInt(g);
+ if (isNaN(g)) {
+ g = e
+ }
+ } else {
+ if (d.type == "bool") {
+ if (g != null) {
+ if (g.toLowerCase() == "false") {
+ g = false
+ } else {
+ if (g.toLowerCase() == "true") {
+ g = true
+ }
+ }
+ }
+ if (g == 1) {
+ g = true
+ } else {
+ if (g == 0) {
+ g = false
+ } else {
+ g = ""
+ }
+ }
+ }
+ }
+ }
+ }
+ return g
+ };
+ this.setpaging = function(d) {
+ if (d.pageSize != undefined) {
+ this.pagesize = d.pageSize
+ }
+ if (d.pageNum != undefined) {
+ this.pagenum = Math.min(d.pageNum, Math.ceil(this.totalrows / this.pagesize))
+ }
+ this.refresh()
+ };
+ this.getpagingdetails = function() {
+ return {
+ pageSize: this.pagesize,
+ pageNum: this.pagenum,
+ totalrows: this.totalrows
+ }
+ };
+ this._clearcaches = function() {
+ this.sortcache = {};
+ this.sortdata = null;
+ this.changedrecords = new Array();
+ this.records = new Array();
+ this.rows = new Array();
+ this.cacheddata = new Array();
+ this.originaldata = new Array();
+ this.bounditems = new Array();
+ this.loadedrecords = new Array();
+ this.loadedrootgroups = new Array();
+ this.loadedgroups = new Array();
+ this.loadedgroupsByKey = new Array();
+ this._cachegrouppages = new Array();
+ this.recordsbyid = new Array();
+ this.cachedrecords = new Array();
+ this.recordids = new Array()
+ };
+ this.addfilter = function(g, f) {
+ var e = -1;
+ for (var d = 0; d < this.filters.length; d++) {
+ if (this.filters[d].datafield == g) {
+ e = d;
+ break
+ }
+ }
+ if (e == -1) {
+ this.filters[this.filters.length] = {
+ filter: f,
+ datafield: g
+ }
+ } else {
+ this.filters[e] = {
+ filter: f,
+ datafield: g
+ }
+ }
+ };
+ this.removefilter = function(e) {
+ for (var d = 0; d < this.filters.length; d++) {
+ if (this.filters[d].datafield == e) {
+ this.filters.splice(d, 1);
+ break
+ }
+ }
+ };
+ this.getItemFromIndex = function(d) {
+ return this.records[d]
+ };
+ this.updaterow = function(d, n, l) {
+ var e = this.filters && this.filters.length > 0 && !this.virtualmode;
+ if (!e && n != undefined && d != undefined) {
+ n.uid = d;
+ if (! (n[this.source.id])) {
+ n[this.source.id] = n.uid
+ }
+ var j = this.recordsbyid["id" + d];
+ var k = this.records.indexOf(j);
+ if (k == -1) {
+ return false
+ }
+ this.records[k] = n;
+ if (this.cachedrecords) {
+ this.cachedrecords[k] = n
+ }
+ if (l == true || l == undefined) {
+ this.refresh()
+ }
+ this.changedrecords[n.uid] = {
+ Type: "Update",
+ OldData: j,
+ Data: n
+ };
+ return true
+ } else {
+ if (this.filters && this.filters.length > 0) {
+ var f = this.cachedrecords;
+ var j = null;
+ var k = -1;
+ for (var h = 0; h < f.length; h++) {
+ if (f[h].uid == d) {
+ j = f[h];
+ k = h;
+ break
+ }
+ }
+ if (j) {
+ var m = this.that;
+ for (var g in n) {
+ m.cachedrecords[k][g] = n[g]
+ }
+ if (l == true || l == undefined) {
+ this.refresh()
+ }
+ return true
+ }
+ }
+ }
+ return false
+ };
+ this.addrow = function(h, i, d, g) {
+ if (i != undefined) {
+ if (b.isEmptyObject(i)) {
+ if (this.source && this.source.datafields) {
+ b.each(this.source.datafields,
+ function() {
+ var j = "";
+ if (this.type == "number") {
+ j = null
+ }
+ if (this.type == "date") {
+ j = null
+ }
+ if (this.type == "bool" || this.type == "boolean") {
+ j = false
+ }
+ i[this.name] = j
+ })
+ }
+ }
+ if (!h || this.recordsbyid["id" + h]) {
+ i.uid = this.getid(this.source.id, i, this.totalrecords);
+ var e = this.recordsbyid["id" + i.uid];
+ while (e != null) {
+ var f = Math.floor(Math.random() * 10000).toString();
+ i.uid = f;
+ e = this.recordsbyid["id" + f]
+ }
+ } else {
+ i.uid = h
+ }
+ if (! (i[this.source.id])) {
+ if (this.source.id != undefined) {
+ i[this.source.id] = i.uid
+ }
+ }
+ if (d == "last") {
+ this.records.push(i)
+ } else {
+ if (typeof d === "number" && isFinite(d)) {
+ this.records.splice(d, 0, i)
+ } else {
+ this.records.splice(0, 0, i)
+ }
+ }
+ if (this.filters && this.filters.length > 0) {
+ if (d == "last") {
+ this.cachedrecords.push(i)
+ } else {
+ if (typeof d === "number" && isFinite(d)) {
+ this.cachedrecords.splice(d, 0, i)
+ } else {
+ this.cachedrecords.splice(0, 0, i)
+ }
+ }
+ }
+ this.totalrecords++;
+ if (this.virtualmode) {
+ this.source.totalrecords = this.totalrecords
+ }
+ if (g == true || g == undefined) {
+ this.refresh()
+ }
+ this.changedrecords[i.uid] = {
+ Type: "New",
+ Data: i
+ };
+ return true
+ }
+ return false
+ };
+ this.deleterow = function(j, h) {
+ if (j != undefined) {
+ var d = this.filters && this.filters.length > 0;
+ if (this.recordsbyid["id" + j] && !d) {
+ var e = this.recordsbyid["id" + j];
+ var k = this.records.indexOf(e);
+ this.changedrecords[j] = {
+ Type: "Delete",
+ Data: this.records[k]
+ };
+ this.records.splice(k, 1);
+ this.totalrecords--;
+ if (this.virtualmode) {
+ this.source.totalrecords = this.totalrecords
+ }
+ if (h == true || h == undefined) {
+ this.refresh()
+ }
+ return true
+ } else {
+ if (this.filters && this.filters.length > 0) {
+ var f = this.cachedrecords;
+ var e = null;
+ var k = -1;
+ for (var g = 0; g < f.length; g++) {
+ if (f[g].uid == j) {
+ e = f[g];
+ k = g;
+ break
+ }
+ }
+ if (e) {
+ this.cachedrecords.splice(k, 1);
+ if (h == true || h == undefined) {
+ this.totalrecords = 0;
+ this.records = this.cachedrecords;
+ this.refresh()
+ }
+ return true
+ }
+ }
+ }
+ return false
+ }
+ return false
+ };
+ this.reload = function(f, d, r, g, h, u, t) {
+ var m = this.that;
+ var l = new Array();
+ var o = f;
+ var i = d;
+ var j = r;
+ var p = g;
+ var k = i.length;
+ var w = 0;
+ var e = 0;
+ var s, n;
+ this.columns = [];
+ this.bounditems = new Array();
+ this.loadedrecords = new Array();
+ this.loadedrootgroups = new Array();
+ this.loadedgroups = new Array();
+ this.loadedgroupsByKey = new Array();
+ this._cachegrouppages = new Array();
+ this.recordsbyid = {};
+ if (this.totalrecords == 0) {
+ Object.size = function(z) {
+ var y = 0,
+ x;
+ for (x in z) {
+ if (z.hasOwnProperty(x)) {
+ y++
+ }
+ }
+ return y
+ };
+ var v = Object.size(o);
+ this.totalrecords = v;
+ b.each(this.records,
+ function(y) {
+ var z = this;
+ var x = 0;
+ b.each(z,
+ function(A, B) {
+ m.columns[x++] = A
+ });
+ return false
+ })
+ }
+ if (this.virtualmode) {
+ if (this.pageable) {
+ this.updateview();
+ return
+ }
+ var u = 0;
+ if (!this.groupable) {
+ this.updateview();
+ return
+ } else {
+ var t = this.totalrecords
+ }
+ } else {
+ var u = 0;
+ var t = this.totalrecords
+ }
+ if (this.groupable && this.groups.length > 0 && this.loadgrouprecords) {
+ var q = u;
+ q = this.loadgrouprecords(0, u, t, j, e, p, i, k, l)
+ } else {
+ w = this.loadflatrecords(u, t, j, e, p, i, k, l)
+ }
+ if (k > e) {
+ i.splice(e, k - e)
+ }
+ if (this.groups.length > 0 && this.groupable) {
+ this.totalrows = q
+ } else {
+ this.totalrows = w
+ }
+ return l
+ };
+ this.loadflatrecords = function(d, o, e, p, l, u, n, q) {
+ var t = this.that;
+ var k = d;
+ var m = d;
+ o = Math.min(o, this.totalrecords);
+ var g = this.sortdata != null;
+ var f = this.source.id && (this.source.datatype == "local" || this.source.datatype == "array" || this.source.datatype == "");
+ var j = g ? this.sortdata: this.records;
+ for (var h = d; h < o; h++) {
+ var s = {};
+ if (!g) {
+ s = b.extend({},
+ j[h]);
+ id = s[t.uniqueId];
+ s.boundindex = k;
+ t.loadedrecords[k] = s;
+ if (s.uid == undefined) {
+ s.uid = t.getid(t.source.id, s, k)
+ }
+ t.recordsbyid["id" + s.uid] = j[h];
+ s.uniqueid = t.generatekey();
+ t.bounditems[this.bounditems.length] = s
+ } else {
+ s = b.extend({},
+ j[h].value);
+ id = s[t.uniqueId];
+ s.boundindex = j[h].index;
+ if (s.uid == undefined) {
+ s.uid = t.getid(t.source.id, s, s.boundindex)
+ }
+ t.recordsbyid["id" + s.uid] = j[h].value;
+ t.loadedrecords[k] = s;
+ s.uniqueid = t.generatekey();
+ t.bounditems[s.boundindex] = s
+ }
+ if (p >= n || id != u[p][t.uniqueId] || (l && l[id])) {
+ q[q.length] = p
+ }
+ u[p] = s;
+ p++;
+ s.visibleindex = m;
+ m++;
+ k++
+ }
+ if (t.grid.summaryrows) {
+ var r = k;
+ b.each(t.grid.summaryrows,
+ function() {
+ var i = b.extend({},
+ this);
+ i.boundindex = o++;
+ t.loadedrecords[r] = i;
+ i.uniqueid = t.generatekey();
+ t.bounditems[t.bounditems.length] = i;
+ u[p] = i;
+ p++;
+ i.visibleindex = m;
+ m++;
+ r++
+ })
+ }
+ return m
+ },
+ this.updateview = function(o, p) {
+ var r = this.that;
+ var k = this.pagesize * this.pagenum;
+ var n = 0;
+ var s = new Array();
+ var e = this.filters;
+ var j = this.updated;
+ var l = s.length;
+ if (this.pageable) {
+ if (this.virtualmode) {
+ if (!this.groupable || this.groups.length == 0) {
+ this.loadflatrecords(this.pagesize * this.pagenum, this.pagesize * (1 + this.pagenum), e, n, j, s, l, []);
+ this.totalrows = s.length
+ } else {
+ if (this.groupable && this.groups.length > 0 && this.loadgrouprecords) {
+ if (this._cachegrouppages[this.pagenum + "_" + this.pagesize] != undefined) {
+ this.rows = this._cachegrouppages[this.pagenum + "_" + this.pagesize];
+ this.totalrows = this.rows.length;
+ return
+ }
+ var m = this.pagesize * (1 + this.pagenum);
+ if (m > this.totalrecords) {
+ m = this.totalrecords
+ }
+ this.loadgrouprecords(0, this.pagesize * this.pagenum, m, e, n, j, s, l, []);
+ this._cachegrouppages[this.pagenum + "_" + this.pagesize] = this.rows;
+ this.totalrows = this.rows.length;
+ return
+ }
+ }
+ }
+ } else {
+ if (this.virtualmode && (!this.groupable || this.groups.length == 0)) {
+ var g = this.pagesize;
+ if (g == 0) {
+ g = Math.min(100, this.totalrecords)
+ }
+ var d = g * this.pagenum;
+ if (this.loadedrecords.length == 0) {
+ d = 0
+ }
+ if (o != null && p != null) {
+ this.loadflatrecords(o, p, e, n, j, s, l, [])
+ } else {
+ this.loadflatrecords(this.pagesize * this.pagenum, this.pagesize * (1 + this.pagenum), e, n, j, s, l, [])
+ }
+ this.totalrows = this.loadedrecords.length;
+ this.rows = s;
+ if (s.length >= g) {
+ return
+ }
+ }
+ }
+ if (this.groupable && this.pageable && this.groups.length > 0 && this._updategroupsinpage) {
+ s = this._updategroupsinpage(r, e, k, n, l, this.pagesize * this.pagenum, this.pagesize * (1 + this.pagenum))
+ } else {
+ for (var h = this.pagesize * this.pagenum; h < this.pagesize * (1 + this.pagenum); h++) {
+ var q = h < this.loadedrecords.length ? this.loadedrecords[h] : null;
+ if (q == null) {
+ continue
+ }
+ if (!this.pagesize || (k >= this.pagesize * this.pagenum && k <= this.pagesize * (this.pagenum + 1))) {
+ s[n] = q;
+ n++
+ }
+ k++
+ }
+ }
+ if ((s.length == 0 || s.length < this.pagesize) && !this.pageable && this.virtualmode) {
+ n = s.length;
+ var f = s.length;
+ for (var h = this.pagesize * this.pagenum; h < this.pagesize * (1 + this.pagenum) - f; h++) {
+ var q = {};
+ q.boundindex = h + f;
+ q.visibleindex = h + f;
+ q.uniqueid = r.generatekey();
+ q.empty = true;
+ r.bounditems[h + f] = q;
+ s[n] = q;
+ n++
+ }
+ }
+ this.rows = s
+ };
+ this.generatekey = function() {
+ var d = function() {
+ return (((1 + Math.random()) * 16) | 0)
+ };
+ return ("" + d() + d() + "-" + d() + "-" + d() + "-" + d() + "-" + d() + d() + d())
+ };
+ this.reloaddata = function() {
+ this.reload(this.records, this.rows, this.filter, this.updated, true)
+ };
+ this.refresh = function(h) {
+ if (this.suspend) {
+ return
+ }
+ if (h == undefined) {
+ h = true
+ }
+ var l = this.rows.length;
+ var k = this.totalrows;
+ if (this.filters.length > 0 && !this.virtualmode) {
+ var e = "";
+ var g = this.cachedrecords.length;
+ var s = new Array();
+ this.totalrecords = 0;
+ var n = this.cachedrecords;
+ this._dataIndexToBoundIndex = new Array();
+ var f = this.filters.length;
+ if (this.source != null && this.source.filter != undefined && this.source.localdata != undefined) {
+ s = this.source.filter(this.filters, n, g);
+ if (s == undefined) {
+ s = new Array()
+ }
+ this.records = s
+ } else {
+ if (this.source.filter == null || this.source.filter == undefined) {
+ for (var u = 0; u < g; u++) {
+ var o = n[u];
+ var d = undefined;
+ for (var m = 0; m < f; m++) {
+ var e = this.filters[m].filter;
+ var r = o[this.filters[m].datafield];
+ var t = e.evaluate(r);
+ if (d == undefined) {
+ d = t
+ } else {
+ if (e.operator == "or") {
+ d = d || t
+ } else {
+ d = d && t
+ }
+ }
+ }
+ if (d) {
+ s[s.length] = b.extend({
+ dataindex: u
+ },
+ o);
+ this._dataIndexToBoundIndex[u] = {
+ boundindex: s.length - 1
+ }
+ } else {
+ this._dataIndexToBoundIndex[u] = null
+ }
+ }
+ this.records = s
+ }
+ }
+ if (this.sortdata) {
+ var i = this.sortfield;
+ if (this.sortcache[i]) {
+ this.sortdata = null;
+ var p = this.sortcache[i].direction;
+ this.sortcache[i] = null;
+ this.sortby(this.sortfield, p);
+ return
+ }
+ }
+ } else {
+ if (this.filters.length == 0 && !this.virtualmode) {
+ if (this.cachedrecords) {
+ this.totalrecords = 0;
+ var n = this.cachedrecords;
+ this.records = n;
+ if (this.sortdata) {
+ var i = this.sortfield;
+ if (this.sortcache[i]) {
+ this.sortdata = null;
+ var p = this.sortcache[i].direction;
+ this.sortcache[i] = null;
+ this.sortby(this.sortfield, p);
+ return
+ }
+ }
+ }
+ }
+ }
+ var q = this.reload(this.records, this.rows, this.filter, this.updated, h);
+ this.updated = null;
+ if (this.rowschangecallback != null) {
+ if (k != totalrows) {
+ this.rowschangecallback({
+ type: "PagingChanged",
+ data: getpagingdetails()
+ })
+ }
+ if (l != rows.length) {
+ this.rowschangecallback({
+ type: "RowsCountChanged",
+ data: {
+ previous: l,
+ current: rows.length
+ }
+ })
+ }
+ if (q.length > 0 || l != rows.length) {
+ this.rowschangecallback({
+ type: "RowsChanged",
+ data: {
+ previous: l,
+ current: rows.length,
+ diff: q
+ }
+ })
+ }
+ }
+ };
+ return this
+ }
+})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxgrid.pager.js b/static/js/jqxgrid.pager.js
new file mode 100644
index 0000000..fd8246f
--- /dev/null
+++ b/static/js/jqxgrid.pager.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.extend(a.jqx._jqxGrid.prototype,{_initpager:function(){var r=this.that;var j=this.gridlocalization.pagergotopagestring;var s=this.gridlocalization.pagerrangestring;var l=this.gridlocalization.pagershowrowsstring;var m=(this.pagerheight-17)/2;this.pagerdiv=this.pagerdiv||a('
');if(!this.pageable){this.pagerdiv.remove();this.vScrollBar.jqxScrollBar({thumbSize:0});return}if(!this.pagerrenderer){this.pagerdiv.css("top",m);this.pager.append(this.pagerdiv);this.pagergotoinput=this.pagergotoinput||a('
');this.pagergoto=this.pagergoto||a('
');this.pagerrightbutton=this.pagerrightbutton||a('
');this.pagerleftbutton=this.pagerleftbutton||a('
');this.pagerdetails=this.pagerdetails||a('
');this.pagershowrows=this.pagershowrows||a('
');this.pagerbuttons=a('
');if(this.pagershowrowscombo&&this.pagershowrowscombo.jqxDropDownList){this.pagershowrowscombo.remove();this.pagershowrowscombo=null}this.pagergotoinput.attr("disabled",this.disabled);this.pagerfirstbutton=a('
');this.pagerlastbutton=a('
');this.pagershowrowscombo=this.pagershowrowscombo||a('');this.pagerdiv.children().remove();this.pagershowrowscombo[0].id="gridpagerlist"+this.element.id;this.removeHandler(this.pagerrightbutton,"mousedown");this.removeHandler(this.pagerrightbutton,"mouseup");this.removeHandler(this.pagerrightbutton,"click");this.removeHandler(this.pagerleftbutton,"mousedown");this.removeHandler(this.pagerleftbutton,"mouseup");this.removeHandler(this.pagerleftbutton,"click");this.removeHandler(this.pagerfirstbutton,"mousedown");this.removeHandler(this.pagerfirstbutton,"mouseup");this.removeHandler(this.pagerfirstbutton,"click");this.removeHandler(this.pagerlastbutton,"mousedown");this.removeHandler(this.pagerlastbutton,"mouseup");this.removeHandler(this.pagerlastbutton,"click");this.pagerleftbutton.attr("title",this.gridlocalization.pagerpreviousbuttonstring);this.pagerrightbutton.attr("title",this.gridlocalization.pagernextbuttonstring);if(this.pagermode=="simple"){if(a.jqx.browser.msie&&a.jqx.browser.version<8){this.pagerbuttons.css("overflow","visible");this.pagerbuttons.css("padding","3px")}this.pagerfirstbutton.attr("title",this.gridlocalization.pagerfirstbuttonstring);this.pagerlastbutton.attr("title",this.gridlocalization.pagerlastbuttonstring);var n=a("
");n.addClass(this.toThemeProperty("jqx-icon-arrow-first"));this.pagerfirstbutton.wrapInner(n);var g=a("
");g.addClass(this.toThemeProperty("jqx-icon-arrow-last"));this.pagerlastbutton.wrapInner(g);if(!this.rtl){this.pagerdiv.append(this.pagerfirstbutton);this.pagerdiv.append(this.pagerleftbutton);this.pagerdiv.append(this.pagerbuttons);this.pagerdiv.append(this.pagerrightbutton);this.pagerdiv.append(this.pagerlastbutton)}else{this.pagerdiv.append(this.pagerlastbutton);this.pagerdiv.append(this.pagerrightbutton);this.pagerdiv.append(this.pagerbuttons);this.pagerdiv.append(this.pagerleftbutton);this.pagerdiv.append(this.pagerfirstbutton)}this.pagerlastbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});this.pagerfirstbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});var t=!this.rtl?"left":"right";this.pagerbuttons.css("float",t);this.pagerlastbutton.css("float",t);this.pagerfirstbutton.css("float",t);this.pagerrightbutton.css("float",t);this.pagerleftbutton.css("float",t);this.pagerdetails.css("float",this.rtl?"left":"right");if(this.rtl){this.pagerdetails.css("margin-left","7px");this.pagerdetails.css("margin-right","0px")}else{this.pagerdetails.css("margin-left","0px");this.pagerdetails.css("margin-right","7px")}this.pagergotoinput.hide();this.pagershowrowscombo.hide();this.pagergoto.hide();this.pagershowrows.hide()}else{this.pagergotoinput.show();this.pagershowrowscombo.show();this.pagergoto.show();this.pagershowrows.show();if(!this.rtl){this.pagerdiv.append(this.pagerrightbutton);this.pagerdiv.append(this.pagerleftbutton)}}this.pagerrightbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});this.pagerleftbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});this.pagerleftbutton.find(".jqx-icon-arrow-left").remove();this.pagerrightbutton.find(".jqx-icon-arrow-right").remove();var c=a("
");c.addClass(this.toThemeProperty("jqx-icon-arrow-left"));this.pagerleftbutton.wrapInner(c);var d=a("
");d.addClass(this.toThemeProperty("jqx-icon-arrow-right"));this.pagerrightbutton.wrapInner(d);this.pagerdiv.append(this.pagerdetails);if(this.pagermode!="simple"){if(!this.rtl){this.pagerdiv.append(this.pagershowrowscombo);this.pagerdiv.append(this.pagershowrows);this.pagerdiv.append(this.pagergotoinput);this.pagerdiv.append(this.pagergoto)}else{this.pagerdiv.append(this.pagergoto);this.pagerdiv.append(this.pagergotoinput);this.pagerdiv.append(this.pagershowrows);this.pagerdiv.append(this.pagershowrowscombo);this.pagerdiv.append(this.pagerdetails);this.pagerdiv.append(this.pagerrightbutton);this.pagerdiv.append(this.pagerleftbutton)}}var o=this.pagesizeoptions;if(!this.pagershowrowscombo.jqxDropDownList){throw new Error("jqxGrid: jqxdropdownlist.js is not loaded.");return}this.pagershowrowscombo.jqxDropDownList({rtl:this.rtl,disabled:this.disabled,source:o,enableBrowserBoundsDetection:true,keyboardSelection:false,autoDropDownHeight:true,width:"auto",height:16,theme:this.theme});var q=0;for(var p=0;p
=o[p]){q=p}}this.pagershowrows[0].innerHTML=l;this.pagergoto[0].innerHTML=j;this.updatepagerdetails();this.pagershowrowscombo.jqxDropDownList({selectedIndex:q});this.pagerpageinput=this.pagergotoinput.find("input");this.pagerpageinput.addClass(this.toThemeProperty("jqx-input"));this.pagerpageinput.addClass(this.toThemeProperty("jqx-widget-content"));if(this.rtl){this.pagerpageinput.css("direction","rtl")}var r=this.that;this.removeHandler(this.pagershowrowscombo,"select");this.addHandler(this.pagershowrowscombo,"select",function(w){if(w.args){if(r.vScrollInstance){r.vScrollInstance.setPosition(0)}if(r.editcell!=null&&r.endcelledit){r.endcelledit(r.editcell.row,r.editcell.column,true,false)}var u=w.args.index;var x=r.dataview.pagenum*r.dataview.pagesize;var v=o[u];var y=r.pagesize;r.pagesize=parseInt(v);if(isNaN(r.pagesize)){r.pagesize=10}if(v>=100){r.pagershowrowscombo.jqxDropDownList({width:"auto"})}else{r.pagershowrowscombo.jqxDropDownList({width:44})}r.dataview.pagesize=r.pagesize;var i=Math.floor(x/r.dataview.pagesize);r.prerenderrequired=true;r._requiresupdate=true;r._raiseEvent(10,{pagenum:i,oldpagesize:y,pagesize:r.dataview.pagesize});r.gotopage(i);if(r.autoheight&&r._updatesizeonwindowresize){r._updatesize(true);setTimeout(function(){r._updatesize(true)},500)}}});var k=this.pagergotoinput.find("input");k.addClass(this.toThemeProperty("jqx-grid-pager-input"));k.addClass(this.toThemeProperty("jqx-rc-all"));this.removeHandler(k,"keydown");this.removeHandler(k,"change");this.addHandler(k,"keydown",function(i){if(i.keyCode>=65&&i.keyCode<=90){return false}if(i.keyCode=="13"){var u=k.val();u=parseInt(u);if(!isNaN(u)){r.gotopage(u-1)}return false}});this.addHandler(k,"change",function(){var i=k.val();i=parseInt(i);if(!isNaN(i)){r.gotopage(i-1)}});this.addHandler(this.pagerrightbutton,"mouseenter",function(){d.addClass(r.toThemeProperty("jqx-icon-arrow-right-hover"))});this.addHandler(this.pagerleftbutton,"mouseenter",function(){c.addClass(r.toThemeProperty("jqx-icon-arrow-left-hover"))});this.addHandler(this.pagerrightbutton,"mouseleave",function(){d.removeClass(r.toThemeProperty("jqx-icon-arrow-right-hover"))});this.addHandler(this.pagerleftbutton,"mouseleave",function(){c.removeClass(r.toThemeProperty("jqx-icon-arrow-left-hover"))});this.addHandler(this.pagerrightbutton,"mousedown",function(){d.addClass(r.toThemeProperty("jqx-icon-arrow-right-selected"))});this.addHandler(this.pagerrightbutton,"mouseup",function(){d.removeClass(r.toThemeProperty("jqx-icon-arrow-right-selected"))});this.addHandler(this.pagerleftbutton,"mousedown",function(){c.addClass(r.toThemeProperty("jqx-icon-arrow-left-selected"))});this.addHandler(this.pagerleftbutton,"mouseup",function(){c.removeClass(r.toThemeProperty("jqx-icon-arrow-left-selected"))});this.addHandler(a(document),"mouseup.pagerbuttons"+this.element.id,function(){d.removeClass(r.toThemeProperty("jqx-icon-arrow-right-selected"));c.removeClass(r.toThemeProperty("jqx-icon-arrow-left-selected"))});this.addHandler(this.pagerrightbutton,"click",function(){if(!r.pagerrightbutton.jqxButton("disabled")){if(!r.rtl){r.gotonextpage()}else{r.gotoprevpage()}}});this.addHandler(this.pagerleftbutton,"click",function(){if(!r.pagerleftbutton.jqxButton("disabled")){if(!r.rtl){r.gotoprevpage()}else{r.gotonextpage()}}});var f=this;if(this.pagermode==="simple"){var e=this.pagerfirstbutton;var h=this.pagerlastbutton;this.addHandler(h,"mouseenter",function(){g.addClass(f.toThemeProperty("jqx-icon-arrow-last-hover"))});this.addHandler(e,"mouseenter",function(){n.addClass(f.toThemeProperty("jqx-icon-arrow-first-hover"))});this.addHandler(h,"mouseleave",function(){g.removeClass(f.toThemeProperty("jqx-icon-arrow-last-hover"))});this.addHandler(e,"mouseleave",function(){n.removeClass(f.toThemeProperty("jqx-icon-arrow-first-hover"))});this.addHandler(h,"mousedown",function(){g.addClass(f.toThemeProperty("jqx-icon-arrow-last-selected"))});this.addHandler(e,"mousedown",function(){n.addClass(f.toThemeProperty("jqx-icon-arrow-first-selected"))});this.addHandler(h,"mouseup",function(){g.removeClass(f.toThemeProperty("jqx-icon-arrow-last-selected"))});this.addHandler(e,"mouseup",function(){n.removeClass(f.toThemeProperty("jqx-icon-arrow-first-selected"))});this.addHandler(a(document),"mouseup.pagerbuttons"+name+this.element.id,function(){d.removeClass(f.toThemeProperty("jqx-icon-arrow-right-selected"));c.removeClass(f.toThemeProperty("jqx-icon-arrow-left-selected"));if(g){g.removeClass(f.toThemeProperty("jqx-icon-arrow-last-selected"));n.removeClass(f.toThemeProperty("jqx-icon-arrow-first-selected"))}});this.addHandler(e,"click",function(){if(!e.jqxButton("disabled")){if(!f.rtl){f.gotopage(0)}else{var u=f.dataview.totalrecords;var i=Math.ceil(u/f.pagesize);f.gotopage(i-1)}}});this.addHandler(h,"click",function(){if(!h.jqxButton("disabled")){if(!f.rtl){var u=f.dataview.totalrecords;var i=Math.ceil(u/f.pagesize);f.gotopage(i-1)}else{f.gotopage(0)}}})}}else{this.pagerdiv.children().remove();var b=this.pagerrenderer();if(b!=null){this.pagerdiv.append(a(b))}this.pager.append(this.pagerdiv)}this.vScrollBar.jqxScrollBar("refresh");this._arrange()},_updatepagertheme:function(){if(this.pagershowrowscombo==null){return}this.pagershowrowscombo.jqxDropDownList({theme:this.theme});this.pagerrightbutton.jqxButton({theme:this.theme});this.pagerleftbutton.jqxButton({theme:this.theme});this.pagerpageinput.removeClass();var c=this.pagergotoinput.find("input");c.removeClass();c.addClass(this.toThemeProperty("jqx-grid-pager-input"));c.addClass(this.toThemeProperty("jqx-rc-all"));this.pagerpageinput.addClass(this.toThemeProperty("jqx-input"));this.pagerpageinput.addClass(this.toThemeProperty("jqx-widget-content"));this.pagerleftbutton.find(".jqx-icon-arrow-left").remove();this.pagerrightbutton.find(".jqx-icon-arrow-right").remove();var d=a("");d.addClass(this.toThemeProperty("jqx-icon-arrow-left"));this.pagerleftbutton.wrapInner(d);var e=a("");e.addClass(this.toThemeProperty("jqx-icon-arrow-right"));this.pagerrightbutton.wrapInner(e);if(this.pagermode=="simple"){if(a.jqx.browser.msie&&a.jqx.browser.version<8){this.pagerbuttons.css("overflow","visible");this.pagerbuttons.css("padding","3px")}this.pagerfirstbutton.attr("title",this.gridlocalization.pagerfirstbuttonstring);this.pagerlastbutton.attr("title",this.gridlocalization.pagerlastbuttonstring);var h=a("");h.addClass(this.toThemeProperty("jqx-icon-arrow-first"));this.pagerfirstbutton.wrapInner(h);var g=a("");g.addClass(this.toThemeProperty("jqx-icon-arrow-last"));this.pagerlastbutton.wrapInner(g);this.pagerdiv.append(this.pagerfirstbutton);this.pagerdiv.append(this.pagerleftbutton);this.pagerdiv.append(this.pagerbuttons);this.pagerdiv.append(this.pagerrightbutton);this.pagerdiv.append(this.pagerlastbutton);this.pagerlastbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});this.pagerfirstbutton.jqxButton({cursor:"pointer",disabled:this.disabled,theme:this.theme});this.pagerbuttons.css("float","left");this.pagerlastbutton.css("float","left");this.pagerfirstbutton.css("float","left");this.pagerrightbutton.css("float","left");this.pagerleftbutton.css("float","left");this.pagergotoinput.hide();this.pagershowrowscombo.hide();this.pagergoto.hide();this.pagershowrows.hide()}else{this.pagergotoinput.show();this.pagershowrowscombo.show();this.pagergoto.show();this.pagershowrows.show()}var b=function(j,i){j.removeHandler(i,"mouseenter");j.removeHandler(i,"mouseleave");j.removeHandler(i,"mousedown");j.removeHandler(i,"mouseup")};b(this,this.pagerrightbutton);b(this,this.pagerleftbutton);var f=this.that;this.addHandler(this.pagerrightbutton,"mouseenter",function(){e.addClass(f.toThemeProperty("jqx-icon-arrow-right-hover"))});this.addHandler(this.pagerleftbutton,"mouseenter",function(){d.addClass(f.toThemeProperty("jqx-icon-arrow-left-hover"))});this.addHandler(this.pagerrightbutton,"mouseleave",function(){e.removeClass(f.toThemeProperty("jqx-icon-arrow-right-hover"))});this.addHandler(this.pagerleftbutton,"mouseleave",function(){d.removeClass(f.toThemeProperty("jqx-icon-arrow-left-hover"))});this.addHandler(this.pagerrightbutton,"mousedown",function(){e.addClass(f.toThemeProperty("jqx-icon-arrow-right-selected"))});this.addHandler(this.pagerrightbutton,"mouseup",function(){e.removeClass(f.toThemeProperty("jqx-icon-arrow-right-selected"))});this.addHandler(this.pagerleftbutton,"mousedown",function(){d.addClass(f.toThemeProperty("jqx-icon-arrow-left-selected"))});this.addHandler(this.pagerleftbutton,"mouseup",function(){d.removeClass(f.toThemeProperty("jqx-icon-arrow-left-selected"))})},gotopage:function(d){if(d==null||d==undefined){d=0}if(d==-1){d=0}if(d<0){return}var c=this.dataview.totalrecords;if(this.summaryrows){c+=this.summaryrows.length}var e=this.pagenum;this._raiseEvent(25,{oldpagenum:this.dataview.pagenum,pagenum:d,pagesize:this.dataview.pagesize});var b=Math.ceil(c/this.pagesize);if(d>=b){if(this.dataview.totalrecords==0){this.dataview.pagenum=0;this.updatepagerdetails()}if(d>0){d=b-1}if(d<0){d=0}}if(this.dataview.pagenum!=d||this._requiresupdate){if(this.pageable){if(this.source.pager){this.source.pager(d,this.dataview.pagesize,this.dataview.pagenum)}this.dataview.pagenum=d;if(this.virtualmode){this.hiddens=new Array();this.expandedgroups=new Array();if(this.rendergridrows){var h=d*this.dataview.pagesize;var g=h+this.dataview.pagesize;if(h!=null&&g!=null){if(this.pagerrightbutton){this.pagerrightbutton.jqxButton({disabled:true});this.pagerleftbutton.jqxButton({disabled:true});this.pagershowrowscombo.jqxDropDownList({disabled:true})}if(this.pagerfirstbutton){this.pagerfirstbutton.jqxButton({disabled:true});this.pagerlastbutton.jqxButton({disabled:true})}this.updatebounddata("pagechanged");this._raiseEvent(9,{pagenum:d,oldpagenum:e,pagesize:this.dataview.pagesize});this.updatepagerdetails();if(this.autosavestate){if(this.savestate){this.savestate()}}return}}}else{this.dataview.updateview()}this._loadrows();this._updatepageviews();this.tableheight=null;this._updatecolumnwidths();this._updatecellwidths();this._renderrows(this.virtualsizeinfo);this.updatepagerdetails();if(this.autoheight||this.autorowheight){var f=this.host.height()-this._gettableheight();height=f+this._pageviews[0].height;if(height!=this.host.height()){this._arrange();this._updatepageviews();if(this.autorowheight){this._renderrows(this.virtualsizeinfo)}}}if(this.editcell!=null&&this.endcelledit){this.endcelledit(this.editcell.row,this.editcell.column,false,false)}this.focus();this._raiseEvent(9,{pagenum:d,oldpagenum:e,pagesize:this.dataview.pagesize});if(this.autosavestate){if(this.savestate){this.savestate()}}}}},gotoprevpage:function(){if(this.dataview.pagenum>0){this.gotopage(this.dataview.pagenum-1)}else{if(this.pagermode!="simple"){var c=this.dataview.totalrecords;if(this.summaryrows){c+=this.summaryrows.length}var b=Math.ceil(c/this.pagesize);this.gotopage(b-1)}}},gotonextpage:function(){var c=this.dataview.totalrecords;if(this.summaryrows){c+=this.summaryrows.length}var b=Math.ceil(c/this.pagesize);if(this.dataview.pagenum0){var n=this.dataview.pagenum*this.pagesize;var d=(this.dataview.pagenum+1)*this.pagesize;if(d>=this.dataview.totalrecords){d=this.dataview.totalrecords}var q=this.dataview.totalrecords;if(this.summaryrows){q+=this.summaryrows.length;if((this.dataview.pagenum+1)*this.pagesize>this.dataview.totalrecords){d=q}}n++;var g=Math.ceil(q/this.dataview.pagesize);if(g>=1){g--}g++;if(this.pagermode!=="simple"){var o=this.pagergotoinput.find("input");o.val(this.dataview.pagenum+1)}else{var b="";var f=this.pagerbuttonscount;if(f==0||!f){f=5}var h=0;if(this.rtl){h=f-1}while((this.rtl&&h>=0)||(!this.rtl&&hg){break}if(!this.rtl){if(h==0&&m>f){b+="..."}}if(this.dataview.pagenum===m-1){l+=" "+this.toTP("jqx-fill-state-pressed")}if(!this.rtl){b+=""+m+"";if(h===f-1){var l=this.toTP("jqx-grid-pager-number");l+=" "+this.toTP("jqx-rc-all");if(g>=1+m){b+="..."}}}else{if(h===f-1){var l=this.toTP("jqx-grid-pager-number");l+=" "+this.toTP("jqx-rc-all");if(g>=1+m){b+="..."}}if(this.dataview.pagenum===m-1){l+=" "+this.toTP("jqx-fill-state-pressed")}b+=""+m+""}if(this.rtl){var l=this.toTP("jqx-grid-pager-number");l+=" "+this.toTP("jqx-rc-all");if(h==0&&m>f){b+="..."}}if(!this.rtl){h++}else{h--}}var p=this["pagerbuttons"].find("a");this.removeHandler(p,"click");this.removeHandler(p,"mouseenter");this.removeHandler(p,"mouseleave");this["pagerbuttons"][0].innerHTML=b;var j=this;var c=function(){j.addHandler(p,"click",function(i){var r=a(i.target).attr("data-page");j.gotopage(parseInt(r)-1);return false});j.addHandler(p,"mouseenter",function(i){a(i.target).addClass(j.toTP("jqx-fill-state-hover"))});j.addHandler(p,"mouseleave",function(i){a(i.target).removeClass(j.toTP("jqx-fill-state-hover"))})};var p=this["pagerbuttons"].find("a");c(p)}this.pagergotoinput.attr("title","1 - "+g);if(d==0&&dd){this.gotoprevpage()}}},_updatepagedview:function(e,g,b){var j=this.that;if(this.dataview.rows.length!=this.dataview.pagesize){this.dataview.updateview()}var k=this.dataview.rows.length;for(var d=0;d 0) {
+ for (var e = 0; e < f.length; e++) {
+ var b = f[e];
+ var g = d.getcolumn(b.datafield);
+ var h = d.getcellvalue(b.rowindex, b.datafield);
+ if (!g) {
+ continue
+ }
+ if (h !== "") {
+ var c = null;
+ if (g.columntype == "checkbox") {
+ if (!g.threestatecheckbox) {
+ c = false
+ }
+ }
+ d._raiseEvent(17, {
+ rowindex: b.rowindex,
+ datafield: b.datafield,
+ value: h
+ });
+ if (e == f.length - 1) {
+ d.setcellvalue(b.rowindex, b.datafield, c, true);
+ if (g.displayfield != g.datafield) {
+ d.setcellvalue(b.rowindex, g.displayfield, c, true)
+ }
+ } else {
+ d.setcellvalue(b.rowindex, b.datafield, c, false);
+ if (g.displayfield != g.datafield) {
+ d.setcellvalue(b.rowindex, g.displayfield, c, true)
+ }
+ }
+ d._raiseEvent(18, {
+ rowindex: b.rowindex,
+ datafield: b.datafield,
+ oldvalue: h,
+ value: c
+ })
+ }
+ }
+ this.dataview.updateview();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ },
+ copyselection: function() {
+ var n = "";
+ var s = this;
+ this.clipboardselection = {};
+ this.logicalclipboardselection = {};
+ this._clipboardselection = [];
+ var r = s.getselectedcells();
+ if (this.selectionmode.indexOf("cell") == -1) {
+ r = this._getcellsforcopypaste()
+ }
+ var b = 0;
+ var e = new Array();
+ if (r != null && r.length > 0) {
+ var t = 999999999999999;
+ var q = -1;
+ for (var j = 0; j < r.length; j++) {
+ var l = r[j];
+ var d = s.getcolumn(l.datafield);
+ if (d != null && d.clipboard && (!d.hidden || this.copytoclipboardhiddencolumns)) {
+ if (e.indexOf(d.text) == -1) {
+ e.push(d.text)
+ }
+ var p = s.getcelltext(l.rowindex, d.displayfield);
+ var h = this.getrowdisplayindex(l.rowindex);
+ if (!this.clipboardselection[h]) {
+ this.clipboardselection[h] = {}
+ }
+ this.clipboardselection[h][d.displayfield] = p;
+ if (!this.logicalclipboardselection[h]) {
+ this.logicalclipboardselection[h] = {}
+ }
+ this.logicalclipboardselection[h][d.displayfield] = p;
+ if (d.displayfield != d.datafield) {
+ this.logicalclipboardselection[h][d.datafield] = s.getcellvalue(l.rowindex, d.datafield)
+ }
+ t = Math.min(t, h);
+ q = Math.max(q, h)
+ }
+ }
+ var g = new Array();
+ for (var f = t; f <= q; f++) {
+ if (!this.logicalclipboardselection[f]) {
+ continue
+ }
+ var o = a.extend({},
+ this.logicalclipboardselection[f]);
+ g.push(o)
+ }
+ this.logicalclipboardselection = g;
+ if (this.copytoclipboardwithheaders) {
+ for (var c = 0; c < e.length; c++) {
+ if (c > 0) {
+ n += "\t"
+ }
+ n += e[c]
+ }
+ n += "\r\n"
+ }
+ for (var f = t; f <= q; f++) {
+ var k = 0;
+ this._clipboardselection[this._clipboardselection.length] = new Array();
+ if (this.clipboardselection[f] != undefined) {
+ a.each(this.clipboardselection[f],
+ function(i, m) {
+ if (k > 0) {
+ n += "\t"
+ }
+ var u = m;
+ if (m == null) {
+ u = ""
+ }
+ s._clipboardselection[s._clipboardselection.length - 1][k] = u;
+ k++;
+ n += u
+ })
+ } else {
+ continue
+ }
+ if (f < q) {
+ n += "\r\n"
+ }
+ }
+ }
+ this.clipboardselectedtext = n;
+ return n
+ },
+ pasteselection: function() {
+ var g = this.getselectedcells();
+ this._oldselectedcell = null;
+ if (this.selectionmode.indexOf("cell") == -1) {
+ g = this._getcellsforcopypaste()
+ }
+ if (g != null && g.length > 0) {
+ var h = g[0].rowindex;
+ var w = this.getrowdisplayindex(h);
+ var q = g[0].datafield;
+ var u = this._getcolumnindex(q);
+ var o = 0;
+ this.selectedrowindexes = new Array();
+ this.selectedcells = new Array();
+ var k = g.length;
+ var B = 0;
+ var d = new Array();
+ if (this.copytoclipboardwithheaders) {
+ this._clipboardselection.splice(0, 1)
+ }
+ for (var z = 0; z < this._clipboardselection.length; z++) {
+ B += this._clipboardselection[z].length;
+ d[z] = new Array();
+ for (var y = 0; y < this._clipboardselection[z].length; y++) {
+ var r = this._clipboardselection[z][y];
+ d[z].push(r)
+ }
+ }
+ if (B < g.length) {
+ var n = new Array();
+ for (var z = 0; z < g.length; z++) {
+ var e = g[z];
+ if (!n[e.rowindex]) {
+ n[e.rowindex] = new Array()
+ }
+ n[e.rowindex].push(e)
+ }
+ var A = 0;
+ var D = 0;
+ for (var z = 0; z < n.length; z++) {
+ if (!n[z]) {
+ continue
+ }
+ for (var y = 0; y < n[z].length; y++) {
+ var e = n[z][y];
+ var m = e.rowindex;
+ var f = this.getcolumn(e.datafield);
+ if (f.datafield === "_checkboxcolumn") {
+ continue
+ }
+ if (f.hidden) {
+ continue
+ }
+ var r = "";
+ if (!d[A][D]) {
+ D = 0
+ }
+ r = d[A][D];
+ D++;
+ if (f.cellsformat) {
+ if (f.cellsformat.indexOf("p") != -1 || f.cellsformat.indexOf("c") != -1 || f.cellsformat.indexOf("n") != -1 || f.cellsformat.indexOf("f") != -1) {
+ if (r.indexOf(this.gridlocalization.currencysymbol) > -1) {
+ r = r.replace(this.gridlocalization.currencysymbol, "")
+ }
+ var b = function(x, j, t) {
+ var c = x;
+ if (j == t) {
+ return x
+ }
+ var i = c.indexOf(j);
+ while (i != -1) {
+ c = c.replace(j, t);
+ i = c.indexOf(j)
+ }
+ return c
+ };
+ r = b(r, this.gridlocalization.thousandsseparator, "");
+ r = r.replace(this.gridlocalization.decimalseparator, ".");
+ if (r.indexOf(this.gridlocalization.percentsymbol) > -1) {
+ r = r.replace(this.gridlocalization.percentsymbol, "")
+ }
+ var E = "";
+ for (var s = 0; s < r.length; s++) {
+ var p = r.substring(s, s + 1);
+ if (p === "-") {
+ E += "-"
+ }
+ if (p === ".") {
+ E += "."
+ }
+ if (p.match(/^[0-9]+$/) != null) {
+ E += p
+ }
+ }
+ r = E;
+ r = r.replace(/ /g, "");
+ r = new Number(r);
+ if (isNaN(r)) {
+ r = ""
+ }
+ }
+ }
+ this._raiseEvent(17, {
+ rowindex: m,
+ datafield: e.datafield,
+ value: r
+ });
+ this.setcellvalue(m, f.displayfield, r, false);
+ if (f.displayfield != f.datafield && this.logicalclipboardselection) {
+ if (this.logicalclipboardselection[m]) {
+ var v = this.logicalclipboardselection[m][f.datafield];
+ if (v != undefined) {
+ this.setcellvalue(m, f.datafield, v, false)
+ }
+ }
+ }
+ this._raiseEvent(18, {
+ rowindex: m,
+ datafield: e.datafield,
+ oldvalue: this.getcellvalue(e.rowindex, e.datafield),
+ value: r
+ });
+ this._applycellselection(m, e.datafield, true, false)
+ }
+ A++;
+ if (!d[A]) {
+ A = 0
+ }
+ }
+ } else {
+ if (!this._clipboardselection) {
+ return
+ }
+ for (var l = 0; l < this._clipboardselection.length; l++) {
+ for (var C = 0; C < this._clipboardselection[l].length; C++) {
+ var f = this.getcolumnat(u + C);
+ if (!f) {
+ continue
+ }
+ if (f.datafield === "_checkboxcolumn") {
+ continue
+ }
+ if (f.hidden) {
+ continue
+ }
+ var m = this.getrowboundindex(w + l);
+ var e = this.getcell(m, f.datafield);
+ var r = null;
+ r = this._clipboardselection[l][C];
+ if (r != null) {
+ if (f.cellsformat) {
+ if (f.cellsformat.indexOf("p") != -1 || f.cellsformat.indexOf("c") != -1 || f.cellsformat.indexOf("n") != -1 || f.cellsformat.indexOf("f") != -1) {
+ if (r.indexOf(this.gridlocalization.currencysymbol) > -1) {
+ r = r.replace(this.gridlocalization.currencysymbol, "")
+ }
+ var b = function(x, j, t) {
+ var c = x;
+ if (j == t) {
+ return x
+ }
+ var i = c.indexOf(j);
+ while (i != -1) {
+ c = c.replace(j, t);
+ i = c.indexOf(j)
+ }
+ return c
+ };
+ r = b(r, this.gridlocalization.thousandsseparator, "");
+ r = r.replace(this.gridlocalization.decimalseparator, ".");
+ if (r.indexOf(this.gridlocalization.percentsymbol) > -1) {
+ r = r.replace(this.gridlocalization.percentsymbol, "")
+ }
+ var E = "";
+ for (var s = 0; s < r.length; s++) {
+ var p = r.substring(s, s + 1);
+ if (p === "-") {
+ E += "-"
+ }
+ if (p === ".") {
+ E += "."
+ }
+ if (p.match(/^[0-9]+$/) != null) {
+ E += p
+ }
+ }
+ r = E;
+ r = r.replace(/ /g, "");
+ r = new Number(r);
+ if (isNaN(r)) {
+ r = ""
+ }
+ }
+ }
+ this._raiseEvent(17, {
+ rowindex: m,
+ datafield: e.datafield,
+ value: r
+ });
+ this.setcellvalue(m, f.displayfield, r, false);
+ if (f.displayfield != f.datafield && this.logicalclipboardselection) {
+ var v = this.logicalclipboardselection[l][f.datafield];
+ if (v != undefined) {
+ this.setcellvalue(m, f.datafield, v, false)
+ }
+ }
+ this._raiseEvent(18, {
+ rowindex: m,
+ datafield: e.datafield,
+ oldvalue: this.getcellvalue(e.rowindex, e.datafield),
+ value: r
+ });
+ this._applycellselection(m, e.datafield, true, false)
+ }
+ }
+ }
+ }
+ if (this.selectionmode == "checkbox") {
+ this._updatecheckboxselection()
+ }
+ this.dataview.updateview();
+ this._renderrows(this.virtualsizeinfo)
+ }
+ if (this.clipboardend) {
+ this.clipboardend("paste")
+ }
+ },
+ _applyrowselection: function(e, i, f, h, b) {
+ if (e == null) {
+ return false
+ }
+ var j = this.selectedrowindex;
+ if (this.selectionmode == "singlerow") {
+ if (i) {
+ this._raiseEvent(2, {
+ rowindex: e,
+ row: this.getrowdata(e)
+ })
+ } else {
+ this._raiseEvent(3, {
+ rowindex: e,
+ row: this.getrowdata(e)
+ })
+ }
+ this._raiseEvent(3, {
+ rowindex: j
+ });
+ this.selectedrowindexes = new Array();
+ this.selectedcells = new Array()
+ }
+ if (h == true) {
+ this.selectedrowindexes = new Array()
+ }
+ if (this.dataview.filters.length > 0) {
+ var c = this.getrowdata(e);
+ if (c && c.dataindex !== undefined) {
+ e = c.dataindex
+ } else {
+ if (c && c.dataindex === undefined) {
+ if (c.uid != undefined) {
+ e = this.getrowboundindexbyid(c.uid)
+ }
+ }
+ }
+ }
+ var d = this.selectedrowindexes.indexOf(e);
+ if (i) {
+ this.selectedrowindex = e;
+ if (d == -1) {
+ this.selectedrowindexes.push(e);
+ if (this.selectionmode != "singlerow") {
+ this._raiseEvent(2, {
+ rowindex: e,
+ row: this.getrowdata(e)
+ })
+ }
+ } else {
+ if (this.selectionmode == "multiplerows") {
+ this.selectedrowindexes.splice(d, 1);
+ this._raiseEvent(3, {
+ rowindex: this.selectedrowindex,
+ row: this.getrowdata(e)
+ });
+ this.selectedrowindex = this.selectedrowindexes.length > 0 ? this.selectedrowindexes[this.selectedrowindexes.length - 1] : -1
+ }
+ }
+ } else {
+ if (d >= 0 || this.selectionmode == "singlerow" || this.selectionmode == "multiplerowsextended" || this.selectionmode == "multiplerowsadvanced") {
+ var g = this.selectedrowindexes[d];
+ this.selectedrowindexes.splice(d, 1);
+ this._raiseEvent(3, {
+ rowindex: g,
+ row: this.getrowdata(e)
+ });
+ this.selectedrowindex = -1
+ }
+ }
+ if (f == undefined || f) {
+ this._rendervisualrows()
+ }
+ return true
+ },
+ _applycellselection: function(e, b, h, f) {
+ if (e == null) {
+ return false
+ }
+ if (b == null) {
+ return false
+ }
+ var j = this.selectedrowindex;
+ if (this.selectionmode == "singlecell") {
+ var d = this.selectedcell;
+ if (d != null) {
+ this._raiseEvent(16, {
+ rowindex: d.rowindex,
+ datafield: d.datafield
+ })
+ }
+ this.selectedcells = new Array()
+ }
+ if (this.selectionmode == "multiplecellsextended" || this.selectionmode == "multiplecellsadvanced") {
+ var d = this.selectedcell;
+ if (d != null) {
+ this._raiseEvent(16, {
+ rowindex: d.rowindex,
+ datafield: d.datafield
+ })
+ }
+ }
+ var g = e + "_" + b;
+ if (this.dataview.filters.length > 0) {
+ var c = this.getrowdata(e);
+ if (c && c.dataindex !== undefined) {
+ e = c.dataindex;
+ var g = e + "_" + b
+ } else {
+ if (c && c.dataindex === undefined) {
+ if (c.uid) {
+ e = this.getrowboundindexbyid(c.uid);
+ var g = e + "_" + b
+ }
+ }
+ }
+ }
+ var i = {
+ rowindex: e,
+ datafield: b
+ };
+ if (h) {
+ this.selectedcell = i;
+ if (!this.selectedcells[g]) {
+ this.selectedcells[g] = i;
+ this.selectedcells.length++;
+ this._raiseEvent(15, i)
+ } else {
+ if (this.selectionmode == "multiplecells" || this.selectionmode == "multiplecellsextended" || this.selectionmode == "multiplecellsadvanced") {
+ delete this.selectedcells[g];
+ if (this.selectedcells.length > 0) {
+ this.selectedcells.length--
+ }
+ this._raiseEvent(16, i)
+ }
+ }
+ } else {
+ delete this.selectedcells[g];
+ if (this.selectedcells.length > 0) {
+ this.selectedcells.length--
+ }
+ this._raiseEvent(16, i)
+ }
+ if (f == undefined || f) {
+ this._rendervisualrows()
+ }
+ return true
+ },
+ _getcellindex: function(b) {
+ var c = -1;
+ a.each(this.selectedcells,
+ function() {
+ c++;
+ if (this[b]) {
+ return false
+ }
+ });
+ return c
+ },
+ _clearhoverstyle: function() {
+ if (undefined == this.hoveredrow || this.hoveredrow == -1) {
+ return
+ }
+ if (this.vScrollInstance.isScrolling()) {
+ return
+ }
+ if (this.hScrollInstance.isScrolling()) {
+ return
+ }
+ var b = this.table.find(".jqx-grid-cell-hover");
+ if (b.length > 0) {
+ b.removeClass(this.toTP("jqx-grid-cell-hover"));
+ b.removeClass(this.toTP("jqx-fill-state-hover"))
+ }
+ this.hoveredrow = -1
+ },
+ _clearselectstyle: function() {
+ var k = this.table[0].rows.length;
+ var p = this.table[0].rows;
+ var l = this.toTP("jqx-grid-cell-selected");
+ var c = this.toTP("jqx-fill-state-pressed");
+ var m = this.toTP("jqx-grid-cell-hover");
+ var h = this.toTP("jqx-fill-state-hover");
+ for (var g = 0; g < k; g++) {
+ var b = p[g];
+ var f = b.cells.length;
+ var o = b.cells;
+ for (var e = 0; e < f; e++) {
+ var d = o[e];
+ var n = a(d);
+ if (d.className.indexOf("jqx-grid-cell-selected") != -1) {
+ n.removeClass(l);
+ n.removeClass(c)
+ }
+ if (d.className.indexOf("jqx-grid-cell-hover") != -1) {
+ n.removeClass(m);
+ n.removeClass(h)
+ }
+ }
+ }
+ },
+ _selectpath: function(n, e) {
+ var l = this;
+ var i = this._lastClickedCell ? Math.min(this._lastClickedCell.row, n) : 0;
+ var k = this._lastClickedCell ? Math.max(this._lastClickedCell.row, n) : 0;
+ if (i <= k) {
+ var h = this._getcolumnindex(this._lastClickedCell.column);
+ var g = this._getcolumnindex(e);
+ var f = Math.min(h, g);
+ var d = Math.max(h, g);
+ this.selectedcells = new Array();
+ var m = this.dataview.loadedrecords;
+ for (var b = i; b <= k; b++) {
+ for (var j = f; j <= d; j++) {
+ var n = m[b];
+ this._applycellselection(l.getboundindex(n), l._getcolumnat(j).datafield, true, false)
+ }
+ }
+ this._rendervisualrows()
+ }
+ },
+ _selectrowpath: function(g) {
+ if (this.selectionmode == "multiplerowsextended") {
+ var c = this;
+ var b = this._lastClickedCell ? Math.min(this._lastClickedCell.row, g) : 0;
+ var h = this._lastClickedCell ? Math.max(this._lastClickedCell.row, g) : 0;
+ var f = this.dataview.loadedrecords;
+ if (b <= h) {
+ this.selectedrowindexes = new Array();
+ for (var e = b; e <= h; e++) {
+ var g = f[e];
+ var d = this.getrowboundindex(e);
+ this._applyrowselection(d, true, false)
+ }
+ this._rendervisualrows()
+ }
+ }
+ },
+ _selectrowwithmouse: function(p, b, c, f, d, s) {
+ var j = b.row;
+ if (j == undefined) {
+ return
+ }
+ var k = b.index;
+ if (this.hittestinfo[k] == undefined) {
+ return
+ }
+ var t = this.hittestinfo[k].visualrow;
+ if (this.hittestinfo[k].details) {
+ return
+ }
+ var m = t.cells[0].className;
+ if (j.group) {
+ return
+ }
+ if (this.selectionmode == "multiplerows" || this.selectionmode == "multiplecells" || this.selectionmode == "checkbox" || (this.selectionmode.indexOf("multiple") != -1 && (s == true || d == true))) {
+ var l = this.getboundindex(j);
+ if (this.dataview.filters.length > 0) {
+ var v = this.getrowdata(l);
+ if (v) {
+ l = v.dataindex;
+ if (l == undefined) {
+ var l = this.getboundindex(j)
+ }
+ }
+ }
+ var q = c.indexOf(l) != -1;
+ var w = this.getboundindex(j) + "_" + f;
+ if (this.selectionmode.indexOf("cell") != -1) {
+ var h = this.selectedcells[w] != undefined;
+ if (this.selectedcells[w] != undefined && h) {
+ this._selectcellwithstyle(p, false, k, f, t)
+ } else {
+ this._selectcellwithstyle(p, true, k, f, t)
+ }
+ if (s && this._lastClickedCell == undefined) {
+ var g = this.getselectedcells();
+ if (g && g.length > 0) {
+ this._lastClickedCell = {
+ row: g[0].rowindex,
+ column: g[0].datafield
+ }
+ }
+ }
+ if (s && this._lastClickedCell) {
+ this._selectpath(j.visibleindex, f);
+ this.mousecaptured = false;
+ if (this.selectionarea.css("visibility") == "visible") {
+ this.selectionarea.css("visibility", "hidden")
+ }
+ }
+ } else {
+ if (q) {
+ if (d) {
+ this._applyrowselection(this.getboundindex(j), false)
+ } else {
+ this._selectrowwithstyle(p, t, false, f)
+ }
+ } else {
+ this._selectrowwithstyle(p, t, true, f)
+ }
+ if (s && this._lastClickedCell == undefined) {
+ var i = this.getselectedrowindexes();
+ if (i && i.length > 0) {
+ this._lastClickedCell = {
+ row: i[0],
+ column: f
+ }
+ }
+ }
+ if (s && this._lastClickedCell) {
+ this.selectedrowindexes = new Array();
+ var e = this._lastClickedCell ? Math.min(this._lastClickedCell.row, j.visibleindex) : 0;
+ var u = this._lastClickedCell ? Math.max(this._lastClickedCell.row, j.visibleindex) : 0;
+ var n = this.dataview.loadedrecords;
+ for (var o = e; o <= u; o++) {
+ var j = n[o];
+ if (j) {
+ this._applyrowselection(this.getboundindex(j), true, false, false)
+ }
+ }
+ this._rendervisualrows()
+ }
+ }
+ } else {
+ this._clearselectstyle();
+ this._selectrowwithstyle(p, t, true, f);
+ if (this.selectionmode.indexOf("cell") != -1) {
+ this._selectcellwithstyle(p, true, k, f, t)
+ }
+ }
+ if (!s) {
+ this._lastClickedCell = {
+ row: j.visibleindex,
+ column: f
+ }
+ }
+ },
+ _selectcellwithstyle: function(d, c, g, f, e) {
+ var b = a(e.cells[d._getcolumnindex(f)]);
+ b.removeClass(this.toTP("jqx-grid-cell-hover"));
+ b.removeClass(this.toTP("jqx-fill-state-hover"));
+ if (c) {
+ b.addClass(this.toTP("jqx-grid-cell-selected"));
+ b.addClass(this.toTP("jqx-fill-state-pressed"))
+ } else {
+ b.removeClass(this.toTP("jqx-grid-cell-selected"));
+ b.removeClass(this.toTP("jqx-fill-state-pressed"))
+ }
+ },
+ _selectrowwithstyle: function(e, h, b, j) {
+ var c = h.cells.length;
+ var f = 0;
+ if (e.rowdetails && e.showrowdetailscolumn) {
+ if (!this.rtl) {
+ f = 1 + this.groups.length
+ } else {
+ c -= 1;
+ c -= this.groups.length
+ }
+ } else {
+ if (this.groupable) {
+ if (!this.rtl) {
+ f = this.groups.length
+ } else {
+ c -= this.groups.length
+ }
+ }
+ }
+ for (var g = f; g < c; g++) {
+ var d = h.cells[g];
+ if (b) {
+ a(d).removeClass(this.toTP("jqx-grid-cell-hover"));
+ a(d).removeClass(this.toTP("jqx-fill-state-hover"));
+ if (e.selectionmode.indexOf("cell") == -1) {
+ a(d).addClass(this.toTP("jqx-grid-cell-selected"));
+ a(d).addClass(this.toTP("jqx-fill-state-pressed"))
+ }
+ } else {
+ a(d).removeClass(this.toTP("jqx-grid-cell-hover"));
+ a(d).removeClass(this.toTP("jqx-grid-cell-selected"));
+ a(d).removeClass(this.toTP("jqx-fill-state-hover"));
+ a(d).removeClass(this.toTP("jqx-fill-state-pressed"))
+ }
+ }
+ },
+ _handlemousemoveselection: function(ab, o) {
+ if (o.hScrollInstance.isScrolling() || o.vScrollInstance.isScrolling()) {
+ return false
+ }
+ if ((o.selectionmode == "multiplerowsextended" || o.selectionmode == "multiplecellsextended" || o.selectionmode == "multiplecellsadvanced") && o.mousecaptured) {
+ if (o.multipleselectionbegins) {
+ var b = o.multipleselectionbegins(ab);
+ if (b === false) {
+ return true
+ }
+ }
+ var aa = this.showheader ? this.columnsheader.height() + 2 : 0;
+ var I = this._groupsheader() ? this.groupsheader.height() : 0;
+ var K = this.showtoolbar ? this.toolbar.height() : 0;
+ I += K;
+ var Z = this.host.coord();
+ if (this.hasTransform) {
+ Z = a.jqx.utilities.getOffset(this.host);
+ var ad = this._getBodyOffset();
+ Z.left -= ad.left;
+ Z.top -= ad.top
+ }
+ if (this.host.css("border-top-width") === "0px") {
+ I -= 2
+ }
+ var M = ab.pageX;
+ var L = ab.pageY - I;
+ if (Math.abs(this.mousecaptureposition.left - M) > 3 || Math.abs(this.mousecaptureposition.top - L) > 3) {
+ var f = parseInt(this.columnsheader.coord().top);
+ if (this.hasTransform) {
+ f = a.jqx.utilities.getOffset(this.columnsheader).top
+ }
+ if (M < Z.left) {
+ M = Z.left
+ }
+ if (M > Z.left + this.host.width()) {
+ M = Z.left + this.host.width()
+ }
+ var X = Z.top + aa;
+ if (L < X) {
+ L = X + 5
+ }
+ var J = parseInt(Math.min(o.mousecaptureposition.left, M));
+ var g = -5 + parseInt(Math.min(o.mousecaptureposition.top, L));
+ var H = parseFloat(Math.abs(o.mousecaptureposition.left - M));
+ var P = parseInt(Math.abs(o.mousecaptureposition.top - L));
+ J -= Z.left;
+ g -= Z.top;
+ this.selectionarea.css("visibility", "visible");
+ if (o.selectionmode == "multiplecellsadvanced") {
+ var M = J;
+ var t = M + H;
+ var G = M;
+ var n = o.hScrollInstance;
+ var v = n.value;
+ if (this.rtl) {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ v = n.max - n.value
+ }
+ if (this.vScrollBar[0].style.visibility != "hidden") {}
+ }
+ var h = o.table[0].rows[0];
+ var T = 0;
+ var B = o.mousecaptureposition.clickedcell;
+ var A = B;
+ var m = false;
+ var r = 0;
+ var ac = h.cells.length;
+ if (o.mousecaptureposition.left <= ab.pageX) {
+ r = B
+ }
+ for (var W = r; W < ac; W++) {
+ var Y = parseFloat(a(this.columnsrow[0].cells[W]).css("left"));
+ var j = Y - v;
+ if (o.columns.records[W].pinned) {
+ j = Y;
+ continue
+ }
+ var O = this._getcolumnat(W);
+ if (O != null && O.hidden) {
+ continue
+ }
+ if (o.groupable && o.groups.length > 0) {
+ if (W < o.groups.length) {
+ continue
+ }
+ }
+ var S = j + a(this.columnsrow[0].cells[W]).width();
+ if (o.mousecaptureposition.left > ab.pageX) {
+ if (S >= M && M >= j) {
+ A = W;
+ m = true;
+ break
+ }
+ } else {
+ if (S >= t && t >= j) {
+ A = W;
+ m = true;
+ break
+ }
+ }
+ }
+ if (!m) {
+ if (o.mousecaptureposition.left > ab.pageX) {
+ a.each(this.columns.records,
+ function(i, k) {
+ if (o.groupable && o.groups.length > 0) {
+ if (i < o.groups.length) {
+ return true
+ }
+ }
+ if (!this.pinned && !this.hidden) {
+ A = i;
+ return false
+ }
+ })
+ } else {
+ if (!o.groupable || (o.groupable && !o.groups.length > 0)) {
+ A = h.cells.length - 1
+ }
+ }
+ }
+ var N = B;
+ B = Math.min(B, A);
+ A = Math.max(N, A);
+ g += 5;
+ g += I;
+ var R = o.table[0].rows.indexOf(o.mousecaptureposition.clickedrow);
+ var w = 0;
+ var e = -1;
+ var u = -1;
+ var d = 0;
+ for (var W = 0; W < o.table[0].rows.length; W++) {
+ var s = a(o.table[0].rows[W]);
+ if (W == 0) {
+ d = s.coord().top
+ }
+ var F = s.height();
+ var z = d - Z.top;
+ if (e == -1 && z + F >= g) {
+ var c = false;
+ for (var Q = 0; Q < o.groups.length; Q++) {
+ var V = s[0].cells[Q].className;
+ if (V.indexOf("jqx-grid-group-collapse") != -1 || V.indexOf("jqx-grid-group-expand") != -1) {
+ c = true;
+ break
+ }
+ }
+ if (c) {
+ continue
+ }
+ e = W
+ }
+ d += F;
+ if (o.groupable && o.groups.length > 0) {
+ var c = false;
+ for (var Q = 0; Q < o.groups.length; Q++) {
+ var V = s[0].cells[Q].className;
+ if (V.indexOf("jqx-grid-group-collapse") != -1 || V.indexOf("jqx-grid-group-expand") != -1) {
+ c = true;
+ break
+ }
+ }
+ if (c) {
+ continue
+ }
+ var T = 0;
+ for (var U = o.groups.length; U < s[0].cells.length; U++) {
+ var E = s[0].cells[U];
+ if (a(E).html() == "") {
+ T++
+ }
+ }
+ if (T == s[0].cells.length - o.groups.length) {
+ continue
+ }
+ }
+ if (e != -1) {
+ w += F
+ }
+ if (z + F > g + P) {
+ u = W;
+ break
+ }
+ }
+ if (e != -1) {
+ g = a(o.table[0].rows[e]).coord().top - Z.top - I - 2;
+ var D = 0;
+ if (this.filterable && this.showfilterrow) {
+ D = this.filterrowheight
+ }
+ if (parseFloat(o.table[0].style.top) < 0 && g < this.rowsheight + D) {
+ g -= parseFloat(o.table[0].style.top);
+ w += parseFloat(o.table[0].style.top)
+ }
+ P = w;
+ var l = a(this.columnsrow[0].cells[B]);
+ var C = a(this.columnsrow[0].cells[A]);
+ J = parseFloat(l.css("left"));
+ H = parseFloat(C.css("left")) - parseFloat(J) + C.width() - 2;
+ J -= v;
+ if (o.editcell && o.editable && o.endcelledit && (B != A || e != u)) {
+ if (o.editcell.validated == false) {
+ return
+ }
+ o.endcelledit(o.editcell.row, o.editcell.column, true, true)
+ }
+ }
+ }
+ this.selectionarea.width(H);
+ this.selectionarea.height(P);
+ this.selectionarea.css("left", J);
+ this.selectionarea.css("top", g)
+ }
+ }
+ },
+ _handlemouseupselection: function(u, o) {
+ if (!this.selectionarea) {
+ return
+ }
+ if (this.selectionarea[0].style.visibility != "visible") {
+ o.mousecaptured = false;
+ return true
+ }
+ if (o.mousecaptured && (o.selectionmode == "multiplerowsextended" || o.selectionmode == "multiplerowsadvanced" || o.selectionmode == "multiplecellsextended" || o.selectionmode == "multiplecellsadvanced")) {
+ o.mousecaptured = false;
+ if (this.selectionarea.css("visibility") == "visible") {
+ this.selectionarea.css("visibility", "hidden");
+ var w = this.showheader ? this.columnsheader.height() + 2 : 0;
+ var p = this._groupsheader() ? this.groupsheader.height() : 0;
+ if (this.host.css("border-top-width") === "0px") {
+ p -= 2
+ }
+ var B = this.showtoolbar ? this.toolbar.height() : 0;
+ p += B;
+ var C = this.selectionarea.coord();
+ var c = this.host.coord();
+ if (this.hasTransform) {
+ c = a.jqx.utilities.getOffset(this.host);
+ C = a.jqx.utilities.getOffset(this.selectionarea)
+ }
+ if (this.host.css("border-top-width") === "0px") {
+ p -= 2
+ }
+ var n = C.left - c.left;
+ var k = C.top - w - c.top - p;
+ var s = k;
+ var g = n + this.selectionarea.width();
+ var D = n;
+ var l = new Array();
+ var e = new Array();
+ if (o.selectionmode == "multiplerowsextended") {
+ while (k < s + this.selectionarea.height()) {
+ var b = this._hittestrow(n, k);
+ var f = b.row;
+ var h = b.index;
+ if (h != -1) {
+ if (!e[h]) {
+ e[h] = true;
+ l[l.length] = b
+ }
+ }
+ k += 20
+ }
+ var s = 0;
+ a.each(l,
+ function() {
+ var i = this;
+ var m = this.row;
+ if (o.selectionmode != "none" && o._selectrowwithmouse) {
+ if (u.ctrlKey || u.metaKey) {
+ o._applyrowselection(o.getboundindex(m), true, false, false)
+ } else {
+ if (s == 0) {
+ o._applyrowselection(o.getboundindex(m), true, false, true)
+ } else {
+ o._applyrowselection(o.getboundindex(m), true, false, false)
+ }
+ }
+ s++
+ }
+ })
+ } else {
+ if (o.selectionmode == "multiplecellsadvanced") {
+ k += 2
+ }
+ var r = o.hScrollInstance;
+ var t = r.value;
+ if (this.rtl) {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ t = r.max - r.value
+ }
+ if (this.vScrollBar[0].style.visibility != "hidden") {
+ t -= this.scrollbarsize + 4
+ }
+ }
+ var q = o.table[0].rows[0];
+ var j = o.selectionarea.height();
+ if (!u.ctrlKey && !u.metaKey && j > 0) {
+ o.selectedcells = new Array()
+ }
+ var A = j;
+ while (k < s + A) {
+ var b = o._hittestrow(n, k);
+ if (!b) {
+ k += 5;
+ continue
+ }
+ var f = b.row;
+ var h = b.index;
+ if (h != -1) {
+ if (!e[h]) {
+ e[h] = true;
+ for (var v = 0; v < q.cells.length; v++) {
+ var d = parseFloat(a(o.columnsrow[0].cells[v]).css("left")) - t;
+ var z = d + a(o.columnsrow[0].cells[v]).width();
+ if ((D >= d && D <= z) || (g >= d && g <= z) || (d >= D && d <= g)) {
+ o._applycellselection(o.getboundindex(f), o._getcolumnat(v).datafield, true, false)
+ }
+ }
+ }
+ }
+ k += 5
+ }
+ }
+ if (o.autosavestate) {
+ if (o.savestate) {
+ o.savestate()
+ }
+ }
+ o._renderrows(o.virtualsizeinfo)
+ }
+ }
+ },
+ selectprevcell: function(e, c) {
+ var f = this._getcolumnindex(c);
+ var b = this.columns.records.length;
+ var d = this._getprevvisiblecolumn(f);
+ if (d != null) {
+ this.clearselection();
+ this.selectcell(e, d.datafield)
+ }
+ },
+ selectnextcell: function(e, d) {
+ var f = this._getcolumnindex(d);
+ var c = this.columns.records.length;
+ var b = this._getnextvisiblecolumn(f);
+ if (b != null) {
+ this.clearselection();
+ this.selectcell(e, b.datafield)
+ }
+ },
+ _getfirstvisiblecolumn: function() {
+ var b = this;
+ var e = this.columns.records.length;
+ for (var c = 0; c < e; c++) {
+ var d = this.columns.records[c];
+ if (!d.hidden && d.datafield != null) {
+ return d
+ }
+ }
+ return null
+ },
+ _getlastvisiblecolumn: function() {
+ var b = this;
+ var e = this.columns.records.length;
+ for (var c = e - 1; c >= 0; c--) {
+ var d = this.columns.records[c];
+ if (!d.hidden && d.datafield != null) {
+ return d
+ }
+ }
+ return null
+ },
+ _handlekeydown: function(A, t) {
+ if (t.groupable && t.groups.length > 0) {}
+ if (t.disabled) {
+ return false
+ }
+ var H = A.charCode ? A.charCode: A.keyCode ? A.keyCode: 0;
+ if (t.editcell && t.selectionmode != "multiplecellsadvanced") {
+ return true
+ } else {
+ if (t.editcell && t.selectionmode == "multiplecellsadvanced") {
+ if (H >= 33 && H <= 40) {
+ if (!A.altKey) {
+ if (t._cancelkeydown == undefined || t._cancelkeydown == false) {
+ if (t.editmode !== "selectedrow") {
+ t.endcelledit(t.editcell.row, t.editcell.column, false, true);
+ t._cancelkeydown = false;
+ if (t.editcell && !t.editcell.validated) {
+ t._rendervisualrows();
+ t.endcelledit(t.editcell.row, t.editcell.column, false, true);
+ return false
+ }
+ } else {
+ return true
+ }
+ } else {
+ t._cancelkeydown = false;
+ return true
+ }
+ } else {
+ t._cancelkeydown = false;
+ return true
+ }
+ } else {
+ return true
+ }
+ }
+ }
+ if (t.selectionmode == "none") {
+ return true
+ }
+ if (t.showfilterrow && t.filterable) {
+ if (this.filterrow) {
+ if (a(A.target).ischildof(t.filterrow)) {
+ return true
+ }
+ }
+ }
+ if (t.showeverpresentrow) {
+ if (t.addnewrowtop) {
+ if (a(A.target).ischildof(t.addnewrowtop)) {
+ return true
+ }
+ }
+ if (t.addnewrowbottom) {
+ if (a(A.target).ischildof(t.addnewrowbottom)) {
+ return true
+ }
+ }
+ }
+ if (t.pageable) {
+ if (a(A.target).ischildof(this.pager)) {
+ return true
+ }
+ }
+ if (this.showtoolbar) {
+ if (a(A.target).ischildof(this.toolbar)) {
+ return true
+ }
+ }
+ if (this.showstatusbar) {
+ if (a(A.target).ischildof(this.statusbar)) {
+ return true
+ }
+ }
+ var r = false;
+ if (A.altKey) {
+ return true
+ }
+ /*
+ if (A.ctrlKey || A.metaKey) {
+ if (this.clipboard) {
+ var b = String.fromCharCode(H).toLowerCase();
+ if (this.clipboardbegin) {
+ var j = null;
+ if (b == "c") {
+ //j = this.clipboardbegin("copy", this.copyselection())
+ } else {
+ if (b == "x") {
+ //j = this.clipboardbegin("cut", this.copyselection())
+ } else {
+ if (b == "v") {
+ j = this.clipboardbegin("paste")
+ }
+ }
+ }
+ if (j === false) {
+ return false
+ }
+ }
+ if (b == "c" || b == "x") {
+ var q = this.copyselection();
+ if (b == "c" && this.clipboardend) {
+ this.clipboardend("copy")
+ }
+ if (b == "x" && this.clipboardend) {
+ this.clipboardend("cut")
+ }
+ if (window.clipboardData) {
+ window.clipboardData.setData("Text", q)
+ } else {
+ var g = a('');
+ g.val(q);
+ a("body").append(g);
+ g.select();
+ setTimeout(function() {
+ document.designMode = "off";
+ g.select();
+ g.remove();
+ t.focus()
+ },
+ 100)
+ }
+ if (b == "c" && a.jqx.browser.msie) {
+ return false
+ } else {
+ if (b == "c") {
+ return true
+ }
+ }
+ } else {
+ if (b == "v") {
+ var F = a('');
+ a("body").append(F);
+ F.select();
+ var k = this;
+ setTimeout(function() {
+ k._clipboardselection = new Array();
+ var M = F.val();
+ if (M.length == 0 && window.clipboardData) {
+ F.val(window.clipboardData.getData("Text"));
+ var M = F.val()
+ }
+ var L = M.split("\n");
+ for (var K = 0; K < L.length; K++) {
+ if (L[K].split("\t").length > 0) {
+ var J = L[K].split("\t");
+ if (J.length == 1 && K == L.length - 1 && J[0] == "") {
+ continue
+ }
+ if (J.length > 0) {
+ k._clipboardselection.push(J)
+ }
+ }
+ }
+ k.pasteselection();
+ F.remove();
+ k.focus()
+ },
+ 100);
+ return true
+ }
+ }
+ if (b == "x") {
+ this.deleteselection();
+ this.host.focus();
+ return false
+ }
+ }
+ }
+ */
+ var n = Math.round(t._gettableheight());
+ var y = Math.round(n / t.rowsheight);
+ var f = t.getdatainformation();
+ switch (t.selectionmode) {
+ case "singlecell":
+ case "multiplecells":
+ case "multiplecellsextended":
+ case "multiplecellsadvanced":
+ var I = t.getselectedcell();
+ if (I != null) {
+ var e = this.getrowvisibleindex(I.rowindex);
+ var i = e;
+ var p = I.datafield;
+ var w = t._getcolumnindex(p);
+ var c = t.columns.records.length;
+ var v = function(Q, K, P, O) {
+ var J = function(ab, U) {
+ var W = t.dataview.loadedrecords[ab];
+ if (t.groupable && t.groups.length > 0) {
+ var X = ab;
+ if (O == "up") {
+ X++
+ }
+ if (O == "down") {
+ X--
+ }
+ var W = t.getdisplayrows()[X];
+ var R = function(ac) {
+ if (ac.group) {
+ if (t.expandedgroups[ac.uniqueid]) {
+ return t.expandedgroups[ac.uniqueid].expanded
+ }
+ } else {
+ return false
+ }
+ };
+ var Z = 1;
+ var S = true;
+ while (S && Z < 300) {
+ S = false;
+ if (O == "down") {
+ W = t.getdisplayrows()[X + Z]
+ } else {
+ if (O == "up") {
+ W = t.getdisplayrows()[X - Z]
+ }
+ }
+ if (!W) {
+ break
+ }
+ if (W && W.group) {
+ S = true
+ }
+ var aa = W.parentItem;
+ while (aa) {
+ if (aa && !R(aa)) {
+ S = true
+ }
+ aa = aa.parentItem
+ }
+ if (!S) {
+ break
+ }
+ Z++
+ }
+ if (Z == 300) {
+ W = null
+ }
+ if (t.pageable) {
+ var Y = false;
+ if (W) {
+ for (var V = 0; V < t.dataview.rows.length; V++) {
+ if (t.dataview.rows[V].boundindex == W.boundindex) {
+ Y = true
+ }
+ }
+ if (!Y) {
+ W = null
+ }
+ }
+ }
+ }
+ if (W != undefined && U != null) {
+ if (P || P == undefined) {
+ t.clearselection()
+ }
+ var T = t.getboundindex(W);
+ t.selectcell(T, U);
+ t._oldselectedcell = t.selectedcell;
+ r = true;
+ t.ensurecellvisible(ab, U);
+ return true
+ }
+ return false
+ };
+ if (!J(Q, K)) {
+ t.ensurecellvisible(Q, K);
+ J(Q, K);
+ if (t.virtualmode) {
+ t.host.focus()
+ }
+ }
+ var M = t.groupable && t.groups.length > 0;
+ if (!M) {
+ if (A.shiftKey && A.keyCode != 9) {
+ if (t.selectionmode == "multiplecellsextended" || t.selectionmode == "multiplecellsadvanced") {
+ if (t._lastClickedCell) {
+ t._selectpath(Q, K);
+ var N = t.dataview.loadedrecords[Q];
+ var L = t.getboundindex(N);
+ t.selectedcell = {
+ rowindex: L,
+ datafield: K
+ };
+ return
+ }
+ }
+ } else {
+ if (!A.shiftKey) {
+ t._lastClickedCell = {
+ row: Q,
+ column: K
+ }
+ }
+ }
+ }
+ };
+ var B = A.shiftKey && t.selectionmode != "singlecell" && t.selectionmode != "multiplecells";
+ var C = function() {
+ v(0, p, !B)
+ };
+ var h = function() {
+ var J = f.rowscount - 1;
+ v(J, p, !B)
+ };
+ var d = H == 9 && !A.shiftKey;
+ var m = H == 9 && A.shiftKey;
+ if (t.rtl) {
+ var s = d;
+ d = m;
+ m = s
+ }
+ if (d || m) {
+ B = false
+ }
+ if (d || m) {
+ if (document.activeElement && document.activeElement.className && document.activeElement.className.indexOf("jqx-grid-cell-add-new-row") >= 0) {
+ return true
+ }
+ }
+ var o = A.ctrlKey || A.metaKey;
+ if (o && H == 37) {
+ var E = t._getfirstvisiblecolumn(w);
+ if (E != null) {
+ v(i, E.datafield)
+ }
+ } else {
+ if (o && H == 39) {
+ var u = t._getlastvisiblecolumn(w);
+ if (u != null) {
+ v(i, u.datafield)
+ }
+ } else {
+ if (H == 39 || d) {
+ var x = t._getnextvisiblecolumn(w);
+ if (x != null) {
+ v(i, x.datafield, !B)
+ } else {
+ if (!d) {
+ r = true
+ } else {
+ var G = t._getfirstvisiblecolumn();
+ H = 40;
+ p = G.displayfield
+ }
+ }
+ } else {
+ if (H == 37 || m) {
+ var E = t._getprevvisiblecolumn(w);
+ if (E != null) {
+ v(i, E.datafield, !B)
+ } else {
+ if (!m) {
+ r = true
+ } else {
+ var l = t._getlastvisiblecolumn();
+ H = 38;
+ p = l.displayfield
+ }
+ }
+ } else {
+ if (H == 36) {
+ C()
+ } else {
+ if (H == 35) {
+ h()
+ } else {
+ if (H == 33) {
+ if (i - y >= 0) {
+ var D = i - y;
+ v(D, p, !B)
+ } else {
+ C()
+ }
+ } else {
+ if (H == 34) {
+ if (f.rowscount > i + y) {
+ var D = i + y;
+ v(D, p, !B)
+ } else {
+ h()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (H == 38) {
+ if (o) {
+ C()
+ } else {
+ if (i > 0) {
+ v(i - 1, p, !B, "up")
+ } else {
+ r = true
+ }
+ }
+ }
+ if (H == 40) {
+ if (o) {
+ h()
+ } else {
+ if ((f.rowscount > i + 1) || (t.groupable && t.groups.length > 0)) {
+ v(i + 1, p, !B, "down")
+ } else {
+ r = true
+ }
+ }
+ }
+ }
+ break;
+ case "singlerow":
+ case "multiplerows":
+ case "multiplerowsextended":
+ case "multiplerowsadvanced":
+ var i = t.getselectedrowindex();
+ if (i == null || i == -1) {
+ return true
+ }
+ i = this.getrowvisibleindex(i);
+ var z = function(K, N, M) {
+ var J = function(V) {
+ var U = t.dataview.loadedrecords[V];
+ if (t.groupable && t.groups.length > 0) {
+ if (M == "up") {
+ V++
+ }
+ if (M == "down") {
+ V--
+ }
+ var U = t.getdisplayrows()[V];
+ var O = function(Z) {
+ if (Z.group) {
+ if (t.expandedgroups[Z.uniqueid]) {
+ return t.expandedgroups[Z.uniqueid].expanded
+ }
+ } else {
+ return false
+ }
+ };
+ var X = 1;
+ var P = true;
+ while (P && X < 300) {
+ P = false;
+ if (M == "down") {
+ U = t.getdisplayrows()[V + X]
+ } else {
+ if (M == "up") {
+ U = t.getdisplayrows()[V - X]
+ }
+ }
+ if (!U) {
+ break
+ }
+ if (U && U.group) {
+ P = true
+ }
+ var Y = U.parentItem;
+ while (Y) {
+ if (Y && !O(Y)) {
+ P = true
+ }
+ Y = Y.parentItem
+ }
+ if (!P) {
+ break
+ }
+ X++
+ }
+ if (X == 300) {
+ U = null
+ }
+ if (t.pageable) {
+ var W = false;
+ if (U) {
+ for (var T = 0; T < t.dataview.rows.length; T++) {
+ if (t.dataview.rows[T].boundindex == U.boundindex) {
+ W = true
+ }
+ }
+ if (!W) {
+ U = null
+ }
+ }
+ }
+ }
+ if (U != undefined) {
+ var Q = t.getboundindex(U);
+ var S = t.selectedrowindex;
+ if (N || N == undefined) {
+ t.clearselection()
+ }
+ t.selectedrowindex = S;
+ t.selectrow(Q, false);
+ var R = t.ensurerowvisible(V);
+ if (!R || t.autoheight || t.groupable) {
+ t._rendervisualrows()
+ }
+ r = true;
+ return true
+ }
+ return false
+ };
+ if (!J(K)) {
+ t.ensurerowvisible(K);
+ J(K, N);
+ if (t.virtualmode) {
+ setTimeout(function() {
+ J(K, N)
+ },
+ 25)
+ }
+ if (t.virtualmode) {
+ t.host.focus()
+ }
+ }
+ var L = t.groupable && t.groups.length > 0;
+ if (!L) {
+ if (A.shiftKey && H != 9) {
+ if (t.selectionmode == "multiplerowsextended") {
+ if (t._lastClickedCell) {
+ t._selectrowpath(K);
+ t.selectedrowindex = t.getrowboundindex(K);
+ return
+ }
+ }
+ } else {
+ if (!A.shiftKey) {
+ t._lastClickedCell = {
+ row: K
+ };
+ t.selectedrowindex = t.getrowboundindex(K)
+ }
+ }
+ }
+ };
+ var B = A.shiftKey && t.selectionmode != "singlerow" && t.selectionmode != "multiplerows";
+ var C = function() {
+ z(0, !B)
+ };
+ var h = function() {
+ var J = f.rowscount - 1;
+ z(J, !B)
+ };
+ var o = A.ctrlKey || A.metaKey;
+ if (H == 36 || (o && H == 38)) {
+ C()
+ } else {
+ if (H == 35 || (o && H == 40)) {
+ h()
+ } else {
+ if (H == 33) {
+ if (i - y >= 0) {
+ var D = i - y;
+ z(D, !B)
+ } else {
+ C()
+ }
+ } else {
+ if (H == 34) {
+ if (f.rowscount > i + y) {
+ var D = i + y;
+ z(D, !B)
+ } else {
+ h()
+ }
+ } else {
+ if (H == 38) {
+ if (i > 0) {
+ z(i - 1, !B, "up")
+ } else {
+ r = true
+ }
+ } else {
+ if (H == 40) {
+ if ((f.rowscount > i + 1) || (t.groupable && t.groups.length > 0)) {
+ z(i + 1, !B, "down")
+ } else {
+ r = true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ break
+ }
+ if (r) {
+ if (t.autosavestate) {
+ if (t.savestate) {
+ t.savestate()
+ }
+ }
+ return false
+ }
+ return true
+ },
+ _handlemousemove: function(u, p) {
+ if (p.vScrollInstance.isScrolling()) {
+ return
+ }
+ if (p.hScrollInstance.isScrolling()) {
+ return
+ }
+ var w;
+ var q;
+ var f;
+ var n;
+ var m;
+ if (p.enablehover || p.selectionmode == "multiplerows") {
+ w = this.showheader ? this.columnsheader.height() + 2 : 0;
+ q = this._groupsheader() ? this.groupsheader.height() : 0;
+ var A = this.showtoolbar ? this.toolbarheight: 0;
+ q += A;
+ f = this.host.coord();
+ if (this.hasTransform) {
+ f = a.jqx.utilities.getOffset(this.host);
+ var k = this._getBodyOffset();
+ f.left -= k.left;
+ f.top -= k.top
+ }
+ n = u.pageX - f.left;
+ m = u.pageY - w - f.top - q
+ }
+ if (p.selectionmode == "multiplerowsextended" || p.selectionmode == "multiplecellsextended" || p.selectionmode == "multiplecellsadvanced") {
+ if (p.mousecaptured == true) {
+ return
+ }
+ }
+ if (p.enablehover) {
+ if (p.disabled) {
+ return
+ }
+ if (this.vScrollInstance.isScrolling() || this.hScrollInstance.isScrolling()) {
+ return
+ }
+ var c = this._hittestrow(n, m);
+ if (!c) {
+ return
+ }
+ var h = c.row;
+ var j = c.index;
+ if (this.hoveredrow != -1 && j != -1 && this.hoveredrow == j && this.selectionmode.indexOf("cell") == -1 && this.selectionmode != "checkbox") {
+ return
+ }
+ this._clearhoverstyle();
+ if (j == -1 || h == undefined) {
+ return
+ }
+ var r = this.hittestinfo[j].visualrow;
+ if (r == null) {
+ return
+ }
+ if (this.hittestinfo[j].details) {
+ return
+ }
+ if (u.clientX > a(r).width() + a(r).coord().left) {
+ return
+ }
+ var B = 0;
+ var o = r.cells.length;
+ if (p.rowdetails && p.showrowdetailscolumn) {
+ if (!this.rtl) {
+ B = 1 + this.groups.length
+ } else {
+ o -= 1;
+ o -= this.groups.length
+ }
+ } else {
+ if (this.groupable) {
+ if (!this.rtl) {
+ B = this.groups.length
+ } else {
+ o -= this.groups.length
+ }
+ }
+ }
+ if (r.cells.length == 0) {
+ return
+ }
+ var l = r.cells[B].className;
+ if (h.group || (this.selectionmode.indexOf("row") >= 0 && l.indexOf("jqx-grid-cell-selected") != -1)) {
+ return
+ }
+ this.hoveredrow = j;
+ if (this.selectionmode.indexOf("cell") != -1 || this.selectionmode == "checkbox") {
+ var e = -1;
+ var s = this.hScrollInstance;
+ var t = s.value;
+ if (this.rtl) {
+ if (this.hScrollBar.css("visibility") != "hidden") {
+ t = s.max - s.value
+ }
+ }
+ for (var v = B; v < o; v++) {
+ var g = parseInt(a(this.columnsrow[0].cells[v]).css("left")) - t;
+ var z = g + a(this.columnsrow[0].cells[v]).width();
+ if (z >= n && n >= g) {
+ e = v;
+ break
+ }
+ }
+ if (e != -1) {
+ var b = r.cells[e];
+ if (this.cellhover) {
+ this.cellhover(b, u.pageX, u.pageY)
+ }
+ if (b.className.indexOf("jqx-grid-cell-selected") == -1) {
+ if (this.editcell) {
+ var d = this._getcolumnat(e);
+ if (d) {
+ if (this.editcell.row == j && this.editcell.column == d.datafield) {
+ return
+ }
+ }
+ }
+ a(b).addClass(this.toTP("jqx-grid-cell-hover"));
+ a(b).addClass(this.toTP("jqx-fill-state-hover"))
+ }
+ }
+ return
+ }
+ for (var v = B; v < o; v++) {
+ var b = r.cells[v];
+ a(b).addClass(this.toTP("jqx-grid-cell-hover"));
+ a(b).addClass(this.toTP("jqx-fill-state-hover"));
+ if (this.cellhover) {
+ this.cellhover(b, u.pageX, u.pageY)
+ }
+ }
+ } else {
+ return true
+ }
+ }
+ })
+})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxgrid.sort.js b/static/js/jqxgrid.sort.js
new file mode 100644
index 0000000..03e3400
--- /dev/null
+++ b/static/js/jqxgrid.sort.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.jqx.dataview.sort=function(){this.sortby=function(d,f,p){var m=Object.prototype.toString;if(f==null){this.sortdata=null;this.sortcache={};this.grid._pagescache=new Array();this.grid._cellscache=new Array();this.refresh();return}if(f==undefined){f=true}if(f=="a"||f=="asc"||f=="ascending"||f==true){f=true}else{f=false}var g=d;this.sortfield=d;this.sortfielddirection=f?"asc":"desc";if(this.sortcache==undefined){this.sortcache={}}this.sortdata=[];var b=[];var c=false;if(g=="constructor"){g=""}if(!this.virtualmode&&this.sortcache[g]!=null){var o=this.sortcache[g];b=o._sortdata;if(o.direction==f){b.reverse()}else{if(!o.direction&&f){b.reverse()}c=true}if(b.lengthb){return 1}return 0;case"date":case"time":if(cb){return 1}return 0;case"string":case"text":c=String(c).toLowerCase();b=String(b).toLowerCase();break}}else{if(a.jqx.dataFormat.isNumber(c)&&a.jqx.dataFormat.isNumber(b)){if(cb){return 1}return 0}else{if(a.jqx.dataFormat.isDate(c)&&a.jqx.dataFormat.isDate(b)){if(cb){return 1}return 0}else{if(!a.jqx.dataFormat.isNumber(c)&&!a.jqx.dataFormat.isNumber(b)){c=String(c).toLowerCase();b=String(b).toLowerCase()}}}}}try{if(cb){return 1}}catch(d){var f=d}return 0};this._equals=function(c,b){return(this._compare(c,b)===0)}};a.extend(a.jqx._jqxGrid.prototype,{_rendersortcolumn:function(){var b=this.that;var d=this.getsortcolumn();if(this.sortdirection){var c=function(f,g){var e=b.getcolumn(f);if(e){if(g.ascending){a.jqx.aria(e.element,"aria-sort","ascending")}else{if(g.descending){a.jqx.aria(e.element,"aria-sort","descending")}else{a.jqx.aria(e.element,"aria-sort","none")}}}};if(this._oldsortinfo){if(this._oldsortinfo.column){c(this._oldsortinfo.column,{ascending:false,descending:false})}}c(d,this.sortdirection)}this._oldsortinfo={column:d,direction:this.sortdirection};if(this.sortdirection){a.each(this.columns.records,function(f,g){var e=a.data(document.body,"groupsortelements"+this.displayfield);if(d==null||this.displayfield!=d){a(this.sortasc).hide();a(this.sortdesc).hide();if(e!=null){e.sortasc.hide();e.sortdesc.hide()}}else{if(b.sortdirection.ascending){a(this.sortasc).show();a(this.sortdesc).hide();if(e!=null){e.sortasc.show();e.sortdesc.hide()}}else{a(this.sortasc).hide();a(this.sortdesc).show();if(e!=null){e.sortasc.hide();e.sortdesc.show()}}}})}},getsortcolumn:function(){if(this.sortcolumn!=undefined){return this.sortcolumn}return null},removesort:function(){this.sortby(null)},sortby:function(d,g,f,e,b){if(this._loading&&b!==false){throw new Error("jqxGrid: "+this.loadingerrormessage);return false}if(d==null){g=null;d=this.sortcolumn}if(d!=undefined){var c=this.that;if(f==undefined&&c.source.sortcomparer!=null){f=c.source.sortcomparer}if(g=="a"||g=="asc"||g=="ascending"||g==true){ascending=true}else{ascending=false}if(g!=null){c.sortdirection={ascending:ascending,descending:!ascending}}else{c.sortdirection={ascending:false,descending:false}}if(g!=null){c.sortcolumn=d}else{c.sortcolumn=null}if(c.source.sort||c.virtualmode){c.dataview.sortfield=d;if(g==null){c.dataview.sortfielddirection=""}else{c.dataview.sortfielddirection=ascending?"asc":"desc"}if(c.source.sort&&!this._loading){c.source.sort(d,g);c._raiseEvent(6,{sortinformation:c.getsortinformation()});return}}else{c.dataview.sortby(d,g,f)}if(e===false){return}if(c.groupable&&c.groups.length>0){c._render(true,false,false);if(c._updategroupheadersbounds&&c.showgroupsheader){c._updategroupheadersbounds()}}else{if(c.pageable){c.dataview.updateview()}c._updaterowsproperties();c.rendergridcontent(true)}c._raiseEvent(6,{sortinformation:c.getsortinformation()})}},_togglesort:function(d){var b=this.that;if(this.disabled){return}if(d.sortable&&b.sortable){var c=b.getsortinformation();var e=null;if(c.sortcolumn!=null&&c.sortcolumn==d.displayfield){e=c.sortdirection.ascending;if(b.sorttogglestates>1){if(e==true){e=false}else{e=null}}else{e=!e}}else{e=true}b.sortby(d.displayfield,e,null)}}})})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxlistbox.js b/static/js/jqxlistbox.js
new file mode 100644
index 0000000..2184b98
--- /dev/null
+++ b/static/js/jqxlistbox.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.jqx.jqxWidget("jqxListBox","",{});a.extend(a.jqx._jqxListBox.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,items:new Array(),multiple:false,selectedIndex:-1,selectedIndexes:new Array(),source:null,scrollBarSize:a.jqx.utilities.scrollBarSize,enableHover:true,enableSelection:true,visualItems:new Array(),groups:new Array(),equalItemsWidth:true,itemHeight:-1,visibleItems:new Array(),emptyGroupText:"Group",checkboxes:false,hasThreeStates:false,autoHeight:false,autoItemsHeight:false,roundedcorners:true,touchMode:"auto",displayMember:"",groupMember:"",valueMember:"",searchMember:"",searchMode:"startswithignorecase",incrementalSearch:true,incrementalSearchDelay:1000,incrementalSearchKeyDownDelay:300,allowDrag:false,allowDrop:true,dropAction:"default",touchModeStyle:"auto",keyboardNavigation:true,enableMouseWheel:true,multipleextended:false,selectedValues:new Array(),emptyString:"",rtl:false,rendered:null,renderer:null,dragStart:null,dragEnd:null,focusable:true,ready:null,_checkForHiddenParent:true,autoBind:true,_renderOnDemand:false,filterable:false,filterHeight:27,filterPlaceHolder:"Looking for",filterDelay:100,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["select","unselect","change","checkChange","dragStart","dragEnd","bindingComplete"]};a.extend(true,this,b);return b},createInstance:function(c){var b=this;if(a.jqx.utilities.scrollBarSize!=15){b.scrollBarSize=a.jqx.utilities.scrollBarSize}if(b.width==null){b.width=200}if(b.height==null){b.height=200}b.render();var d=b;a.jqx.utilities.resize(b.host,function(){d._updateSize()},false,b._checkForHiddenParent)},resize:function(c,b){this.width=c;this.height=b;this._updateSize()},render:function(){var m=this;var l=m.element.nodeName.toLowerCase();if(l=="select"||l=="ul"||l=="ol"){m.field=m.element;if(m.field.className){m._className=m.field.className}var i={title:m.field.title};if(m.field.id.length){i.id=m.field.id.replace(/[^\w]/g,"_")+"_jqxListBox"}else{i.id=a.jqx.utilities.createId()+"_jqxListBox"}var b=a("",i);if(!m.width){m.width=a(m.field).width()}if(!m.height){m.height=a(m.field).outerHeight()}a(m.field).hide().after(b);var f=m.host.data();m.host=b;m.host.data(f);m.element=b[0];m.element.id=m.field.id;m.field.id=i.id;if(m._className){m.host.addClass(m._className);a(m.field).removeClass(m._className)}if(m.field.tabIndex){var c=m.field.tabIndex;m.field.tabIndex=-1;m.element.tabIndex=c}}m.element.innerHTML="";var m=m;var h=m.element.className;h+=" "+m.toThemeProperty("jqx-listbox");h+=" "+m.toThemeProperty("jqx-reset");h+=" "+m.toThemeProperty("jqx-rc-all");h+=" "+m.toThemeProperty("jqx-widget");h+=" "+m.toThemeProperty("jqx-widget-content");m.element.className=h;var g=false;if(m.width!=null&&m.width.toString().indexOf("%")!=-1){m.host.width(m.width);g=true}if(m.height!=null&&m.height.toString().indexOf("%")!=-1){m.host.height(m.height);if(m.host.height()==0){m.host.height(200)}g=true}if(m.width!=null&&m.width.toString().indexOf("px")!=-1){m.host.width(m.width)}else{if(m.width!=undefined&&!isNaN(m.width)){m.element.style.width=parseInt(m.width)+"px"}}if(m.height!=null&&m.height.toString().indexOf("px")!=-1){m.host.height(m.height)}else{if(m.height!=undefined&&!isNaN(m.height)){m.element.style.height=parseInt(m.height)+"px"}}if(m.multiple||m.multipleextended||m.checkboxes){a.jqx.aria(m,"aria-multiselectable",true)}else{a.jqx.aria(m,"aria-multiselectable",false)}var e="";m.host.attr("role","listbox");m.element.innerHTML=e;if(m._checkForHiddenParent){m._addInput();if(!m.host.attr("tabIndex")){m.host.attr("tabIndex",1)}}m.filter=a(m.element.firstChild.firstChild.firstChild);m.filterInput=a(m.filter[0].firstChild);m.filterInput.attr("placeholder",m.filterPlaceHolder);m.filterInput.addClass(m.toThemeProperty("jqx-widget jqx-input jqx-rc-all"));m.addHandler(m.filterInput,"keyup.textchange",function(o){if(o.keyCode==13){m._search(o)}else{if(m.filterDelay>0){if(m._filterTimer){clearTimeout(m._filterTimer)}m._filterTimer=setTimeout(function(){m._search(o)},m.filterDelay)}}o.stopPropagation()});var j=a(m.element.firstChild.firstChild.firstChild.nextSibling.nextSibling);if(!m.host.jqxButton){throw new Error("jqxListBox: Missing reference to jqxbuttons.js.");return}if(!j.jqxScrollBar){throw new Error("jqxListBox: Missing reference to jqxscrollbar.js.");return}var d=parseInt(m.host.height())/2;if(d==0){d=10}m.vScrollBar=j.jqxScrollBar({_initialLayout:true,vertical:true,rtl:m.rtl,theme:m.theme,touchMode:m.touchMode,largestep:d});var n=a(m.element.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling);m.hScrollBar=n.jqxScrollBar({_initialLayout:true,vertical:false,rtl:m.rtl,touchMode:m.touchMode,theme:m.theme});m.content=a(m.element.firstChild.firstChild.firstChild.nextSibling);m.content[0].id="listBoxContent"+m.element.id;m.bottomRight=a(m.element.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling).addClass(m.toThemeProperty("jqx-listbox-bottomright")).addClass(m.toThemeProperty("jqx-scrollbar-state-normal"));m.bottomRight[0].id="bottomRight"+m.element.id;m.vScrollInstance=a.data(m.vScrollBar[0],"jqxScrollBar").instance;m.hScrollInstance=a.data(m.hScrollBar[0],"jqxScrollBar").instance;if(m.isTouchDevice()){if(!(a.jqx.browser.msie&&a.jqx.browser.version<9)){var k=a("");m.content.parent().append(k);m.overlayContent=m.host.find(".overlay");if(m.filterable){m.overlayContent.css("top","30px")}}}m._updateTouchScrolling();m.host.addClass("jqx-disableselect");if(m.host.jqxDragDrop){jqxListBoxDragDrop()}},_highlight:function(b,c){var d=c.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return b.replace(new RegExp("("+d+")","ig"),function(e,f){return""+f+""})},_addInput:function(){var b=this.host.attr("name");if(b){this.host.attr("name","")}this.input=a("");this.host.append(this.input);this.input.attr("name",b)},_updateTouchScrolling:function(){var b=this;if(this.isTouchDevice()){b.enableHover=false;var c=this.overlayContent?this.overlayContent:this.content;this.removeHandler(a(c),a.jqx.mobile.getTouchEventName("touchstart")+".touchScroll");this.removeHandler(a(c),a.jqx.mobile.getTouchEventName("touchmove")+".touchScroll");this.removeHandler(a(c),a.jqx.mobile.getTouchEventName("touchend")+".touchScroll");this.removeHandler(a(c),"touchcancel.touchScroll");a.jqx.mobile.touchScroll(c,b.vScrollInstance.max,function(f,e){if(b.vScrollBar.css("visibility")!="hidden"){var d=b.vScrollInstance.value;b.vScrollInstance.setPosition(d+e);b._lastScroll=new Date()}if(b.hScrollBar.css("visibility")!="hidden"){var d=b.hScrollInstance.value;b.hScrollInstance.setPosition(d+f);b._lastScroll=new Date()}},this.element.id,this.hScrollBar,this.vScrollBar);if(b.vScrollBar.css("visibility")!="visible"&&b.hScrollBar.css("visibility")!="visible"){a.jqx.mobile.setTouchScroll(false,this.element.id)}else{a.jqx.mobile.setTouchScroll(true,this.element.id)}this._arrange()}},isTouchDevice:function(){var b=a.jqx.mobile.isTouchDevice();if(this.touchMode==true){if(this.touchDevice){return true}if(a.jqx.browser.msie&&a.jqx.browser.version<9){return false}this.touchDevice=true;b=true;a.jqx.mobile.setMobileSimulator(this.element)}else{if(this.touchMode==false){b=false}}if(b&&this.touchModeStyle!=false){this.scrollBarSize=a.jqx.utilities.touchScrollBarSize}if(b){this.host.addClass(this.toThemeProperty("jqx-touch"))}return b},beginUpdate:function(){this.updatingListBox=true},endUpdate:function(){this.updatingListBox=false;this._addItems();this._renderItems()},beginUpdateLayout:function(){this.updating=true},resumeUpdateLayout:function(){this.updating=false;this.vScrollInstance.value=0;this._render(false)},propertiesChangedHandler:function(b,c,d){b._cachedItemHtml=new Array();b.clearSelection();b.refresh()},propertyChangedHandler:function(b,c,e,d){if(this.isInitialized==undefined||this.isInitialized==false){return}if(b.batchUpdate&&c!="touchMode"&&c!="rtl"){return}if(c=="_renderOnDemand"){b._render(false,true);if(b.selectedIndex!=-1){var f=b.selectedIndex;b.selectedIndex=-1;b._stopEvents=true;b.selectIndex(f,false,true);if(b.selectedIndex==-1){b.selectedIndex=f}b._stopEvents=false}}if(c=="filterable"){b.refresh()}if(c=="filterHeight"){b._arrange()}if(c=="filterPlaceHolder"){b.filterInput.attr("placeholder",d)}if(c=="renderer"){b._cachedItemHtml=new Array();b.refresh()}if(c=="itemHeight"){b.refresh()}if(c=="source"||c=="checkboxes"){if(d==null&&e&&e.unbindBindingUpdate){e.unbindBindingUpdate(b.element.id);e.unbindDownloadComplete(b.element.id)}b.clearSelection();b.refresh()}if(c=="scrollBarSize"||c=="equalItemsWidth"){if(d!=e){b._updatescrollbars()}}if(c=="disabled"){b._renderItems();b.vScrollBar.jqxScrollBar({disabled:d});b.hScrollBar.jqxScrollBar({disabled:d})}if(c=="touchMode"||c=="rtl"){b._removeHandlers();b.vScrollBar.jqxScrollBar({touchMode:d});b.hScrollBar.jqxScrollBar({touchMode:d});if(c=="touchMode"){if(!(a.jqx.browser.msie&&a.jqx.browser.version<9)){var h=a("");b.content.parent().append(h);b.overlayContent=b.host.find(".overlay")}}if(b.filterable&&b.filterInput){if(c=="rtl"&&d){b.filterInput.addClass(b.toThemeProperty("jqx-rtl"))}else{if(c=="rtl"&&!d){b.filterInput.removeClass(b.toThemeProperty("jqx-rtl"))}}b._arrange()}b._updateTouchScrolling();b._addHandlers();b._render(false)}if(!this.updating){if(c=="width"||c=="height"){b._updateSize()}}if(c=="theme"){if(e!=d){b.hScrollBar.jqxScrollBar({theme:b.theme});b.vScrollBar.jqxScrollBar({theme:b.theme});b.host.removeClass();b.host.addClass(b.toThemeProperty("jqx-listbox"));b.host.addClass(b.toThemeProperty("jqx-widget"));b.host.addClass(b.toThemeProperty("jqx-widget-content"));b.host.addClass(b.toThemeProperty("jqx-reset"));b.host.addClass(b.toThemeProperty("jqx-rc-all"));b.refresh()}}if(c=="selectedIndex"){b.clearSelection();b.selectIndex(d,true)}if(c=="displayMember"||c=="valueMember"){if(e!=d){var g=b.selectedIndex;b.refresh();b.selectedIndex=g;b.selectedIndexes[g]=g}b._renderItems()}if(c=="autoHeight"){if(e!=d){b._render(false)}else{b._updatescrollbars();b._renderItems()}}if(b._checkForHiddenParent&&a.jqx.isHidden(b.host)){a.jqx.utilities.resize(this.host,function(){b._updateSize()},false,b._checkForHiddenParent)}},loadFromSelect:function(g){if(g==null){return}var c="#"+g;var d=a(c);if(d.length>0){var b=a.jqx.parseSourceTag(d[0]);var f=b.items;var e=b.index;this.source=f;this.fromSelect=true;this.clearSelection();this.selectedIndex=e;this.selectedIndexes[this.selectedIndex]=this.selectedIndex;this.refresh()}},invalidate:function(){this._cachedItemHtml=[];this._renderItems();this.virtualSize=null;this._updateSize()},refresh:function(c){var b=this;if(this.vScrollBar==undefined){return}this._cachedItemHtml=[];this.visibleItems=new Array();var d=function(e){if(e==true){if(b.selectedIndex!=-1){var f=b.selectedIndex;b.selectedIndex=-1;b._stopEvents=true;b.selectIndex(f,false,true);if(b.selectedIndex==-1){b.selectedIndex=f}b._stopEvents=false}}};if(this.itemswrapper!=null){this.itemswrapper.remove();this.itemswrapper=null}if(a.jqx.dataAdapter&&this.source!=null&&this.source._source){this.databind(this.source,c);d(c);return}if(this.autoBind||(!this.autoBind&&!c)){if(this.field){this.loadSelectTag()}this.items=this.loadItems(this.source)}this._raiseEvent("6");this._render(false,c==true);d(c)},loadSelectTag:function(){var b=a.jqx.parseSourceTag(this.field);this.source=b.items;if(this.selectedIndex==-1){this.selectedIndex=b.index}},_render:function(c,b){if(this._renderOnDemand){this.visibleItems=new Array();this.renderedVisibleItems=new Array();this._renderItems();return}this._addItems();this._renderItems();this.vScrollInstance.setPosition(0);this._cachedItemHtml=new Array();if(c==undefined||c){if(this.items!=undefined&&this.items!=null){if(this.selectedIndex>=0&&this.selectedIndex0){var d=this.renderedVisibleItems[this.renderedVisibleItems.length-1];if(d.height+d.tope&&d.initialTop+d.height>e){b=mid-1}else{if(d.initialTop=0&&x.top-x.height<=E){L[F++]={index:r,item:x}}g-=x.height}}}var m=g>0?this._searchFirstVisibleIndex(this.vScrollInstance.value,this.renderedVisibleItems):0;var O=0;F=0;var z=this.vScrollInstance.value;var J=0;while(O<100+E){var x=this.renderedVisibleItems[m];if(x==undefined){break}if(x.visible){x.left=-f;var c=x.top+x.height-z;if(c>=0&&x.initialTop-z-x.height<=2*E){L[F++]={index:m,item:x}}}m++;if(x.visible){O+=x.initialTop-z+x.height-O}J++;if(J>this.items.length-1){break}}if(this._renderOnDemand){return}var o=this.toThemeProperty("jqx-listitem-state-normal")+" "+this.toThemeProperty("jqx-item");var i=this.toThemeProperty("jqx-listitem-state-group");var P=this.toThemeProperty("jqx-listitem-state-disabled")+" "+this.toThemeProperty("jqx-fill-state-disabled");var C=0;var n=this;for(var r=0;r=E){I();continue}var A=a(D[0].firstChild);if(this.checkboxes){A=a(D[0].lastChild)}if(A.length==0){continue}if(A[0]==null){continue}A[0].className="";A[0].style.display="block";A[0].style.visibility="inherit";var p="";if(!x.isGroup&&!this.selectedIndexes[x.index]>=0){p=o}else{p=i}if(x.disabled||this.disabled){p+=" "+P}if(this.roundedcorners){p+=" "+this.toThemeProperty("jqx-rc-all")}if(N){p+=" "+this.toThemeProperty("jqx-listitem-state-normal-touch")}A[0].className=p;if(this.renderer){if(!x.key){x.key=this.generatekey()}if(!this._cachedItemHtml){this._cachedItemHtml=new Array()}if(this._cachedItemHtml[x.key]){if(A[0].innerHTML!=this._cachedItemHtml[x.key]){A[0].innerHTML=this._cachedItemHtml[x.key]}}else{var w=this.renderer(x.index,x.label,x.value);A[0].innerHTML=w;this._cachedItemHtml[x.key]=A[0].innerHTML}}else{if(this.itemHeight!==-1){var k=2+2*parseInt(A.css("padding-top"));A[0].style.lineHeight=(x.height-k)+"px";A.css("vertical-align","middle")}if(x.html!=null&&x.html.toString().length>0){A[0].innerHTML=x.html}else{if(x.label!=null||x.value!=null){if(x.label!=null){if(A[0].innerHTML!==x.label){A[0].innerHTML=x.label}if(a.trim(x.label)==""){A[0].innerHTML=this.emptyString;if(this.emptyString==""){A[0].style.height=(x.height-8)+"px"}}if(!this.incrementalSearch&&!x.disabled){if(this.searchString!=undefined&&this.searchString!=""){A[0].innerHTML=this._highlight(x.label.toString(),this.searchString)}}}else{if(x.label===null){A[0].innerHTML=this.emptyString;if(this.emptyString==""){A[0].style.height=(x.height-8)+"px"}}else{if(A[0].innerHTML!==x.value){A[0].innerHTML=x.value}else{if(x.label==""){A[0].innerHTML=" "}}}}}else{if(x.label==""||x.label==null){A[0].innerHTML="";A[0].style.height=(x.height-8)+"px"}}}}D[0].style.left=x.left+"px";D[0].style.top=x.initialTop-z+"px";x.element=A[0];if(x.title){A[0].title=x.title}if(this.equalItemsWidth&&!x.isGroup){if(t==0){var d=parseInt(b);var v=parseInt(A.outerWidth())-parseInt(A.width());d-=v;var H=1;if(H!=null){H=parseInt(H)}else{H=0}d-=2*H;t=d;if(this.checkboxes&&this.hScrollBar[0].style.visibility=="hidden"){t-=18}}if(K>this.virtualSize.width){A[0].style.width=t+"px";x.width=t}else{A[0].style.width=-4+this.virtualSize.width+"px";x.width=this.virtualSize.width-4}}else{if(A.width()=0)||(x.selected&&this.filterable))){A.addClass(this.toThemeProperty("jqx-listitem-state-selected"));A.addClass(this.toThemeProperty("jqx-fill-state-pressed"));if(a.jqx.ariaEnabled){D[0].setAttribute("aria-selected",true);this._activeElement=D[0]}}else{if(!this.checkboxes){if(a.jqx.ariaEnabled){D[0].removeAttribute("aria-selected")}}}}else{I()}}},generatekey:function(){var b=function(){return(((1+Math.random())*65536)|0).toString(16).substring(1)};return(b()+b()+"-"+b()+"-"+b()+"-"+b()+"-"+b()+b()+b())},_calculateVirtualSize:function(l){if(this._renderOnDemand){return}var p=0;var n=2;var g=0;var o=document.createElement("span");if(this.equalItemsWidth){a(o).css("float","left")}o.style.whiteSpace="pre";var h=0;var i=undefined===l?this.host.outerHeight():l+2;document.body.appendChild(o);var e=this.items.length;var j=this.host.width();if(this.autoItemsHeight){j-=10;if(this.vScrollBar.css("visibility")!="hidden"){j-=20}}if(this.autoItemsHeight||this.renderer||this.groups.length>=1||(e>0&&this.items[0].html!=null&&this.items[0].html!="")){for(var g=0;g0){o.innerHTML=s.html}else{if(s.label!=null||s.value!=null){if(s.label!=null){o.innerHTML=s.label;if(s.label==""){o.innerHTML="Empty"}}else{o.innerHTML=s.value}}}}var r=o.offsetHeight;var t=o.offsetWidth;if(this.itemHeight>-1){r=this.itemHeight}s.height=r;s.width=t;n+=r;p=Math.max(p,t);if(n<=i){h++}}}else{var n=0;var m=0;var c="";var u=0;var f=0;var q=-1;for(var g=0;g0){o.innerHTML=s.html}else{if(s.label!=null||s.value!=null){if(s.label!=null){if(s.label.toString().match(new RegExp("\\w"))!=null||s.label.toString().match(new RegExp("\\d"))!=null){o.innerHTML=s.label}else{o.innerHTML="Item"}}else{o.innerHTML=s.value}}}}var r=1+o.offsetHeight;if(this.itemHeight>-1){r=this.itemHeight}m=r}if(u!=undefined){f=u}if(s.html!=null&&s.html.toString().length>0){u=Math.max(u,s.html.toString().length);if(f!=u){c=s.html}}else{if(s.label!=null){u=Math.max(u,s.label.length);if(f!=u){c=s.label}}else{if(s.value!=null){u=Math.max(u,s.value.length);if(f!=u){c=s.value}}}}s.height=m;n+=m;if(n<=i){h++}}o.innerHTML=c;p=o.offsetWidth}n+=2;if(h<10){h=10}if(this.filterable){n+=this.filterHeight}o.parentNode.removeChild(o);return{width:p,height:n,itemsPerPage:h}},_getVirtualItemsCount:function(){if(this.virtualItemsCount==0){var b=parseInt(this.host.height())/5;if(b>this.items.length){b=this.items.length}return b}else{return this.virtualItemsCount}},_addItems:function(r){if(this._renderOnDemand){return}var v=this;if(v.updatingListBox==true){return}if(v.items==undefined||v.items.length==0){v.virtualSize={width:0,height:0,itemsPerPage:0};v._updatescrollbars();v.renderedVisibleItems=new Array();if(v.itemswrapper){v.itemswrapper.children().remove()}return}var h=v.host.height();if(r==false){var b=v._calculateVirtualSize(h);var g=b.itemsPerPage*2;if(v.autoHeight){g=v.items.length}v.virtualItemsCount=Math.min(g,v.items.length);var q=b.width;v.virtualSize=b;v._updatescrollbars();return}var n=this;var l=0;v.visibleItems=new Array();v.renderedVisibleItems=new Array();v._removeHandlers();if(v.allowDrag&&v._enableDragDrop){v.itemswrapper=null}if(v.itemswrapper==null){v.content[0].innerHTML="";v.itemswrapper=a('');v.itemswrapper[0].style.height=(2*h)+"px";v.content[0].appendChild(v.itemswrapper[0])}var b=v._calculateVirtualSize(h);var g=b.itemsPerPage*2;if(v.autoHeight){g=v.items.length}v.virtualItemsCount=Math.min(g,v.items.length);var v=this;var q=b.width;v.virtualSize=b;var c=Math.max(v.host.width(),17+b.width);v.itemswrapper[0].style.width=c+"px";var e=0;var i="";var f=a.jqx.browser.msie&&a.jqx.browser.version<9;var s=f?' unselectable="on"':"";for(var j=e;j";if(v.checkboxes){i+='';var o='
';var w=u.checked?" "+v.toThemeProperty("jqx-checkbox-check-checked"):"";o+='';o+="
";i+=o;i+="
"}i+=" "}if(n.WinJS){v.itemswrapper.html(i)}else{v.itemswrapper[0].innerHTML=i}var d=v.itemswrapper.children();for(var j=e;jo){b=k.hScrollBar.outerHeight()+2}if(n+b>m){var d=f.max;f.max=2+parseInt(n)+b-parseInt(m-2);if(k.vScrollBar[0].style.visibility!="inherit"){k.vScrollBar[0].style.visibility="inherit";l=true}if(d!=f.max){f._arrange()}}else{if(k.vScrollBar[0].style.visibility!="hidden"){k.vScrollBar[0].style.visibility="hidden";l=true;f.setPosition(0)}}var h=0;if(k.vScrollBar[0].style.visibility!="hidden"){h=k.scrollBarSize+6}var g=k.checkboxes?20:0;if(k.autoItemsHeight){k.hScrollBar[0].style.visibility="hidden"}else{if(j>=o-h-g){var i=e.max;if(k.vScrollBar[0].style.visibility=="inherit"){e.max=g+h+parseInt(j)-k.host.width()+4}else{e.max=g+parseInt(j)-k.host.width()+6}if(k.hScrollBar[0].style.visibility!="inherit"){k.hScrollBar[0].style.visibility="inherit";l=true}if(i!=e.max){e._arrange()}if(k.vScrollBar[0].style.visibility=="inherit"){f.max=2+parseInt(n)+k.hScrollBar.outerHeight()+2-parseInt(k.host.height())}}else{if(k.hScrollBar[0].style.visibility!="hidden"){k.hScrollBar[0].style.visibility="hidden";l=true}}}e.setPosition(0);if(l){k._arrange()}if(k.itemswrapper){k.itemswrapper[0].style.width=Math.max(0,Math.max(o-2,17+j))+"px";k.itemswrapper[0].style.height=Math.max(0,2*m)+"px"}var c=k.isTouchDevice();if(c){if(k.vScrollBar.css("visibility")!="visible"&&k.hScrollBar.css("visibility")!="visible"){a.jqx.mobile.setTouchScroll(false,k.element.id)}else{a.jqx.mobile.setTouchScroll(true,k.element.id)}}},clear:function(){this.source=null;this.clearSelection();this.refresh()},clearSelection:function(b){for(var c=0;c=d.host.height()){k=false}if(k){m.push(j)}}}return m}();return{items:c,visibleItems:b,viewItems:e}},getItem:function(c){if(c==-1||isNaN(c)||typeof(c)==="string"){if(c===-1){return null}return this.getItemByValue(c)}var b=null;var d=a.each(this.items,function(){if(this.index==c){b=this;return false}});return b},getVisibleItem:function(b){if(b==-1||isNaN(b)||typeof(b)==="string"){if(b===-1){return null}return this.getItemByValue(b)}return this.visibleItems[b]},getVisibleItems:function(){return this.visibleItems},checkIndex:function(b,c,e){if(!this.checkboxes){return}if(isNaN(b)){return}if(b<0||b>=this.visibleItems.length){return}if(this.visibleItems[b]!=null&&this.visibleItems[b].disabled){return}if(this.disabled){return}var d=this.getItem(b);if(this.groups.length>0||this.filterable){var d=this.getVisibleItem(b)}if(d!=null){var f=a(d.checkBoxElement);d.checked=true;if(c==undefined||c==true){this._updateCheckedItems()}}if(e==undefined||e==true){this._raiseEvent(3,{label:d.label,value:d.value,checked:true,item:d})}},getCheckedItems:function(){if(!this.checkboxes){return null}var b=new Array();if(this.items==undefined){return}a.each(this.items,function(){if(this.checked){b[b.length]=this}});return b},checkAll:function(b){if(!this.checkboxes){return}if(this.disabled){return}var c=this;a.each(this.items,function(){var d=this;if(b!==false&&d.checked!==true){c._raiseEvent(3,{label:d.label,value:d.value,checked:true,item:d})}this.checked=true});this._updateCheckedItems()},uncheckAll:function(b){if(!this.checkboxes){return}if(this.disabled){return}var c=this;a.each(this.items,function(){var d=this;if(b!==false&&d.checked!==false){this.checked=false;c._raiseEvent(3,{label:d.label,value:d.value,checked:false,item:d})}this.checked=false});this._updateCheckedItems()},uncheckIndex:function(b,c,e){if(!this.checkboxes){return}if(isNaN(b)){return}if(b<0||b>=this.visibleItems.length){return}if(this.visibleItems[b]!=null&&this.visibleItems[b].disabled){return}if(this.disabled){return}var d=this.getItem(b);if(this.groups.length>0||this.filterable){var d=this.getVisibleItem(b)}if(d!=null){var f=a(d.checkBoxElement);d.checked=false;if(c==undefined||c==true){this._updateCheckedItems()}}if(e==undefined||e==true){this._raiseEvent(3,{label:d.label,value:d.value,checked:false,item:d})}},indeterminateIndex:function(b,c,e){if(!this.checkboxes){return}if(isNaN(b)){return}if(b<0||b>=this.visibleItems.length){return}if(this.visibleItems[b]!=null&&this.visibleItems[b].disabled){return}if(this.disabled){return}var d=this.getItem(b);if(this.groups.length>0||this.filterable){var d=this.getVisibleItem(b)}if(d!=null){var f=a(d.checkBoxElement);d.checked=null;if(c==undefined||c==true){this._updateCheckedItems()}}if(e==undefined||e==true){this._raiseEvent(3,{checked:null})}},getSelectedIndex:function(){return this.selectedIndex},getSelectedItems:function(){var b=this.getVisibleItems();var e=this.selectedIndexes;var d=[];for(var c in e){if(e[c]!=-1){d[d.length]=b[c]}}return d},getSelectedItem:function(){var b=this.getSelectedItems();if(b&&b.length>0){return b[0]}return null},_updateCheckedItems:function(){var b=this.selectedIndex;this.clearSelection(false);var c=this.getCheckedItems();this.selectedIndex=b;this._renderItems();var d=a.data(this.element,"hoveredItem");if(d!=null){a(d).addClass(this.toThemeProperty("jqx-listitem-state-hover"));a(d).addClass(this.toThemeProperty("jqx-fill-state-hover"))}this._updateInputSelection()},getItemByValue:function(d){if(this.visibleItems==null){return}if(d&&d.value){d=d.value}if(this.itemsByValue){return this.itemsByValue[a.trim(d).split(" ").join("_")]}var b=this.visibleItems;for(var c=0;c=this.visibleItems.length){return}if(this.visibleItems[j]!=null&&this.visibleItems[j].disabled){return}if(this.disabled){return}if(!this.multiple&&!this.multipleextended&&this.selectedIndex==j&&!d&&!this.checkboxes){if(this.visibleItems&&this.items&&this.visibleItems.length!=this.items.length){h=this.getVisibleItem(j);if(h){this.selectedValue=h.value;this.selectedValues[h.value]=h.value}}return}if(this.checkboxes){this._updateCheckedItems();var p=q;if(this.selectedIndex==j&&!this.multiple){p=-1}if(m==undefined){m="none"}var h=this.getItem(j);var s=this.getItem(p);if(this.visibleItems&&this.items&&this.visibleItems.length!=this.items.length){h=this.getVisibleItem(j);s=this.getVisibleItem(p)}this._raiseEvent("1",{index:p,type:m,item:s,originalEvent:b});this.selectedIndex=j;this.selectedIndexes[p]=-1;this.selectedIndexes[j]=j;if(h){this.selectedValue=h.value;this.selectedValues[h.value]=h.value}this._raiseEvent("0",{index:j,type:m,item:h,originalEvent:b});this._renderItems();return}this.focused=true;var o=false;if(this.selectedIndex!=j){o=true}var p=q;if(this.selectedIndex==j&&!this.multiple){p=-1}if(m==undefined){m="none"}var h=this.getItem(j);var s=this.getItem(p);if(this.visibleItems&&this.items&&this.visibleItems.length!=this.items.length){h=this.getVisibleItem(j);s=this.getVisibleItem(p)}if(d!=undefined&&d){this._raiseEvent("1",{index:p,type:m,item:s,originalEvent:b});this.selectedIndex=j;this.selectedIndexes[p]=-1;this.selectedIndexes[j]=j;if(h){this.selectedValue=h.value;this.selectedValues[h.value]=h.value}this._raiseEvent("0",{index:j,type:m,item:h,originalEvent:b})}else{var l=this;var e=function(t,x,v,w,u,i){l._raiseEvent("1",{index:x,type:v,item:w,originalEvent:i});l.selectedIndex=t;l.selectedIndexes=[];x=t;l.selectedIndexes[t]=t;l.selectedValues=new Array();if(u){l.selectedValues[u.value]=u.value}l._raiseEvent("0",{index:t,type:v,item:u,originalEvent:i})};var k=function(t,x,v,w,u,i){if(l.selectedIndexes[t]==undefined||l.selectedIndexes[t]==-1){l.selectedIndexes[t]=t;l.selectedIndex=t;if(u){l.selectedValues[u.value]=u.value;l._raiseEvent("0",{index:t,type:v,item:u,originalEvent:i})}}else{x=l.selectedIndexes[t];w=l.getVisibleItem(x);if(w){l.selectedValues[w.value]=null}l.selectedIndexes[t]=-1;l.selectedIndex=-1;l._raiseEvent("1",{index:x,type:v,item:w,originalEvent:i})}};if(this.multipleextended){if(!this._shiftKey&&!this._ctrlKey){if(m!="keyboard"&&m!="mouse"){k(j,p,m,s,h,b);l._clickedIndex=j}else{this.clearSelection(false);l._clickedIndex=j;e(j,p,m,s,h,b)}}else{if(this._ctrlKey){if(m=="keyboard"){this.clearSelection(false);l._clickedIndex=j}k(j,p,m,s,h,b)}else{if(this._shiftKey){if(l._clickedIndex==undefined){l._clickedIndex=p}var f=Math.min(l._clickedIndex,j);var n=Math.max(l._clickedIndex,j);this.clearSelection(false);for(var g=f;g<=n;g++){l.selectedIndexes[g]=g;l.selectedValues[l.getVisibleItem(g).value]=l.getVisibleItem(g).value;l._raiseEvent("0",{index:g,type:m,item:this.getVisibleItem(g),originalEvent:b})}if(m!="keyboard"){l.selectedIndex=l._clickedIndex}else{l.selectedIndex=j}}}}}else{if(this.multiple){k(j,p,m,s,h,b)}else{if(h){this.selectedValue=h.value}e(j,p,m,s,h,b)}}}if(c==undefined||c==true){this._renderItems()}if(r!=undefined&&r!=null&&r==true){this.ensureVisible(j)}this._raiseEvent("2",{index:j,item:h,oldItem:s,type:m,originalEvent:b});this._updateInputSelection();return o},_updateInputSelection:function(){this._syncSelection();var c=new Array();if(this.input){if(this.selectedIndex==-1){this.input.val("")}else{if(this.items){if(this.items[this.selectedIndex]!=undefined){this.input.val(this.items[this.selectedIndex].value);c.push(this.items[this.selectedIndex].value)}}}if(this.multiple||this.multipleextended||this.checkboxes){var b=!this.checkboxes?this.getSelectedItems():this.getCheckedItems();var e="";if(b){for(var d=0;d=0;if(this.selected){a(this).attr("selected",true)}})}else{a.each(this.items,function(f,g){a(this.originalItem.originalItem).removeAttr("data-selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this.originalItem.originalItem).attr("data-selected",true)}})}}},isIndexInView:function(c){if(isNaN(c)){return false}if(!this.items){return false}if(c<0||c>=this.items.length){return false}var e=this.vScrollInstance.value;var d=0;if(this.filterable){d=this.filterHeight}var f=this.visibleItems[c];if(f==undefined){return true}var b=f.initialTop;var g=f.height;if(b-e=this.host.outerHeight()){return false}return true},_itemsInPage:function(){var b=0;var c=this;if(this.items){a.each(this.items,function(){if((this.initialTop+this.height)>=c.content.height()){return false}b++})}return b},_firstItemIndex:function(){if(this.visibleItems!=null){if(this.visibleItems[0]){if(this.visibleItems[0].isGroup){return this._nextItemIndex(0)}else{return 0}}else{return 0}}return -1},_lastItemIndex:function(){if(this.visibleItems!=null){if(this.visibleItems[this.visibleItems.length-1]){if(this.visibleItems[this.visibleItems.length-1].isGroup){return this._prevItemIndex(this.visibleItems.length-1)}else{return this.visibleItems.length-1}}else{return this.visibleItems.length-1}}return -1},_nextItemIndex:function(b){for(indx=b+1;indx=0;indx--){if(this.visibleItems[indx]){if(!this.visibleItems[indx].disabled&&!this.visibleItems[indx].isGroup){return indx}}}return -1},clearFilter:function(){this.filterInput.val("");this._updateItemsVisibility("")},_search:function(c){var b=this;var d=b.filterInput.val();if(c.keyCode==9){return}if(b.searchMode=="none"||b.searchMode==null||b.searchMode=="undefined"){return}if(c.keyCode==16||c.keyCode==17||c.keyCode==20){return}if(c.keyCode==37||c.keyCode==39){return false}if(c.altKey||c.keyCode==18){return}if(c.keyCode>=33&&c.keyCode<=40){return}if(c.ctrlKey||c.metaKey||b.ctrlKey){if(c.keyCode!=88&&c.keyCode!=86){return}}if(d===b.searchString){return}b._updateItemsVisibility(d)},_updateItemsVisibility:function(h){var e=this.getItems();if(e==undefined){return{index:-1,matchItem:new Array()}}var f=this;var d=-1;var i=new Array();var g=0;a.each(e,function(k){var m="";if(!this.isGroup){if(this.searchLabel){m=this.searchLabel}else{if(this.label){m=this.label}else{if(this.value){m=this.value}else{if(this.title){m=this.title}else{m="jqxItem"}}}}m=m.toString();var l=false;switch(f.searchMode){case"containsignorecase":l=a.jqx.string.containsIgnoreCase(m,h);break;case"contains":l=a.jqx.string.contains(m,h);break;case"equals":l=a.jqx.string.equals(m,h);break;case"equalsignorecase":l=a.jqx.string.equalsIgnoreCase(m,h);break;case"startswith":l=a.jqx.string.startsWith(m,h);break;case"startswithignorecase":l=a.jqx.string.startsWithIgnoreCase(m,h);break;case"endswith":l=a.jqx.string.endsWith(m,h);break;case"endswithignorecase":l=a.jqx.string.endsWithIgnoreCase(m,h);break}if(!l){this.visible=false}if(l){i[g++]=this;this.visible=true;d=this.visibleIndex}if(h==""){this.visible=true;l=false}}});f.renderedVisibleItems=new Array();f.visibleItems=new Array();f.vScrollInstance.setPosition(0,true);f._addItems(false);f._renderItems();for(var b=0;b=d){c=this.visibleIndex;return false}}});return c},findItems:function(e){var b=this.getItems();var d=this;var c=0;var f=new Array();a.each(b,function(g){var j="";if(!this.isGroup){if(this.label){j=this.label}else{if(this.value){j=this.value}else{if(this.title){j=this.title}else{j="jqxItem"}}}var h=false;switch(d.searchMode){case"containsignorecase":h=a.jqx.string.containsIgnoreCase(j,e);break;case"contains":h=a.jqx.string.contains(j,e);break;case"equals":h=a.jqx.string.equals(j,e);break;case"equalsignorecase":h=a.jqx.string.equalsIgnoreCase(j,e);break;case"startswith":h=a.jqx.string.startsWith(j,e);break;case"startswithignorecase":h=a.jqx.string.startsWithIgnoreCase(j,e);break;case"endswith":h=a.jqx.string.endsWith(j,e);break;case"endswithignorecase":h=a.jqx.string.endsWithIgnoreCase(j,e);break}if(h){f[c++]=this}}});return f},_syncSelection:function(){var d=this;if(d.filterable){if(d.items){for(var b=0;b=1){k._searchString=k._searchString.substr(0,k._searchString.length-1)}var r=String.fromCharCode(s);var m=(!isNaN(parseInt(r)));var i=false;if((s>=65&&s<=97)||m||s==8||s==32||s==46){if(!n.shiftKey){r=r.toLocaleLowerCase()}var e=1+k.selectedIndex;if(s!=8&&s!=32&&s!=46){if(k._searchString.length>0&&k._searchString.substr(0,1)==r){e=1+k.selectedIndex}else{k._searchString+=r}}if(s==32){k._searchString+=" "}var b=this._getMatches(k._searchString,e);o=b;if(o==k._lastMatchIndex||o==-1){var b=this._getMatches(k._searchString,0);o=b}k._lastMatchIndex=o;if(o>=0){var h=function(){j();k.selectIndex(o,false,false,false,"keyboard",n);var t=k.isIndexInView(o);if(!t){k.ensureVisible(o)}else{k._renderItems()}};if(k._toSelectTimer){clearTimeout(k._toSelectTimer)}k._toSelectTimer=setTimeout(function(){h()},k.incrementalSearchKeyDownDelay)}i=true}if(k._searchTimer!=undefined){clearTimeout(k._searchTimer)}if(s==27||s==13){k._searchString=""}k._searchTimer=setTimeout(function(){k._searchString="";k._renderItems()},k.incrementalSearchDelay);if(o>=0){return}if(i){return false}}if(s==33){var p=k._itemsInPage();if(k.selectedIndex-p>=0){j();k.selectIndex(d-p,false,false,false,"keyboard",n)}else{j();k.selectIndex(k._firstItemIndex(),false,false,false,"keyboard",n)}k._searchString=""}if(s==32&&this.checkboxes){var f=this.getItem(g);if(f!=null){k._updateItemCheck(f,g);n.preventDefault()}k._searchString=""}if(s==36){j();k.selectIndex(k._firstItemIndex(),false,false,false,"keyboard",n);k._searchString=""}if(s==35){j();k.selectIndex(k._lastItemIndex(),false,false,false,"keyboard",n);k._searchString=""}if(s==34){var p=k._itemsInPage();if(k.selectedIndex+p0){var c=k._prevItemIndex(k.selectedIndex);if(c!=k.selectedIndex&&c!=-1){j();k.selectIndex(c,false,false,false,"keyboard",n)}else{return true}}else{return false}}else{if(s==40){k._searchString="";if(k.selectedIndex+10&&b.virtualItemsCount*b.items[0].height9){setTimeout(function(){l._renderItems()},1)}else{l._renderItems()}});this.addHandler(this.hScrollBar,"valueChanged",function(){l._renderItems()});if(this._mousewheelfunc){this.removeHandler(this.host,"mousewheel",this._mousewheelfunc)}this._mousewheelfunc=function(n){l.wheel(n,l)};this.addHandler(this.host,"mousewheel",this._mousewheelfunc);this.addHandler(a(document),"keydown.listbox"+this.element.id,function(n){l._ctrlKey=n.ctrlKey||n.metaKey;l._shiftKey=n.shiftKey});this.addHandler(a(document),"keyup.listbox"+this.element.id,function(n){l._ctrlKey=n.ctrlKey||n.metaKey;l._shiftKey=n.shiftKey});this.addHandler(this.host,"keydown",function(n){return l._handleKeyDown(n)});this.addHandler(this.content,"mouseleave",function(n){l.focused=false;var o=a.data(l.element,"hoveredItem");if(o!=null){a(o).removeClass(l.toThemeProperty("jqx-listitem-state-hover"));a(o).removeClass(l.toThemeProperty("jqx-fill-state-hover"));a.data(l.element,"hoveredItem",null)}});this.addHandler(this.content,"focus",function(n){if(!l.disabled){l.host.addClass(l.toThemeProperty("jqx-fill-state-focus"));l.focused=true}});this.addHandler(this.content,"blur",function(n){l.focused=false;l.host.removeClass(l.toThemeProperty("jqx-fill-state-focus"))});this.addHandler(this.host,"focus",function(n){if(!l.disabled){l.host.addClass(l.toThemeProperty("jqx-fill-state-focus"));l.focused=true}});this.addHandler(this.host,"blur",function(n){if(a.jqx.browser.msie&&a.jqx.browser.version<9&&l.focused){return}l.host.removeClass(l.toThemeProperty("jqx-fill-state-focus"));l.focused=false});this.addHandler(this.content,"mouseenter",function(n){l.focused=true});var c=a.jqx.utilities.hasTransform(this.host);if(this.enableSelection){var f=l.isTouchDevice()&&this.touchMode!==true;var i=!f?"mousedown":"touchend";var k=!f?"mouseup":"touchend";if(this.overlayContent){this.addHandler(this.overlayContent,a.jqx.mobile.getTouchEventName("touchend"),function(p){if(!l.enableSelection){return true}if(f){l._newScroll=new Date();if(l._newScroll-l._lastScroll<500){return true}}var s=a.jqx.mobile.getTouches(p);var t=s[0];if(t!=undefined){var n=l.host.offset();var r=parseInt(t.pageX);var q=parseInt(t.pageY);if(l.touchMode==true){if(t._pageX!=undefined){r=parseInt(t._pageX);q=parseInt(t._pageY)}}r=r-n.left;q=q-n.top;var o=l._hitTest(r,q);if(o!=null&&!o.isGroup){l._newScroll=new Date();if(l._newScroll-l._lastScroll<500){return false}if(l.checkboxes){l._updateItemCheck(o,o.visibleIndex);return}if(o.html.indexOf("href")!=-1){setTimeout(function(){l.selectIndex(o.visibleIndex,false,true,false,"mouse",p);l.content.trigger("click");return false},100)}else{l.selectIndex(o.visibleIndex,false,true,false,"mouse",p);if(p.preventDefault){p.preventDefault()}l.content.trigger("click");return false}}}})}else{var d=false;this.addHandler(this.content,i,function(n){if(!l.enableSelection){return true}d=true;if(f){l._newScroll=new Date();if(l._newScroll-l._lastScroll<500){return false}}l.focused=true;if(!l.isTouchDevice()&&l.focusable){l.host.focus()}if(n.target.id!=("listBoxContent"+l.element.id)&&l.itemswrapper[0]!=n.target){var r=n.target;var z=a(r).offset();var q=l.host.offset();if(c){var o=a.jqx.mobile.getLeftPos(r);var t=a.jqx.mobile.getTopPos(r);z.left=o;z.top=t;o=a.jqx.mobile.getLeftPos(l.element);t=a.jqx.mobile.getTopPos(l.element);q.left=o;q.top=t}var s=parseInt(z.top)-parseInt(q.top);var v=parseInt(z.left)-parseInt(q.left);var w=l._hitTest(v,s);if(w!=null&&!w.isGroup){var p=function(y,x){if(!l._shiftKey){l._clickedIndex=y.visibleIndex}if(!l.checkboxes){l.selectIndex(y.visibleIndex,false,true,false,"mouse",x)}else{v=20+x.pageX-z.left;if(l.rtl){var A=l.hScrollBar.css("visibility")!="hidden"?l.hScrollInstance.max:l.host.width();if(v<=l.host.width()-20){if(!l.allowDrag){l._updateItemCheck(y,y.visibleIndex);l.selectIndex(y.visibleIndex,false,true,false,"mouse",x)}else{setTimeout(function(){if(!l._dragItem){if(!d){l._updateItemCheck(y,y.visibleIndex);l.selectIndex(y.visibleIndex,false,true,false,"mouse",x)}}},200)}}}else{if(v+l.hScrollInstance.value>=20){if(!l.allowDrag){l._updateItemCheck(y,y.visibleIndex);l.selectIndex(y.visibleIndex,false,true,false,"mouse",x)}else{setTimeout(function(){if(!l._dragItem){if(!d){l._updateItemCheck(y,y.visibleIndex);l.selectIndex(y.visibleIndex,false,true,false,"mouse",x)}}},200)}}}}};if(!w.disabled){if(w.html.indexOf("href")!=-1){setTimeout(function(){p(w,n)},100)}else{p(w,n)}}}if(i=="mousedown"){var u=false;if(n.which){u=(n.which==3)}else{if(n.button){u=(n.button==2)}}if(u){return true}return false}}return true})}this.addHandler(this.content,"mouseup",function(n){l.vScrollInstance.handlemouseup(l,n);d=false});if(a.jqx.browser.msie){this.addHandler(this.content,"selectstart",function(n){return false})}}var e=this.isTouchDevice();if(this.enableHover&&!e){this._mousemovefunc=function(n){if(e){return true}if(!l.enableHover){return true}var p=a.jqx.browser.msie==true&&a.jqx.browser.version<9?0:1;if(n.target==null){return true}if(l.disabled){return true}l.focused=true;var r=l.vScrollInstance.isScrolling();if(!r&&n.target.id!=("listBoxContent"+l.element.id)){if(l.itemswrapper[0]!=n.target){var t=n.target;var B=a(t).offset();var s=l.host.offset();if(c){var o=a.jqx.mobile.getLeftPos(t);var v=a.jqx.mobile.getTopPos(t);B.left=o;B.top=v;o=a.jqx.mobile.getLeftPos(l.element);v=a.jqx.mobile.getTopPos(l.element);s.left=o;s.top=v}var u=parseInt(B.top)-parseInt(s.top);var w=parseInt(B.left)-parseInt(s.left);var A=l._hitTest(w,u);if(A!=null&&!A.isGroup&&!A.disabled){var q=a.data(l.element,"hoveredItem");if(q!=null){a(q).removeClass(l.toThemeProperty("jqx-listitem-state-hover"));a(q).removeClass(l.toThemeProperty("jqx-fill-state-hover"))}a.data(l.element,"hoveredItem",A.element);var z=a(A.element);z.addClass(l.toThemeProperty("jqx-listitem-state-hover"));z.addClass(l.toThemeProperty("jqx-fill-state-hover"))}}}};this.addHandler(this.content,"mousemove",this._mousemovefunc)}},_arrange:function(u){if(u==undefined){u=true}var t=this;var p=null;var n=null;var g=t.filterable?t.filterHeight:0;var j=function(h){h=t.host.height();if(h==0){h=200;t.host.height(h)}return h};if(t.width!=null&&t.width.toString().indexOf("px")!=-1){p=t.width}else{if(t.width!=undefined&&!isNaN(t.width)){p=t.width}}if(t.height!=null&&t.height.toString().indexOf("px")!=-1){n=t.height}else{if(t.height!=undefined&&!isNaN(t.height)){n=t.height}}if(t.width!=null&&t.width.toString().indexOf("%")!=-1){t.host.css("width",t.width);p=t.host.width()}if(t.height!=null&&t.height.toString().indexOf("%")!=-1){t.host.css("height",t.height);n=j(n)}if(p!=null){p=parseInt(p);if(parseInt(t.element.style.width)!=parseInt(t.width)){t.host.width(t.width)}}if(!t.autoHeight){if(n!=null){n=parseInt(n);if(parseInt(t.element.style.height)!=parseInt(t.height)){t.host.height(t.height);j(n)}}}else{if(t.virtualSize){if(t.hScrollBar.css("visibility")!="hidden"){t.host.height(t.virtualSize.height+parseInt(t.scrollBarSize)+3);t.height=t.virtualSize.height+parseInt(t.scrollBarSize)+3;n=t.height}else{t.host.height(t.virtualSize.height);t.height=t.virtualSize.height;n=t.virtualSize.height}}}var c=t.scrollBarSize;if(isNaN(c)){c=parseInt(c);if(isNaN(c)){c="17px"}else{c=c+"px"}}c=parseInt(c);var m=4;var e=2;var f=1;if(t.vScrollBar){if(t.vScrollBar[0].style.visibility!="hidden"){f=c+m}else{t.vScrollInstance.setPosition(0)}}else{return}if(t.hScrollBar){if(t.hScrollBar[0].style.visibility!="hidden"){e=c+m}else{t.hScrollInstance.setPosition(0)}}else{return}if(t.autoItemsHeight){t.hScrollBar[0].style.visibility="hidden";e=0}if(n==null){n=0}var q=parseInt(n)-m-c;if(q<0){q=0}if(parseInt(t.hScrollBar[0].style.height)!=c){if(parseInt(c)<0){c=0}t.hScrollBar[0].style.height=parseInt(c)+"px"}if(t.hScrollBar[0].style.top!=q+"px"){t.hScrollBar[0].style.top=q+"px";t.hScrollBar[0].style.left="0px"}var b=p-c-m;if(b<0){b=0}var l=b+"px";if(t.hScrollBar[0].style.width!=l){t.hScrollBar[0].style.width=l}if(f<=1){if(p>=2){t.hScrollBar[0].style.width=parseInt(p-2)+"px"}}if(c!=parseInt(t.vScrollBar[0].style.width)){t.vScrollBar[0].style.width=parseInt(c)+"px"}if((parseInt(n)-e)!=parseInt(t.vScrollBar[0].style.height)){var s=parseInt(n)-e;if(s<0){s=0}t.vScrollBar[0].style.height=s+"px"}if(p==null){p=0}var d=parseInt(p)-parseInt(c)-m+"px";if(d!=t.vScrollBar[0].style.left){if(parseInt(d)>=0){t.vScrollBar[0].style.left=d}t.vScrollBar[0].style.top="0px"}var k=t.vScrollInstance;k.disabled=t.disabled;if(u){k._arrange()}var o=t.hScrollInstance;o.disabled=t.disabled;if(u){o._arrange()}if((t.vScrollBar[0].style.visibility!="hidden")&&(t.hScrollBar[0].style.visibility!="hidden")){t.bottomRight[0].style.visibility="inherit";t.bottomRight[0].style.left=1+parseInt(t.vScrollBar[0].style.left)+"px";t.bottomRight[0].style.top=1+parseInt(t.hScrollBar[0].style.top)+"px";if(t.rtl){t.bottomRight.css({left:0})}t.bottomRight[0].style.width=parseInt(c)+3+"px";t.bottomRight[0].style.height=parseInt(c)+3+"px"}else{t.bottomRight[0].style.visibility="hidden"}if(parseInt(t.content[0].style.width)!=(parseInt(p)-f)){var i=parseInt(p)-f;if(i<0){i=0}t.content[0].style.width=i+"px"}if(t.rtl){t.vScrollBar.css({left:0+"px",top:"0px"});t.hScrollBar.css({left:t.vScrollBar.width()+2+"px"});if(t.vScrollBar[0].style.visibility!="hidden"){t.content.css("margin-left",4+t.vScrollBar.width())}else{t.content.css("margin-left",0);t.hScrollBar.css({left:"0px"})}if(t.filterable&&t.filterInput){t.filterInput.css({left:t.vScrollBar.width()+6+"px"})}}if(parseInt(t.content[0].style.height)!=(parseInt(n)-e)){var r=parseInt(n)-e;if(r<0){r=0}t.content[0].style.height=r+"px";t.content[0].style.top="0px"}if(g>0){t.content[0].style.top=g+"px";t.content[0].style.height=parseInt(t.content[0].style.height)-g+"px"}if(t.filterable){t.filterInput[0].style.height=(g-6)+"px";t.filterInput[0].style.top="3px";if(!t.rtl){t.filterInput[0].style.left=parseInt(t.content.css("left"))+3+"px"}t.filterInput[0].style.width=parseInt(t.content.css("width"))-7+"px";t.filter[0].style.display="block"}else{t.filter[0].style.display="none"}if(t.overlayContent){t.overlayContent.width(parseInt(p)-f);t.overlayContent.height(parseInt(n)-e)}},ensureVisible:function(h,i){if(isNaN(h)){var l=this.getItemByValue(h);if(l){h=l.index}}var f=this.isIndexInView(h);if(!f){if(h<0){return}if(this.autoHeight){var g=a.data(this.vScrollBar[0],"jqxScrollBar").instance;g.setPosition(0)}else{for(indx=0;indxk+this.host.height()-b){var c=this.host.height();if(this.filterable){g.setPosition(this.filterHeight+2+l.initialTop+l.height+2-c+d)}else{g.setPosition(l.initialTop+l.height+2-c+d);if(indx===this.visibleItems.length-1){g.setPosition(g.max)}}if(i){var k=g.value;var j=l.initialTop;if(this.filterable){j=this.filterHeight+2+l.initialTop}if(k+c=b.min){b.setPosition(b.value-b.largestep);return true}else{if(b.value!=b.min){b.setPosition(b.min);return true}}return false},databind:function(b,d){this.records=new Array();var f=b._source?true:false;var c=new a.jqx.dataAdapter(b,{autoBind:false});if(f){c=b;b=b._source}var e=function(k){if(b.type!=undefined){c._options.type=b.type}if(b.formatdata!=undefined){c._options.formatData=b.formatdata}if(b.contenttype!=undefined){c._options.contentType=b.contenttype}if(b.async!=undefined){c._options.async=b.async}};var h=function(q,r){var s=function(w){var D=null;if(typeof w==="string"){var z=w;var A=w;var C=""}else{if(q.displayMember!=undefined&&q.displayMember!=""){var A=w[q.valueMember];var z=w[q.displayMember]}}var C="";if(q.groupMember){C=w[q.groupMember]}else{if(w&&w.group!=undefined){C=w.group}}if(q.searchMember){D=w[q.searchMember]}else{if(w&&w.searchLabel!=undefined){D=w.searchLabel}}if(!q.valueMember&&!q.displayMember){if(a.type(w)=="string"){z=A=w.toString()}}if(w&&w.label!=undefined){var z=w.label}if(w&&w.value!=undefined){var A=w.value}var B=false;if(w&&w.checked!=undefined){B=w.checked}var v="";if(w&&w.html!=undefined){v=w.html}var t=true;if(w&&w.visible!=undefined){t=w.visible}var u=false;if(w&&w.disabled!=undefined){u=w.disabled}var y=false;if(w&&w.hasThreeStates!=undefined){y=w.hasThreeStates}var x={};x.label=z;x.value=A;x.searchLabel=D;x.html=v;x.visible=t;x.originalItem=w;x.group=C;x.groupHtml="";x.disabled=u;x.checked=B;x.hasThreeStates=y;return x};if(r!=undefined){var k=c._changedrecords[0];if(k){a.each(c._changedrecords,function(){var t=this.index;var u=this.record;if(r!="remove"){var v=s(u)}switch(r){case"update":q.updateAt(v,t);break;case"add":q.insertAt(v,t);break;case"remove":q.removeAt(t);break}});return}}q.records=c.records;var m=q.records.length;var p=new Array();for(var l=0;l1&&arguments[1]&&a.type(arguments[1])=="string"){j.label=x;j.value=arguments[1]}}else{if(x.label==null&&x.value==null&&x.html==null&&x.group==null&&x.groupHtml==null){j.label=x.toString();j.value=x.toString()}else{j.label=x.label;j.value=x.value;if(j.label===undefined){j.label=x.value}if(j.value===undefined){j.value=x.label}}}if(typeof x!="string"){if(x.label===undefined){if(t.displayMember!=""){if(x[t.displayMember]!=undefined){j.label=x[t.displayMember]}else{j.label=""}}}if(x.value===undefined){if(t.valueMember!=""){j.value=x[t.valueMember]}}}j.hasThreeStates=x.hasThreeStates!=undefined?x.hasThreeStates:true;j.originalItem=x;if(o){j.originalItem=x.originalItem}j.title=z;if(z&&j.value===undefined&&j.label===undefined){j.value=j.label=z}j.html=x.html||"";if(x.html&&x.html!=""){if(z&&z!=""){}}j.group=y;j.checked=x.checked||false;j.groupHtml=x.groupHtml||"";j.disabled=x.disabled||false;j.visible=x.visible!=undefined?x.visible:true;j.searchLabel=v;j.index=b;e[b]=j;b++;return j});var c=new Array();var p=0;if(this.fromSelect==undefined||this.fromSelect==false){for(var h=0;h=this.items.length){g.index=this.items.length;this.items[this.items.length]=g}else{var c=new Array();var j=0;var e=false;var h=0;for(var b=0;b=f&&!e){c[j++]=g;g.index=f;h++;e=true}}c[j]=this.items[b];if(!this.items[b].isGroup){c[j].index=h;h++}j++}this.items=c}var k=g.value;if(g.value==""||g.value==null){k=f}this.itemsByValue[a.trim(k).split(" ").join("_")]=g;this.visibleItems=new Array();this.renderedVisibleItems=new Array();var d=a.data(this.vScrollBar[0],"jqxScrollBar").instance;var i=d.value;d.setPosition(0);if((this.allowDrag&&this._enableDragDrop)||(this.virtualSize&&this.virtualSize.height<10+this.host.height())){this._addItems(true)}else{this._addItems(false)}if(this.groups.length>1){}this._renderItems();if(this.allowDrag&&this._enableDragDrop){this._enableDragDrop()}d.setPosition(i);if(this.rendered){this.rendered()}return true},removeAt:function(j){if(j<0||j>this.items.length-1){return false}if(j==undefined){return false}var d=this.items[j].height;var n=this.items[j].value;if(n==""||n==null){n=j}this.itemsByValue[a.trim(n).split(" ").join("_")]=null;if(this.groups.length>1){var h=new Array();for(var b=0;b0){if(this.virtualSize){this.virtualSize.height-=d;var o=this.virtualSize.itemsPerPage*2;if(this.autoHeight){o=this.items.length}this.virtualItemsCount=Math.min(o,this.items.length)}this._updatescrollbars()}else{this._addItems()}this._renderItems();if(this.allowDrag&&this._enableDragDrop){this._enableDragDrop()}if(this.vScrollBar.css("visibility")!="hidden"){e.setPosition(l)}else{e.setPosition(0)}this.itemsByValue=new Array();for(var g=0;gthis.items.length-1){return false}this.items[b].disabled=true;this._renderItems();return true},enableAt:function(b){if(!this.items){return false}if(b<0||b>this.items.length-1){return false}this.items[b].disabled=false;this._renderItems();return true},destroy:function(){if(this.source&&this.source.unbindBindingUpdate){this.source.unbindBindingUpdate(this.element.id)}this._removeHandlers();this.vScrollBar.jqxScrollBar("destroy");this.hScrollBar.jqxScrollBar("destroy");this.vScrollBar.remove();this.hScrollBar.remove();this.content.remove();a.jqx.utilities.resize(this.host,null,true);var b=a.data(this.element,"jqxListBox");delete this.hScrollInstance;delete this.vScrollInstance;delete this.vScrollBar;delete this.hScrollBar;delete this.content;delete this.bottomRight;delete this.itemswrapper;delete this.visualItems;delete this.visibleItems;delete this.items;delete this.groups;delete this.renderedVisibleItems;delete this._mousewheelfunc;delete this._mousemovefunc;delete this._cachedItemHtml;delete this.itemsByValue;delete this._activeElement;delete this.source;delete this.events;if(this.input){this.input.remove();delete this.input}if(b){delete b.instance}this.host.removeData();this.host.removeClass();this.host.remove();this.element=null;delete this.element;this.host=null;delete this.set;delete this.get;delete this.call;delete this.host},_raiseEvent:function(f,c){if(this._stopEvents==true){return true}if(c==undefined){c={owner:null}}var d=this.events[f];args=c;args.owner=this;this._updateInputSelection();var e=new a.Event(d);e.owner=this;e.args=args;if(this.host!=null){var b=this.host.trigger(e)}return b}})})(jqxBaseFramework);(function(a){a.jqx.parseSourceTag=function(m){var l=new Array();var o=a(m).find("option");var b=a(m).find("optgroup");var k=false;if(o.length===0){o=a(m).find("li");if(o.length>0){k=true}}var d=null;var j=0;var d=-1;var h=this;var c=new Array();a.each(o,function(p){var q=b.find(this).length>0;var s=null;if(this.text!=null&&(this.label==null||this.label=="")){this.label=this.text}if(k===true){this.label=a(this).text();this.selected=a(this).attr("data-selected");this.checked=this.selected;this.value=a(this).attr("data-value")||p;this.disabled=a(this).attr("disabled")}var r={style:this.style.cssText,selected:this.selected,html:this.innerHTML,classes:this.className,disabled:this.disabled,value:this.value,label:this.label,title:this.title,originalItem:this};var i=a.jqx.browser.msie&&a.jqx.browser.version<8;if(i&&!k){if(r.value==""&&this.text!=null&&this.text.length>0){r.value=this.text}}if(q){s=b.find(this).parent()[0].label;r.group=s;if(!c[s]){c[s]=new Array();c.length++}c[s].push(r)}if(this.selected){d=p}r.checked=this.selected;if(r.label!==undefined){l.push(r)}});if(c.length>0){var n=new Array();for(var f in c){if(f==="indexOf"){continue}var g=null;for(var e=0;e0){return{items:n,index:d}}else{return{items:l,index:d}}};a.jqx._jqxListBox.item=function(){var b={group:"",groupHtml:"",selected:false,isGroup:false,highlighted:false,value:null,label:"",html:null,visible:true,disabled:false,element:null,width:null,height:null,initialTop:null,top:null,left:null,title:"",index:-1,checkBoxElement:null,originalItem:null,checked:false,visibleIndex:-1};return b}})(jqxBaseFramework);
\ No newline at end of file
diff --git a/static/js/jqxmenu.js b/static/js/jqxmenu.js
new file mode 100644
index 0000000..4099fbe
--- /dev/null
+++ b/static/js/jqxmenu.js
@@ -0,0 +1,7 @@
+/*
+jQWidgets v3.9.0 (2015-Oct)
+Copyright (c) 2011-2015 jQWidgets.
+License: http://jqwidgets.com/license/
+*/
+
+(function(a){a.jqx.jqxWidget("jqxMenu","",{});a.extend(a.jqx._jqxMenu.prototype,{defineInstance:function(){var b={items:new Array(),mode:"horizontal",width:null,height:null,minimizeWidth:"auto",easing:"easeInOutSine",animationShowDuration:200,animationHideDuration:200,autoCloseInterval:0,animationHideDelay:100,animationShowDelay:100,menuElements:new Array(),autoSizeMainItems:false,autoCloseOnClick:true,autoCloseOnMouseLeave:true,enableRoundedCorners:true,disabled:false,autoOpenPopup:true,enableHover:true,autoOpen:true,autoGenerate:true,clickToOpen:false,showTopLevelArrows:false,touchMode:"auto",source:null,popupZIndex:17000,rtl:false,keyboardNavigation:false,lockFocus:false,title:"",events:["shown","closed","itemclick","initialized","open","close"]};a.extend(true,this,b);return b},createInstance:function(c){var b=this;this.host.attr("role","menubar");a.jqx.utilities.resize(this.host,function(){b.refresh()},false,this.mode!="popup");if(this.minimizeWidth!="auto"&&this.minimizeWidth!=null&&this.width&&this.width.toString().indexOf("%")==-1){a(window).resize(function(){b.refresh()})}this.host.css("outline","none");if(this.source){if(this.source!=null){var d=this.loadItems(this.source);this.element.innerHTML=d}}this._tmpHTML=this.element.innerHTML;if(this.element.innerHTML.indexOf("UL")){var e=this.host.find("ul:first");if(e.length>0){this._createMenu(e[0])}}this.host.data("autoclose",{});this._render();this.setSize();if(a.jqx.browser.msie&&a.jqx.browser.version<8){this.host.attr("hideFocus",true)}},focus:function(){try{this.host.focus();if(this.mode==="popup"){var d=this.host.closest("div.jqx-menu-wrapper");d.focus()}if(this.keyboardNavigation){var c=this;var e=function(){if(!a.jqx.isHidden(a(c.items[0].element))){a(c.items[0].element).addClass(c.toThemeProperty("jqx-fill-state-focus"));c.activeItem=c.items[0]}else{var f=c._nextVisibleItem(c.items[0],0);if(f){a(f.element).addClass(c.toThemeProperty("jqx-fill-state-focus"));c.activeItem=f}}};if(!this.activeItem){e()}else{if(!a.jqx.isHidden(a(this.activeItem.element))){a(this.activeItem.element).addClass(this.toThemeProperty("jqx-fill-state-focus"))}else{a(this.activeItem.element).removeClass(this.toThemeProperty("jqx-fill-state-focus"));e()}}}}catch(b){}},loadItems:function(c,e){if(c==null){return}if(c.length==0){return""}var b=this;this.items=new Array();var d='