/** * ParamQuery Grid a.k.a. pqGrid v1.1.3 * * Copyright (c) 2012-2013 Paramvir Dhindsa * Released under GPL v3 license * http://paramquery.com/license * */ (function(a){a.paramquery=(a.paramquery==null)?{}:a.paramquery;a.paramquery.xmlToArray=function(d,e){var c=e.itemParent;var g=e.itemNames;var b=[];var f=a(d).find(c);f.each(function(k,l){var j=a(l);var h=[];a(g).each(function(i,m){h.push(j.find(m).text())});b.push(h)});return b};a.paramquery.tableToArray=function(h){var i=a(h);var c=[];var f=[];var g=[];var e=[];var b=i.find("tr:first");var d=i.find("tr:eq(1)");b.find("th,td").each(function(p,m){var j=a(m);var r=j.html();var k=j.width();var s="string";var n=d.find("td:eq("+p+")");var l=n.text();var q=n.attr("align");l=l.replace(/,/g,"");if(parseInt(l)==l&&(parseInt(l)+"").length==l.length){s="integer"}else{if(parseFloat(l)==l){s="float"}}var o={title:r,width:k,dataType:s,align:q,dataIndx:p};c.push(o)});i.find("tr").each(function(k,m){if(k==0){return}var l=a(m);var j=[];l.find("td").each(function(n,o){j.push(a.trim(a(o).html()))});f.push(j)});return{data:f,colModel:c}};a.paramquery.formatCurrency=function(h){h=Math.round(h*10)/10;h=h+"";if(h.indexOf(".")==-1){h=h+".0"}var c=h.length;var e=h.substring(0,c-2),g=h.substring(c-2,c),b=e.match(/\d/g).reverse(),d=[];for(var f=0;f0&&f%3==0){d.push(",")}d.push(b[f])}d=d.reverse();e=d.join("");return e+g}})(jQuery);(function(b){var a={};a.options={currentPage:0,totalPages:0,totalRecords:0,msg:"",rPPOptions:[10,20,30,40,50,100],rPP:20};a._regional={strPage:"Page {0} of {1}",strFirstPage:"First Page",strPrevPage:"Previous Page",strNextPage:"Next Page",strLastPage:"Last Page",strRefresh:"Refresh",strRpp:"Records per page:",strDisplay:"Displaying {0} to {1} of {2} items."};b.extend(a.options,a._regional);a._create=function(){var d=this,c=this.options;this.element.addClass("pq-pager").css({});this.first=b("",{}).appendTo(this.element).button({icons:{primary:"pq-page-first"},text:false}).bind("click.paramquery",function(e){if(d.options.currentPage>1){if(d._trigger("change",e,{curPage:1})!==false){d.option({currentPage:1})}}});this.prev=b("").appendTo(this.element).button({icons:{primary:"pq-page-prev"},text:false}).bind("click",function(e){if(d.options.currentPage>1){var f=d.options.currentPage-1;if(d._trigger("change",e,{curPage:f})!==false){d.option({currentPage:f})}}});b("").appendTo(this.element);this.pagePlaceHolder=b("").appendTo(this.element);b("").appendTo(this.element);this.next=b("").appendTo(this.element).button({icons:{primary:"pq-page-next"},text:false}).bind("click",function(e){var f=d.options.currentPage+1;if(d._trigger("change",e,{curPage:f})!==false){d.option({currentPage:f})}});this.last=b("").appendTo(this.element).button({icons:{primary:"pq-page-last"},text:false}).bind("click",function(e){var f=d.options.totalPages;if(d._trigger("change",e,{curPage:f})!==false){d.option({currentPage:f})}});b("").appendTo(this.element);this.$strRpp=b(""+this.options.strRpp+" ").appendTo(this.element);this.$rPP=b("").appendTo(this.element).change(function(e){var f=b(this).val();if(d._trigger("change",e,{rPP:f})!==false){d.options.rPP=f}});b("").appendTo(this.element);this.$refresh=b("").appendTo(this.element).button({icons:{primary:"pq-refresh"},text:false}).bind("click",function(e){if(d._trigger("refresh",e)!==false){}});b("").appendTo(this.element);this.$msg=b("").appendTo(this.element);this._refresh()};a._refreshPage=function(){var d=this;this.pagePlaceHolder.empty();var g=this.options.strPage;var c=g.split(" ");var f="";b(c).each(function(h,j){f+=""+j+""});g=f.replace("{0}","");g=g.replace("{1}","");var e=b(g).appendTo(this.pagePlaceHolder);this.page=b("").replaceAll("span.textbox",e).bind("change",function(h){var i=b(this);var j=i.val();if(isNaN(j)||j<1){i.val(d.options.currentPage);return false}j=parseInt(j);if(j>d.options.totalPages){i.val(d.options.currentPage);return false}if(d._trigger("change",h,{curPage:j})!==false){d.option({currentPage:j})}else{i.val(d.options.currentPage);return false}});this.$total=e.filter("span.total")};a._refresh=function(){this._refreshPage();var e=(this.$rPP);var l=this.options;this.$strRpp.text(l.strRpp);this.first.attr("title",l.strFirstPage);this.prev.attr("title",l.strPrevPage);this.next.attr("title",l.strNextPage);this.last.attr("title",l.strLastPage);this.$refresh.attr("title",l.strRefresh);e.empty();var c=this.options.rPPOptions;for(var g=0;g=this.options.totalPages){this.next.button({disabled:true});this.last.button({disabled:true})}else{this.next.button({disabled:false});this.last.button({disabled:false})}if(this.options.currentPage<=1){this.first.button({disabled:true});this.prev.button({disabled:true})}else{this.first.button({disabled:false});this.prev.button({disabled:false})}this.page.val(this.options.currentPage);this.$total.text(this.options.totalPages);if(this.options.totalRecords>0){var h=this.options.rPP;var j=this.options.currentPage;var k=this.options.totalRecords;var n=(j-1)*h;var m=j*h;if(m>k){m=k}var f=this.options.strDisplay;f=f.replace("{0}",n+1);f=f.replace("{1}",m);f=f.replace("{2}",k);this.$msg.html(f)}else{this.$msg.html("")}};a._destroy=function(){this.element.empty().removeClass("pq-pager").enableSelection()};a._setOption=function(c,d){if(c=="currentPage"||c=="totalPages"){d=parseInt(d)}b.Widget.prototype._setOption.call(this,c,d)};a._setOptions=function(){b.Widget.prototype._setOptions.apply(this,arguments);this._refresh()};b.widget("paramquery.pqPager",a);b.paramquery.pqPager.regional={};b.paramquery.pqPager.regional.en=a._regional;b.paramquery.pqPager.setDefaults=function(d){for(var c in d){a.options[c]=d[c]}b.widget("paramquery.pqPager",a);b(".pq-pager").each(function(f,e){b(e).pqPager("option",d)})}})(jQuery);(function(b){var a={};a.options={length:200,num_eles:3,cur_pos:0,timeout:350,pace:"optimum",direction:"vertical"};a._destroy=function(){this.element.removeClass("pq-scrollbar-vert").enableSelection().removeClass("pq-scrollbar-horiz").unbind("click.pq-scrollbar").empty();this.element.removeData()};a._create=function(){this.length=this.options.length;this.direction=this.options.direction;this.num_eles=this.options.num_eles;var e=this;var f=this.element.empty();if(this.direction=="vertical"){f.addClass("pq-scrollbar-vert");f.html("
")}else{f.addClass("pq-scrollbar-horiz");f.width(this.width);f.html("
")}this.element.disableSelection().bind("click.pq-scrollbar",function(i){if(e.options.disabled){return}if(e.$slider.is(":hidden")){return}if(e.direction=="vertical"){var n=i.pageY;var l=e.element.offset().top;var k=l+e.length;var h=e.$slider.offset().top;var j=h+e.$slider.height();if(nl+17){var o=n-l;e.$slider.css("top",o);e._updateCurPosAndTrigger(i)}else{if(n>j&&nj){e.$slider.css("left",m-e.element.offset().left-e.$slider.width());e._updateCurPosAndTrigger(i)}}}});var d="x";if(this.direction=="vertical"){d="y"}this.$slider=b("div.pq-sb-slider",this.element).draggable({axis:d,helper:function(h,i){e._setDragLimits();return this},start:function(h){e.topWhileDrag=null},drag:function(h){e.dragging=true;var i=e.options.pace;if(i=="optimum"){e._setNormalPace(h)}else{if(i=="fast"){e._updateCurPosAndTrigger(h)}}},stop:function(h){e._updateCurPosAndTrigger(h);e.dragging=false;e._refresh()}});function c(h){if(e.options.cur_pos>0){e.options.cur_pos--;e.updateSliderPos();e.scroll(h)}}this.$top_btn=b("div.top-btn,div.left-btn",this.element).click(function(h){if(e.options.disabled){return}c(h);h.preventDefault();return false}).mousedown(function(h){if(e.options.disabled){return}e.mousedownTimeout=window.setTimeout(function(){e.mousedownInterval=window.setInterval(function(){c(h)},50)},e.options.timeout)}).bind("mouseup mouseout",function(h){if(e.options.disabled){return}e._mouseup(h)});function g(h){if(e.options.cur_posd){return}else{if(this.topWhileDrag>g&&e.options.cur_pos=this.num_eles){this.options.cur_pos=this.num_eles-1}if(this.options.cur_pos<0){this.options.cur_pos=0}};a.updateSliderPos=function(){var c=(this.scroll_space*(this.options.cur_pos))/(this.num_eles-1);if(this.direction=="vertical"){this.$slider.css("top",17+c)}else{this.$slider.css("left",17+c)}};a.scroll=function(c){var d=this.options;this._trigger("scroll",c,{cur_pos:d.cur_pos,num_eles:d.num_eles})};a._setOption=function(c,d){if(c=="disabled"){if(d==true){this.$slider.draggable("disable")}else{this.$slider.draggable("enable")}}b.Widget.prototype._setOption.call(this,c,d)};a._setOptions=function(){b.Widget.prototype._setOptions.apply(this,arguments);this._refresh()};b.widget("paramquery.pqScrollBar",a)})(jQuery);(function(h){var c=function(i){this.that=i};var d=c.prototype;d._generateTables=function(m){var t=this.that,z=t.colModel,I=z.length,y=t.options,G=y.columnBorders,q=y.rowBorders,A=y.scrollModel,v=t.outerWidths;t._bufferObj_calcInitFinal();var s=(m)?0:t.init,o=(m)?m.data.length-1:t["final"],H=(m&&m.data)?m.data:t.data,r=t.getRowIndxOffset();if(!m&&(s==null||o==null)){t.$cont.empty();t.$tbl=null;return}if(!m){t._trigger("beforeTableView",null,{data:t.data,curPos:s,finalPos:o,curPage:t.dataModel.curPage})}var F="pq-grid-cell ";if(!y.wrap||m){F+="pq-wrap-text "}var l="pq-grid-table ";if(G){l+="pq-grid-td-border-right "}if(q){l+="pq-grid-td-border-bottom "}var D=[""];var B=[];if(1==1){D.push("");if(t.numberCell){var u=t.numberCellWidth+1;D.push("")}for(var p=0;p")}for(var C=0;C")}D.push("")}this.offsetRow=null;do{var j=H[s],x=j,w=s,E=x.hidden,i="";if(E){if(s==o){break}s++;continue}if(this.offsetRow==null&&w!=null){this.offsetRow=(s-w)}this._generateRow(x,w,z,I,B,r,F,D,m);if(A.scrollTillLastRow){}else{if(s==o){break}s++}}while(1==1);t.scrollMode=false;if(!A.scrollTillLastRow){h.measureTime(function(){D.push("
");var L=D.join("");if(m){m.$cont.empty();var M=h(L);m.$cont.append(M);if(!t.tables){t.tables=[]}var K=-1;for(var J=0;J"+t+"";if(k!=undefined){k.html(r)}return r};d._generateRow=function(r,q,x,I,y,n,F,B,j){var s="pq-grid-row";var p=this.that,u=p.options,G=u.columnBorders,t=u.wrap,D=u.customData;var E={rowIndx:q+n,rowIndxPage:q,rowData:r,wrap:t,customData:D};if(u.oddRowsHighlight&&(q/2==parseInt(q/2))){s+=" pq-grid-oddRow"}if(r.selectedRow){s+=" pq-row-select ui-state-highlight"}B.push("");if(p.numberCell){B.push("
"+((j)?" ":(q+1))+"
")}for(var m=0;m "+this._renderCell(E)+"";B.push(z)}for(var A=0;A "+this._renderCell(E)+"";B.push(z)}B.push("");return B};var e=function(i){this.that=i;this.options=i.options;this.selectedRows=[];this.isDirty=false};var b=e.prototype;b._addToData=function(i){var j=this.options.dataModel.location;var m=(j=="remote")?this.that.data:this.options.dataModel.data,k=(j=="remote")?i.rowIndxPage:i.rowIndx,l=m[k];l.selectedRow=true};b.setDirty=function(){if(this.selectedRows.length>0){this.isDirty=true}};b.removeAll=function(k){if(this.isDirty){this.refresh()}var o=k.raiseEvent,n=this.that,q=(k.offset==null)?n.getRowIndxOffset():obj.offset;var p=this.selectedRows.slice(0);for(var l=0;l0){this.isDirty=true}};g.removeAll=function(r){if(this.isDirty){this.refresh()}var j=r.raiseEvent,o=this.that,k=(r.offset==null)?o.getRowIndxOffset():obj.offset;var q=this.selectedCells.slice(0);for(var m=0;m").css("opacity",0.2).appendTo(this.element)}};f._enable=function(){if(this.$disable){this.element[0].removeChild(this.$disable[0]);this.$disable=null}};f._destroy=function(){this._destroyResizable();this._destroyDraggable();this.element.empty();this.element.css("height","");this.element.css("width","");this.element.removeClass("pq-grid ui-widget ui-widget-content ui-corner-all").removeData()};f._findCellFromEvtCoords=function(t){if(this.$tbl==null){return{$td:null,rowIndxPage:null,colIndx:null}}var s=t.pageY-this.$cont.offset().top;var n=t.pageX-this.$cont.offset().left;var m=this.$tbl.find("tr");var r=0,k=0,o=0;for(var p=1;ps){break}else{r++}}var q=h(m[r]);k=parseInt(q.attr("pq-row-indx"));var j=q.find("td");r=0;for(var p=1;pn){break}else{r++}}var l=h(j[r]);if(l[0].nodeName.toUpperCase()!="TD"){l=h(t.target).parent("td")}o=parseInt(l.attr("pq-col-indx"));return{$td:l,rowIndxPage:k,colIndx:o}};f._rangeSelectRow=function(l,o,q){var n=this,p=n.sRows.getSelection(),j=p.slice(0);for(var m=0;mo){n.sRows.remove({rowIndx:r})}}for(var r=l;r<=o;r++){n.sRows.add({rowIndx:rowIndx})}};f._rangeSelect=function(q,n,u,r,v){var s=this,k=s.sCells.getSelection(),m=k.slice(0);for(var p=0;pu){s.sCells.remove({rowIndx:w,colIndx:j,dataIndx:t})}else{if(w==q&&jr){s.sCells.remove({rowIndx:w,colIndx:j,dataIndx:t})}}}}for(var j=0;jr){break}else{s.sCells.add({rowIndx:w,colIndx:j,dataIndx:t})}}w++}while(w<=u)}};f._blockSelect=function(q,n,u,r,v){var s=this,k=s.sCells.getSelection(),m=k.slice(0);for(var p=0;pr){s.sCells.remove({rowIndx:w,dataIndx:t,colIndx:j})}else{if(wu){s.sCells.remove({rowIndx:w,dataIndx:t,colIndx:j})}}}for(var j=n;j<=r;j++){var l=s.colModel[j];var t=l.dataIndx;if(l.hidden){continue}var w=q;do{s.sCells.add({rowIndx:w,colIndx:j,dataIndx:t});w++}while(w<=u)}};f._create=function(){this.cTable=new c(this);this.minWidth=this.options.minWidth;this.cols=[];this.dataModel=this.options.dataModel;this.widths=[];this.outerWidths=[];this.rowHeight=22;this.hidearr=[];this.hidearrHS=[];this.numberCell=this.options.numberCell;this.numberCellWidth=this.options.numberCellWidth;this.freezeCols=this.options.freezeCols;this.tables=[];var l=this;this.$tbl=null;this._refreshHeader();this._refreshWidths();this._computeOuterWidths();this.element.empty().addClass("pq-grid ui-widget ui-widget-content"+(this.options.roundCorners?" ui-corner-all":"")).append("
 
");if(this.options.direction=="rtl"){this.element.addClass("pq-rtl")}this._trigger("render",null,{dataModel:this.options.dataModel,colModel:this.colModel});this.$top=h("div.pq-grid-top",this.element);this.$title=h("div.pq-grid-title",this.element);this.$toolbar=h("div.pq-grid-toolbar",this.element);this.$grid_inner=h("div.pq-grid-inner",this.element);this.$grid_right=h(".pq-grid-right",this.element);this.$header_o=h("div.pq-header-outer",this.$grid_right);if(!this.options.topVisible){this.$top.css("display","none")}this.$header=h(".pq-grid-header",this.$grid_right);this.$header_left=h(this.$header[0]);this.$header_right=h(this.$header[1]);this.$bottom=h("div.pq-grid-bottom",this.element);if(!this.options.bottomVisible){this.$bottom.css("display","none")}this.$footer=h("div.pq-grid-footer",this.element);this.$cont_o=h("div.pq-cont-right",this.$grid_right);this.$cont_fixed=h("div.pq-cont-fixed",this.$grid_right);this.$cont=h("div.pq-cont",this.$grid_right);this.$cont.on("click",function(n){return l._onClickCont(n)});this.$cont.on("click",".pq-tree-expand-icon",function(n){return l.cTreeView._onClickTreeExpandIcon(n)});this.$cont.on("click","td.pq-grid-cell",function(n){return l._onClickCell(n)});this.$cont.on("click","tr.pq-grid-row",function(n){return l._onClickRow(n)});this.$cont.on("dblclick","td.pq-grid-cell",function(n){return l._onDblClickCell(n)});this.$cont.on("dblclick","tr.pq-grid-row",function(n){return l._onDblClickRow(n)});this.$cont.on("mouseenter","td.pq-grid-cell",function(n){var o=h(this);if(l._trigger("cellMouseEnter",n,{$td:o,dataModel:l.options.dataModel})==false){return false}if(l.options.hoverMode=="cell"){l.highlightCell(o)}});this.$cont.on("mouseenter","tr.pq-grid-row",function(n){var o=h(this);if(l._trigger("rowMouseEnter",n,{$tr:o,dataModel:l.options.dataModel})==false){return false}if(l.options.hoverMode=="row"){l.highlightRow(o)}});this.$cont.on("mouseleave","td.pq-grid-cell",function(n){var o=h(this);if(l._trigger("cellMouseLeave",n,{$td:o,dataModel:l.options.dataModel})==false){return false}if(l.options.hoverMode=="cell"){l.unHighlightCell(o)}});this.$cont.on("mouseleave","tr.pq-grid-row",function(n){var o=h(this);if(l._trigger("rowMouseLeave",n,{$tr:o,dataModel:l.options.dataModel})==false){return false}if(l.options.hoverMode=="row"){l.unHighlightRow(o)}});this.$cont.bind("mousewheel DOMMouseScroll",function(n){return l._onMouseWheel(n)});var i=0;this.$hvscroll=h("
").appendTo(this.$grid_inner);this.$vscroll=h("
").appendTo(this.$grid_inner);this.prevVScroll=0;this.$vscroll.pqScrollBar({pace:l.options.scrollModel.pace,direction:"vertical",cur_pos:0,scroll:function(n,o){l.scrollMode=true;l.selectCellRowCallback(function(){l.cTable._generateTables()});h.measureTime(function(){var p;if(n.originalEvent&&n.originalEvent.type=="drag"){p=l._setScrollVNumEles()}else{p=l._setScrollVNumEles(true)}if(p<=1){l._setScrollHLength()}},"scrollBar setNumEles stuff")}});var k=0;this.$hscroll=h("
").appendTo(this.$grid_inner);this.$hscroll.pqScrollBar({direction:"horizontal",pace:l.options.scrollModel.pace,cur_pos:0,scroll:function(n,o){l._bufferObj_calcInitFinalH();l._refreshHideArrHS();l.scrollMode=true;l.selectCellRowCallback(function(){l._createHeader();l._refreshHeaderSortIcons();l.cTable._generateTables();l._refreshOtherTables()})}});this.element.width(this.options.width).height(this.options.height);this.element.width(this.element.width());this.disableSelection();if(window.opera){this.$grid_inner.bind("keypress.pq-grid",{that:this},function(n){l.keyPressDown(n)})}else{this.$grid_inner.bind("keydown.pq-grid",{that:this},function(n){l.keyPressDown(n)})}this._refreshOptions();this._refreshTitle();var j=this.options.dataModel;if(j.sortIndx!=null&&j.sorting=="local"&&j.location=="local"){this._refreshDataIndices();var m=this.getColIndxFromDataIndx(j.sortIndx);this._sortLocalData(j.sortIndx,j.sortDir,this.colModel[m].dataType,j.data)}this._initData();this._createSelectedRowsObject();this._createSelectedCellsObject();this._refresh()};f._onMouseWheel=function(j){var m=this;var l=0;var j=j.originalEvent;if(j.wheelDelta){l=j.wheelDelta/120}else{if(j.detail){l=j.detail*-1/3}}var k=parseInt(m.$vscroll.pqScrollBar("option","cur_pos"));var i=k-l;if(i>=0){m.$vscroll.pqScrollBar("option","cur_pos",k-l).pqScrollBar("scroll")}return false};f._onDblClickCell=function(j){var l=this;var p=h(j.currentTarget);var n=l.getCellIndices(p);var i=n.rowIndxPage,o=l.getRowIndxOffset(),k=i+o,m=n.colIndx;if(l._trigger("cellDblClick",j,{$td:p,dataModel:l.options.dataModel,rowIndxPage:i,rowIndx:k,colIndx:m})==false){return false}if(this.isEditableCell({colIndx:m})&&l.options.editModel.clicksToEdit>1){l._setSelection(null);if(l.options.selectionModel.type=="cell"){l._setSelection({rowIndx:k,colIndx:m})}else{if(l.options.selectionModel.type=="row"){l._setSelection({rowIndx:k})}}l._editCell(p)}};f._onClickCont=function(i){var j=this;if(j.$td_edit){if(!j._isEditCell(i)){j.quitEditMode(i)}}};f._onClickRow=function(x){var u=this;var t=h(x.currentTarget);var j=parseInt(t.attr("pq-row-indx")),o=u.getRowIndxOffset(),p=j+o;var z={rowIndx:p,evt:x};if(u._trigger("rowClick",x,{$tr:t,rowIndxPage:j,rowIndx:p,dataModel:u.options.dataModel})==false){return false}var k=u.options.selectionModel;if(k.type=="row"){var w=u.sRows.getSelection();if(w.length>0){if(x.ctrlKey&&k.mode!="single"){if(u.sRows.indexOf(z)!=-1){u.sRows.remove(z)}else{u._setSelection(z)}}else{if(x.shiftKey&&k.mode!="single"){var n=w[w.length-1],l=n.rowIndx,r=l,v=p;if(l>p){r=p;v=l}var m=w.slice(0);for(var q=0;qv){u.sRows.remove({rowIndx:y,evt:x})}}for(var y=r;y<=v;y++){u.sRows.add({rowIndx:y,evt:x})}u._setSelection(z)}else{u.sRows.removeAll({raiseEvent:true});u._setSelection(z)}}}else{u._setSelection(z)}}};f._onDblClickRow=function(k){var n=this;var m=h(k.currentTarget);var j=parseInt(m.attr("pq-row-indx")),o=n.getRowIndxOffset(),l=j+o;var i={rowIndx:l,evt:k};if(n._trigger("rowDblClick",k,{$tr:m,rowIndxPage:j,rowIndx:l,dataModel:n.options.dataModel})==false){return false}};f.isEditableCell=function(l){var k=l.colIndx,j=(l.column==null)?(this.colModel[k]):l.column,i=true;if(this.options.editable==false){i=false}if(j.editable==false){i=false}return i};f._getRowPQData=function(i,j,k){var k=(k==null)?this.data[i]:k;return k?k[j]:null};f._setRowPQData=function(j,i,l){var l=(l==null)?this.data[j]:l;if(!l){return}for(var k in i){l[k]=i[k]}};f._onClickCell=function(t){var n=this,q=this.options,x=q.selectionModel;var m=h(t.currentTarget);var j=n.getCellIndices(m);var i=j.rowIndxPage,l=n.getRowIndxOffset(),o=j.rowIndx=i+l,w=j.colIndx,s=j.dataIndx=this.colModel[w].dataIndx,k=n.colModel[w];j.evt=t;if(n._trigger("cellClick",t,{$td:m,rowIndxPage:i,rowIndx:o,colIndx:w,dataIndx:s,column:k,dataModel:n.options.dataModel})==false){return false}if(n.$td_edit){n.quitEditMode(t)}if(this.isEditableCell({column:k})&&q.editModel.clicksToEdit=="1"){n._setSelection(null);if(x.type=="cell"){n._setSelection(j)}else{n.bringRowIntoView({rowIndxPage:i});m=n._bringCellIntoView({rowIndxPage:i,colIndx:w})}window.setTimeout(function(){n.editCell(j)},0);return}if(x.type=="cell"){var r=n.sCells.getSelection();if(r.length>0){if(t.ctrlKey&&x.mode!="single"){if(n.sCells.isSelected(j)){n.sCells.remove(j)}else{n._setSelection(j)}}else{if(t.shiftKey&&x.mode!="single"){var A=r[r.length-1],p=A.rowIndx,v=n.getColIndxFromDataIndx(A.dataIndx),u=p,z=o,y=v,B=w;if(p>o){u=o;z=p}if(n.options.selectionModel.mode=="range"){if(p>o){y=w;B=v}if(o==p&&ww){y=w;B=v}n._blockSelect(u,y,z,B,t)}}n._setSelection(j)}else{n.sCells.removeAll({raiseEvent:true});n._setSelection(j)}}}else{n._setSelection(j)}}};f.highlightCell=function(i){i.addClass("pq-grid-cell-hover ui-state-hover")};f.unHighlightCell=function(i){i.removeClass("pq-grid-cell-hover ui-state-hover")};f.highlightRow=function(i){i.addClass("pq-grid-row-hover ui-state-hover")};f.unHighlightRow=function(i){i.removeClass("pq-grid-row-hover ui-state-hover")};f._createSelectedRowsObject=function(){this.sRows=new e(this)};f._createSelectedCellsObject=function(){this.sCells=new a(this)};f._getCreateEventData=function(){return{dataModel:this.options.dataModel,data:this.data,colModel:this.options.colModel}};f._refreshOptions=function(){this._refreshDataOptions()};f._refreshDataOptions=function(){};f.enableSelection=function(){this.$grid_inner.enableSelection()};f.disableSelection=function(){this.$grid_inner.disableSelection()};f._isEditCell=function(k){var i=h(k.target);var j=i.closest("div.pq-cell-selected-border-edit");if(j&&j.length>0){return true}return false};f._findCellFromEvt=function(j){var i=h(j.target);var l=i.closest(".pq-grid-cell");if(l==null||l.length==0){return{rowIndxPage:null,colIndx:null,$td:null}}else{var k=this.getCellIndices(l);k.$td=l;return k}};f._initPager=function(){var i=this.options.dataModel;var j=this;var k={rPP:i.rPP,rPPOptions:i.rPPOptions,change:function(l,n){var m=j.options.dataModel;if(n.curPage!=undefined){m.prevPage=m.curPage;m.curPage=n.curPage}if(n.rPP!=undefined){m.rPP=n.rPP}if(m.paging=="remote"){j.remoteRequest()}else{j.$td_edit=null;j._refreshDataFromDataModel();j._refresh()}},refresh:function(l){j.refreshDataAndView()}};if(i.paging){this.$footer.pqPager(k)}else{}};f._initData=function(){var j=this;var i=this.options.dataModel;if(i==undefined){throw ("dataModel not found.")}this._initPager();if(i.location=="remote"){var j=this;this.generateLoading();this.remoteRequest()}else{this._refreshDataFromDataModel()}};f._refreshHideArrHS=function(){var l=this;for(var j=0;j0){var k=l.freezeCols-1+l.initH;for(var j=l.freezeCols;j<=k;j++){if(l.colModel[j].hidden){continue}l.hidearrHS[j]=true}}else{}};f.generateLoading=function(){if(this.$loading){this.$loading.remove()}this.$loading=h("
").appendTo(this.element);h("
"+this.options.strLoading+"...
").appendTo(this.$loading);this.$loading.find("div.pq-loading-bg").css("opacity",0.2)};f.showLoading=function(){this.element.find("div.pq-loading").show()};f.hideLoading=function(){this.element.find("div.pq-loading").hide()};f._refreshDataFromDataModel=function(){var k=this.options,j=k.dataModel;if(j.data==null||j.data.length==0){if(j.paging){j.curPage=0;j.totalPages=0;j.totalRecords=0}return}if(j.paging&&j.paging=="local"){j.totalRecords=j.data.length;j.totalPages=Math.ceil(j.data.length/j.rPP);if(j.curPage>j.totalPages){j.curPage=j.totalPages}if(j.curPage<1&&j.totalPages>0){j.curPage=1}var l=(j.curPage-1)*j.rPP;var i=j.curPage*j.rPP;if(i>j.data.length){i=j.data.length}this.data=j.data.slice(l,i)}else{this.data=j.data}};f.remoteRequest=function(n){if(this.loading){this.xhr.abort()}var k=this;var j="";var m="";var i=this.options.dataModel;if(typeof i.getUrl=="function"){var l=i.getUrl();if(l&&l.url){j=l.url}if(l&&l.data){m=l.data}}if(!j){return}this.loading=true;this.showLoading();this.xhr=h.ajax({url:j,dataType:i.dataType,async:true,cache:i.cache,type:i.method,data:m,beforeSend:function(p,o){if(typeof i.beforeSend=="function"){return i.beforeSend(p,o)}},success:function(o,s,q){var p=false;if(typeof i.getData=="function"){var r=i.getData(o,s,q);i.data=r.data;if(i.paging){if(i.paging=="remote"){if(r.curPage){i.curPage=r.curPage}if(r.totalRecords){i.totalRecords=r.totalRecords;i.totalPages=Math.ceil(i.totalRecords/i.rPP)}}}k._refreshDataFromDataModel();if(i.sorting=="local"&&i.sortIndx!=undefined){k._refreshSortingDataAndView({sorting:true})}else{k._refreshViewAfterDataSort()}}else{throw ("getData callback not found!")}k.hideLoading();k.loading=false;k._trigger("load",null,{dataModel:k.options.dataModel,data:k.data});if(typeof n=="function"){n()}},error:function(o,q,p){k.hideLoading();k.loading=false;if(typeof i.error=="function"){i.error(o,q,p)}}})};f._fixFireFoxContentEditableIssue=function(){if(window.postMessage){this.$grid_inner.focus()}};f.selectCellRowCallback=function(i){var k,l;if(this.$td_edit){this.quitEditMode()}var j=this;h.measureTime(function(){i.call(j)},"_generateTables");if(this.options.flexHeight){this.setGridHeightFromTable()}if(this.options.flexWidth){this._setGridWidthFromTable()}};f._refreshTitle=function(){this.$title.html(this.options.title)};f._refreshDraggable=function(){if(this.options.draggable){this.$title.addClass("draggable");this.element.draggable({handle:this.$title,start:function(i,j){}})}else{this._destroyDraggable()}};f._refreshResizable=function(){var i=this;if(this.options.resizable){this.element.resizable({helper:"ui-state-highlight",delay:0,start:function(j,k){h(k.helper).css({opacity:0.5,background:"#ccc",border:"1px solid steelblue"})},resize:function(j,k){},stop:function(j,k){i.options.height=i.element.height();i.options.width=i.element.width();i._refresh();i.element.css("position","relative")}})}else{this._destroyResizable()}};f.refresh=function(){this._refresh()};f._refreshDataIndices=function(){if(this.options.getDataIndicesFromColIndices==false){return}var j=this.colModel;for(var k=0;k=0&&parseInt(k)<=this.colModel.length-2){this.options.freezeCols=this.freezeCols=parseInt(k);this._setScrollHLength();h.Widget.prototype._setOption.call(this,j,k)}}else{if(j=="resizable"){h.Widget.prototype._setOption.call(this,j,k)}else{if(j=="scrollModel"){var l=k;for(var j in l){this.options.scrollModel[j]=l[j]}}else{if(j=="dataModel"){h.Widget.prototype._setOption.call(this,j,k);var i=k.paging;if(this.$footer.hasClass("pq-pager")==false&&(i=="local"||i=="remote")){this._initPager()}else{if(this.$footer.hasClass("pq-pager")&&(i!="local"&&i!="remote")){this.$footer.pqPager("destroy");this.$footer.html(" ")}}this.refreshDataAndView()}else{if(j=="selectionModel"){var l=k;for(var j in l){this.options.selectionModel[j]=l[j]}this.refreshRequired=false}else{if(j=="colModel"){h.Widget.prototype._setOption.call(this,j,k);this._refreshHeader();this._refreshWidths();this._refreshDataIndices()}else{if(j=="disabled"){if(k==true){this._disable()}else{this._enable()}this.refreshRequired=false}else{if(j=="numberCell"){this.numberCell=k;h.Widget.prototype._setOption.call(this,j,k)}else{if(j=="numberCellWidth"){this.numberCellWidth=k;h.Widget.prototype._setOption.call(this,j,k)}else{if(j=="customData"){h.Widget.prototype._setOption.call(this,j,k);this.refreshRequired=false}else{if(j=="strLoading"){h.Widget.prototype._setOption.call(this,j,k);this.generateLoading();this.refreshRequired=false}else{if(j=="topVisible"){if(k==true){this.$top.css("display","")}else{this.$top.css("display","none")}}else{if(j=="bottomVisible"){if(k==true){this.$bottom.css("display","")}else{this.$bottom.css("display","none")}}else{h.Widget.prototype._setOption.call(this,j,k)}}}}}}}}}}}}}}}}}};f._setOptions=function(){h.Widget.prototype._setOptions.apply(this,arguments);if(this.refreshRequired){this._refresh()}this.refreshRequired=true};f._generateCellRowOutline=function(l){var j=l.$td,m=l.$tr,n=this;if(m){var k=n._calcRightEdgeCol(n.colModel.length-1);k-=4;var p=m[0].offsetHeight-4;var q=h(m[0].offsetParent);var i=q[0].offsetParent;var r=m[0].offsetLeft+q[0].offsetLeft;var o=m[0].offsetTop+q[0].offsetTop;n._generateCellHighlighter(i,r,o,k,p)}else{if(j){var q=h(j[0].offsetParent);var i=q[0].offsetParent;var k=j[0].offsetWidth-4;var p=j[0].offsetHeight-4;var r=j[0].offsetLeft+q[0].offsetLeft;var o=j[0].offsetTop+q[0].offsetTop;n._generateCellHighlighter(i,r,o,k,p)}}};f._removeCellRowOutline=function(){if(this.$div_focus){this._fixFireFoxContentEditableIssue();this.$div_focus.remove();this.$div_focus=null}};f._generateCellHighlighter=function(k,l,m,j,i){if(this.$div_focus&&this.$div_focus[0].offsetParent==k){if(this.$td_edit!=null){this._fixFireFoxContentEditableIssue();this.$div_focus.empty().removeClass("pq-cell-selected-border-edit");this.$td_edit=null}this.$div_focus.css({left:l,top:m,height:i,width:j})}else{if(this.$div_focus){this.$div_focus.remove()}this.$div_focus=h("
").appendTo(k);this.$div_focus.css({left:l,top:m,height:i,width:j})}};f._selectRow=function(j,i){this.selectRow(j,i)};f._findfirstUnhiddenColIndx=function(){for(var j=0;jk-m){var s=t-(k-m);var j=this.$tbl.children().children("tr");var r=0,o=0;j.each(function(w,x){r+=x.offsetHeight;if(r>=s){o=w;return false}});var q=this.scrollCurPos+o;var v=this.$vscroll.pqScrollBar("option","num_eles");if(vtd[pq-col-indx="+o+"]");if(l.length==0){return false}var q=this._calcRightEdgeCol(o).width;var w=17;if(this.$vscroll.css("visibility")=="hidden"||this.$vscroll.css("display")=="none"){w=0}if(q>this.$cont[0].offsetWidth-w){var v=this._calcWidthCols(o)-(this.$cont[0].offsetWidth-w);var j=l.parent("tr").children("td");var m=this.colModel.length;var n=0,t=0;for(var r=this.freezeCols;r=v){t=r-this.freezeCols-this._calcNumHiddenUnFrozens(r)+1;break}}}this.$hscroll.pqScrollBar("option","cur_pos",t).pqScrollBar("scroll");p=true}}if(p){var l=this.$tbl.find("tr[pq-row-indx="+k+"]>td[pq-col-indx="+o+"]");return l}else{return l}};f.selection=function(l){var j=l.rowIndx,k=l.colIndx,m=l.method,i=l.type;if(i=="row"){return this["sRows"][m](l)}else{if(i=="cell"){return this["sCells"][m](l)}}return};f.setSelection=function(i){if(i==null||i.rowIndx==null){this.sRows.removeAll({raiseEvent:true});this.sCells.removeAll({raiseEvent:true});return}this._bringPageIntoView(i);return this._setSelection(i)};f._bringPageIntoView=function(p){var n=p.rowIndx,m=this;var j=this.options.dataModel;if(j.paging=="local"&&n>=0){var l=j.curPage;var o=j.rPP;var k=(l-1)*o;var i=l*o;if(n>=k&&n=this.data.length||l>=this.colModel.length){return false}this.bringRowIntoView({rowIndxPage:i});if(l==null){return this.selectRow({rowIndx:k,evt:j})}this._bringCellIntoView({rowIndxPage:i,colIndx:l});return this.selectCell({rowIndx:k,colIndx:l,evt:j})};f.saveEditCell=function(){if(this.$td_edit==null){return}var j=this.$td_edit,p=this.getCellIndices(j),n=this.getRowIndxOffset(),k=p.colIndx,i=p.rowIndxPage,o=p.rowIndx=i+n,t=this.colModel,l=p.column=t[k],r=p.dataIndx=l.dataIndx,m=this.data[i][r];if(i!=null){var s=this._getEditCellData(p);if(s!=m){this.data[i][r]=s;p.data=this.data;if(this._trigger("cellSave",null,p)==false){return}this.refreshRow(p);this._fixTableViewPort();var q=this;if(q.options.flexHeight){q.setGridHeightFromTable();q._fixIEFooterIssue()}else{q.bringRowIntoView({rowIndxPage:i})}}}};f._fixTableViewPort=function(){var i=this.$cont[0];i.scrollTop=0;i.scrollLeft=0};f._fixIEFooterIssue=function(){h(".pq-grid-footer").css({position:"absolute"});h(".pq-grid-footer").css({position:"relative"})};f.refreshColumn=function(l){var o=this.options.customData,k=l.colIndx=(l.colIndx==null)?this.getColIndxFromDataIndx(l.dataIndx):l.colIndx,n=this.getRowIndxOffset();for(var m=this.init;m<=this["final"];m++){var i=l.rowIndxPage=m;l.rowIndx=i+n;var j=l.column=this.colModel[k];l.$td=this.getCell(l);l.rowData=this.data[i];l.customData=o;this.cTable._renderCell(l)}};f.refreshCell=function(q){if(!this.data){return}var o=q.offset=(q.offset==null)?this.getRowIndxOffset():q.offset,p=q.rowIndx=(q.rowIndx==null)?q.rowIndxPage+o:q.rowIndx,i=q.rowIndxPage=(q.rowIndxPage==null)?q.rowIndx-o:q.rowIndxPage,r=q.dataIndx,k=q.colIndx=(q.colIndx==null)?this.getColIndxFromDataIndx(r):q.colIndx,j=q.$td=(q.$td==null)?this.getCell(q):q.$td,m=q.column=this.colModel[k],l=this.data[i];if(!l){return}var n=q;n.rowData=l;n.customData=this.options.customData;if(j&&j.length>0){this.cTable._renderCell(n)}};f.refreshRow=function(q){if(!this.data){return}var s=this.options,o=q.offset=(q.offset==null)?this.getRowIndxOffset():q.offset,p=q.rowIndx=(q.rowIndx==null)?q.rowIndxPage+o:q.rowIndx,i=q.rowIndxPage=(q.rowIndxPage==null)?q.rowIndx-o:q.rowIndxPage,r=(q.$tr==null)?this.getRow(q):q.$tr,t=this.colModel,m=this.data[i];if(!m){return}var n={rowIndx:p,rowIndxPage:i,rowData:m,customData:s.customData};for(var k=0;k0){this.cTable._renderCell(n)}}};f.quitEditMode=function(i){if(this.$td_edit){var j=this.$td_edit;this.disableSelection();this._setGridFocus();this._trigger("quitEditMode",i,{$td:j,dataModel:this.options.dataModel});this._removeCellRowOutline();this.$td_edit=null}};f.getData=function(){return this.data};f.getViewPortRowsIndx=function(){return{beginIndx:this.init,endIndx:this["final"]}};f.getRowIndxOffset=function(){var j=this.options.dataModel,i=j.paging,m=0;if(i=="local"||i=="remote"){var k=j.curPage;var l=j.rPP;m=(l*(k-1))}return m};f.getRowOffset=function(){return this.offsetRow};f._cellblurred=function(){this.$div_focus.remove();this.$div_focus=null;this.$td_focus=null;this.$tr_focus=null};f.selectCell=function(l){var j=l.rowIndx,k=l.colIndx,i=l.evt;if(i&&(i.type=="keydown"||i.type=="keypress")){if(this.sCells.replace(l)==false){return false}}else{if(this.sCells.add(l)==false){return false}}if(i!=null){this._setGridFocus()}return true};f._setGridFocus=function(){var i=this;window.setTimeout(function(){if(i.$td_edit==null){i.$grid_inner.focus()}},0)};f.getEditCell=function(){if(this.$td_edit){return{$td:this.$td_edit,$cell:this.$div_focus}}else{return null}};f.editCell=function(i){var j=this.getCell(i);if(j!=null&&j.length==1){if(this.$td_edit&&this.$td_edit[0]!=j[0]){this.quitEditMode()}this._editCell(j);return j}};f.getFirstEditableColIndx=function(){if(!this.options.editable){return -1}var j=this.colModel;for(var k=0;k0){this._editCell(l)}}};f._editCell=function(j){var p=this;var o=p.getCellIndices(j);var i=o.rowIndxPage,m=this.getRowIndxOffset(),n=i+m,k=o.colIndx,l=this.colModel[k],q=l.dataIndx;if(this.$td_edit&&this.$td_edit[0]==j[0]){return false}this.$td_edit=j;this.enableSelection();this._removeCellRowOutline();this._generateCellRowOutline({$td:j});var r=this.$div_focus.addClass("pq-cell-selected-border-edit");if(l.align=="right"){r.css("text-align","right")}else{if(l.align=="center"){r.css("text-align","center")}else{r.css("text-align","left")}}if(l.editor){l.editor({$cell:r,data:this.data,dataModel:this.dataModel,rowIndx:n,rowIndxPage:i,colIndx:q})}else{r.html("
");var p=this;r.children().html(p.data[i][q])}var p=this;window.setTimeout(function(){if(p.$td_edit!=null){var s=p.$div_focus;s.children().focus()}},0)};f.getRow=function(k){var i=k.rowIndxPage;var j;if(this.$tbl!=undefined){j=this.$tbl.find("tr[pq-row-indx="+i+"]")}return j};f.getCell=function(k){var i=(k.rowIndxPage==null)?(k.rowIndx-this.getRowIndxOffset()):k.rowIndxPage,j=k.colIndx;var l;if(this.$tbl!=undefined){l=this.$tbl.find("tr[pq-row-indx="+i+"]>td[pq-col-indx="+j+"]")}return l};f.getEditCellData=function(){if(this.$td_edit){var i=this.getCellIndices(this.$td_edit);return this._getEditCellData(i)}else{return null}};f._getEditCellData=function(o){var n=o.colIndx,i=o.rowIndxPage,k=(o.rowIndx!=null)?o.rowIndx:i+this.getRowIndxOffset(),j=(o.column)?o.column:this.colModel[n],l=(o.$cell)?o.$cell:this.$div_focus;if(j.getEditCellData){var m=j.getEditCellData({$cell:l,data:this.data,dataIndx:j.dataIndx,dataModel:this.dataModel,rowIndx:k,rowIndxPage:i,colIndx:n})}else{var m=l.children().html()}return m};f.getCellIndices=function(l){if(l==null||l.length==0){return{rowIndxPage:null,colIndx:null}}var j=l.parent("tr");var m=j.parent("tbody");var i=parseInt(j.attr("pq-row-indx"));var k=parseInt(l.attr("pq-col-indx"));return{rowIndxPage:i,colIndx:k}};f._incrRowIndx=function(k,n){var m=k,n=(n==null)?1:n,l=0;for(var o=k+1,j=this.data.length;o=0;n--){var o=this._getRowPQData(n,"hidden");if(!o){k++;l=n;if(k==m){return l}}}return l};f._incrIndx=function(i,l){var k=this;if(l==null){if(i==this._getLastVisibleRowIndxPage(this.data)){return null}i=this._incrRowIndx(i);return{rowIndxPage:i}}var j;do{l++;if(l>=k.colModel.length){if(i==this._getLastVisibleRowIndxPage(this.data)){return null}i=this._incrRowIndx(i);l=0}j=k.colModel[l]}while(j&&j.hidden);return{rowIndxPage:i,colIndx:l}};f._decrIndx=function(i,l){var k=this;if(l==null){if(i==this._getFirstVisibleRowIndxPage(this.data)){return null}i=this._decrRowIndx(i);return{rowIndxPage:i}}var j;do{l--;if(l<0){if(i==this._getFirstVisibleRowIndxPage(this.data)){return null}i=this._decrRowIndx(i);l=k.colModel.length-1}j=k.colModel[l]}while(j&&j.hidden);return{rowIndxPage:i,colIndx:l}};f._incrEditIndx=function(i,l){var k=this;var j;do{l++;if(l>=k.colModel.length){if(i==this._getLastVisibleRowIndxPage(this.data)){return null}i=this._incrRowIndx(i);l=0}j=k.colModel[l]}while(j&&(j.hidden||j.editable===false));return{rowIndxPage:i,colIndx:l}};f._decrEditIndx=function(i,l){var k=this;var j;do{l--;if(l<0){if(i==this._getFirstVisibleRowIndxPage(this.data)){return null}i=this._decrRowIndx(i);l=k.colModel.length-1}j=k.colModel[l]}while(j&&(j.hidden||j.editable===false));return{rowIndxPage:i,colIndx:l}};f.addColumn=function(m,n){var l=this.options,j=l.colModel,p=l.dataModel.data;j.push(m);this._refreshHeader();for(var k=0;k0){this._editCell(x)}y.preventDefault();return false}else{if(y.keyCode==m){t.saveEditCell();t.quitEditMode(y)}else{if(m==null&&y.keyCode==this.options.editModel.saveKey){t.saveEditCell();t.quitEditMode(y)}else{if(y.keyCode==v.esc){t.quitEditMode(y);y.preventDefault();return false}else{if(y.keyCode==v.pageUp||y.keyCode==v.pageDown){y.preventDefault();return false}}}}}return}else{if(o.length>0&&k.type=="row"){var r=o[o.length-1],q=r.rowIndx,i=q-p}else{if(w.length>0&&k.type=="cell"){var r=w[w.length-1],q=r.rowIndx,i=q-p,u=r.dataIndx,l=this.getColIndxFromDataIndx(u);if(q==null||l==null){return}t._trigger("cellKeyDown",y,{dataModel:this.dataModel,rowIndx:q,colIndx:l,$td:r.$td,column:t.colModel[l]});if(y.cancelBubble){return}}else{return}}}if(y.keyCode==v.left){var r=t._decrIndx(i,l);if(r){t._setSelection({rowIndxPage:r.rowIndxPage,colIndx:r.colIndx,evt:y})}y.preventDefault();return}else{if(y.keyCode==v.right){var r=t._incrIndx(i,l);if(r){t._setSelection({rowIndxPage:r.rowIndxPage,colIndx:r.colIndx,evt:y})}y.preventDefault();return}else{if(y.keyCode==v.tab){var r;if(y.shiftKey){r=t._decrIndx(i,l)}else{r=t._incrIndx(i,l)}if(r){t._setSelection({rowIndxPage:r.rowIndxPage,colIndx:r.colIndx,evt:y})}y.preventDefault();return}else{if(y.keyCode==v.up){i=t._decrRowIndx(i);if(r){t._setSelection({rowIndxPage:i,colIndx:l,evt:y})}y.preventDefault();return}else{if(y.keyCode==v.down){i=t._incrRowIndx(i);if(r){t._setSelection({rowIndxPage:i,colIndx:l,evt:y})}y.preventDefault();return}else{if(y.keyCode==v.pageDown||y.keyCode==v.spaceBar){var q=this._incrRowIndx(i,this.pageSize+1)+p;t._setSelection({rowIndx:q,colIndx:l,evt:y});y.preventDefault();return}else{if(y.keyCode==v.pageUp){var q=this._decrRowIndx(i,this.pageSize+1)+p;t._setSelection({rowIndx:q,colIndx:l,evt:y});y.preventDefault();return}else{if(y.keyCode==v.home){q=0+p;t._setSelection({rowIndx:q,colIndx:l,evt:y});y.preventDefault();return}else{if(y.keyCode==v.end){q=t.data.length-1+p;t._setSelection({rowIndx:q,colIndx:l,evt:y});y.preventDefault();return}else{if(y.keyCode==v.enter){if(this.options.selectionModel.type=="row"){var s,j;if(o.length>0){t._editFirstCellInRow({rowIndxPage:i})}}else{if(w.length>0){var j=this.getCell({rowIndxPage:i,colIndx:l});if(j&&j.length>0){if(this.isEditableCell({colIndx:l})){t._editCell(j)}}}}y.preventDefault();return}else{}}}}}}}}}}};f._calcNumHiddenFrozens=function(){var j=0;for(var k=0;k0&&k>l-n){var j=this.$tbl.children().children("tr");var s=0,i=0;j.each(function(w,x){s+=x.offsetHeight;if(s>=l-n){i=(w>1)?(w-1):0;return false}});u=m-i+1}else{u=r+1}if(u=0;j--){var k=this._getRowPQData(j,"hidden");if(!k){return j}}};f._getTotalVisibleRows=function(n){if(this.options.treeViewModel){var k=0;for(var l=0,j=n.length;lk.length){this.init=k.length-1}var i=this._bufferObj_minRowsPerGrid();this.pageSize=i;this["final"]=this.init+i;if(this["final"]+1>k.length){this["final"]=k.length-1}}}};f._bufferObj_calcInitFinalH=function(){var l=parseInt(this.$hscroll.pqScrollBar("option","cur_pos"));var o=0;var n=0,k=this.colModel;for(var m=this.freezeCols,j=k.length;m").appendTo(this.$grid_inner);this.$clleft=h("
").appendTo(this.$grid_inner);var l=parseInt(i.attr("pq-grid-col-indx"));var k=this.$grid_inner.outerHeight();this.$cl.height(k);this.$clleft.height(k);var n=h("td[pq-grid-col-indx="+l+"]",this.$header)[0];var m=n.offsetLeft+((l>this.options.freezeCols)?parseInt(this.$header[1].style.left):0);this.$clleft.css({left:m});m=m+n.offsetWidth;this.$cl.css({left:m})};f._setDragLimits=function(p){var o=this;var i=o.$header_left;if(p>=this.options.freezeCols){i=o.$header_right}var n=i.find("div.pq-grid-col-resize-handle[pq-grid-col-indx="+p+"]");var k=i.find("td.pq-grid-col[pq-grid-col-indx="+p+"]");var m=k.offset().left+o.minWidth;var j=17;if(this.options.flexHeight||this.$vscroll.css("visibility")=="hidden"){j=0}var l=o.$cont.offset().left+o.$cont[0].offsetWidth-j+20;n.draggable("option","containment",[m,0,l,0])};f._getOrderIndx=function(j){var i=this.options.columnOrder;if(i!=null){return i[j]}else{return j}};f.nestedCols=function(t,s,u){var r=t.length;var p=[];if(s==null){s=1}var o=s,q=0,j=0,l=0;for(var n=0;n0){if(m.depth>o){o=m.depth}k.colSpan=m.colSpan;q+=m.colSpan}else{k.colSpan=0;k.hidden=true}k.childCount=m.childCount;l+=m.childCount}else{if(k.hidden){k.colSpan=0}else{k.colSpan=1;q++}k.childCount=0;l++;p.push(k)}}return{depth:o,colModel:p,colSpan:q,width:j,childCount:l}};f.getHeadersCells=function(){var s=this.options.colModel,A=this.colModel.length,B=this.depth;var j=[];for(var q=0;q0)?o[w].childCount:1;if(x0&&o==p[r][j-1]){continue}else{if(r>0&&o==p[r-1][j]){continue}}var n=1;for(var q=r+1;q=1){I+="";if(this.numberCell){I+=""}for(var s=0;s"}I+=""}for(var t=0;t";if(t==0&&this.numberCell){I+="
 
"}for(var s=0;s0&&n==L[t-1][s]){continue}else{if(s>0&&n==L[t][s-1]){continue}}if(n.hidden){continue}var m="pq-grid-col";if(n.align=="right"){m+=" pq-align-right"}else{if(n.align=="center"){m+=" pq-align-center"}}if(s==u.freezeCols-1&&Q==1){m+=" pq-last-freeze-col"}var E="",C="";if(n.colModel==null){E="pq-grid-col-indx='"+s+"'"}I+="
"+n.title+" 
"}I+=""}I+="";this.$header.empty();this.$header.append(I);var r=h(this.$header[0]);var k=h(this.$header[1]);var B=parseInt(this.options.freezeCols);var w=this._calcWidthCols(B-1);r.css({width:w,zIndex:1});var R=0;for(var J=B;J<(this.initH+B);J++){var n=G[J];if(n.hidden){continue}var P=this.outerWidths[J];if(P==null){throw ("Assert: unknown width")}R+=P}k.css({left:"-"+R+"px"});this.$header.find("td").click(function(){if(!u.options.sortable){return}var V=h(this).attr("pq-grid-col-indx");if(V==null){return}var U=u.colModel[V];if(U.sortable==false){return}var T=U.dataIndx;if(u._trigger("beforeSort",null,{dataModel:u.dataModel,data:u.data,sortIndx:T})==false){return}var S="up";var i=u.options.dataModel;if(i.sortIndx==T){S=(i.sortDir=="up")?"down":"up"}i.sortIndx=T;i.sortDir=S;u._refreshSortingDataAndView({sorting:true,keepSelection:true,fn:function(){u._trigger("sort",null,{dataModel:u.dataModel,data:u.data})}})});var R=0;var D=u.$header[0].offsetHeight;var O=this.options.direction;for(var J=0;J=u.options.freezeCols){z=u.$header_right}var l=h("
 
").appendTo(z);var M=u.$header_right.find("td[pq-grid-col-indx="+J+"]")[0];R=parseInt(M.offsetLeft)+parseInt((O=="rtl")?0:(M.offsetWidth-10));l.css({left:R,height:D})}var q,p,o;var j=u.$header.find(".pq-grid-col-resize-handle").draggable({axis:"x",helper:function(S,U){var i=h(S.target);var T=parseInt(i.attr("pq-grid-col-indx"));u._setDragLimits(T);u._getDragHelper(S,U);return i},start:function(i,S){q=S.position.left;o=parseInt(u.$cl[0].style.left)},drag:function(i,T){p=T.position.left;var S=(p-q);u.$cl[0].style.left=o+S+"px"},stop:function(T,X){u.$clleft.remove();u.$cl.remove();p=X.position.left;var U=(p-q);var S=h(X.helper);var Y=parseInt(S.attr("pq-grid-col-indx"));var W=u.colModel[Y];W.width=parseInt(W.width)+U;u._computeOuterWidths(true);u._refresh();for(var V=0;V";z.push(i);if(this.numberCell){z.push("
")}var A={rowIndx:p+n,rowIndxPage:p,rowData:q,summaryCell:true};for(var m=0;m
"+v+"
";z.push(x)}for(var y=0;y
"+v+"
";z.push(x)}z.push("");return z};f.createTable=function(i){this.cTable._generateTables(i)};f._refreshOtherTables=function(){return;var z=this.colModel,v=z.length,t=this.options.columBorders;for(var s=0;s1){var l=m.find("td[pq-dataIndx='"+w+"']").remove();r.$tds.add(l)}}else{if(this.hidearrHS[o]){var n=u.find("td[pq-dataIndx='"+w+"']");if(n.css("visibility")!="hidden"){}}}var j="";var y=const_cls;if(p.align=="right"){y+=" pq-align-right"}else{if(p.align=="center"){y+=" pq-align-center"}}if(o==this.freezeCols-1&&t){y+=" pq-last-freeze-col"}if(p.className){y=y+" "+p.className}if(cellSelection){y=y+" pq-cell-select"}var x=" "+this.cTable._renderCell(objRender)+"";buffer.push(x)}for(var q=0;q "+this.cTable._renderCell(objRender)+"";buffer.push(x)}}};f._sortLocalData=function(m,l,k,o){var j=l,n=this;if(o==null||o.length==0){return}function i(){function t(x,w){var v=x[m];var u=w[m];v=v?parseInt(v):0;u=u?parseInt(u):0;return(v-u)}function p(x,w){var v=x[m];var u=w[m];return k(v,u)}function s(x,w){var v=(x[m]+"").replace(/,/g,"");var u=(w[m]+"").replace(/,/g,"");v=v?parseFloat(v):0;u=u?parseFloat(u):0;return(v-u)}var q=0;function r(x,w){q++;var v=x[m];var u=w[m];v=v?v:"";u=u?u:"";if(v>u){return 1}else{if(vbonus buy games smoking pistols book of xmas jinglebells bonus buy games mayan empire bonus buy games book of rebirth slot miko festival feature buy slot twilight princess slot hot potato bonus buy games sevens jok3rs bonus buy games 4 fantastic vikings go fishing joker lanterns hit n roll pragmatic play live streaming casino bonus buy games space donkey bonus buy games the belt of champion bonus buy link 4d gacor bonus buy games pirots 2 bonus buy games lobster hotpot live casino hotel with gaming options calcio live games score bonus buy games jazmin s wild ways calcio live soccer odds bonus buy games romax live casino with fast payouts slot the big dawgs judi bola resmi slot how to analyze sports betting OK sport