//v.1.5 build 71114 /* Copyright DHTMLX LTD. http://www.dhtmlx.com To use this component please contact sales@dhtmlx.com to obtain license */ var globalActiveDHTMLGridObject;String.prototype._dhx_trim = function(){return this.replace(/ /g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(ar){return dhtmlXHeir((ar||new Array()),new _dhtmlxArray())};function _dhtmlxArray(){return this};_dhtmlxArray.prototype._dhx_find = function(pattern){for(var i=0;i=ind;i--){this[i] = this[i-1] };this[ind] = value };_dhtmlxArray.prototype._dhx_removeAt = function(ind){for(var i=ind;i=8.5)) this.hdr.style.tableLayout = "fixed";this.hdr.className = "c_hdr".substr(2);this.hdr.width = "100%";this.xHdr = document.createElement("TABLE");this.xHdr.className = "xhdr";this.xHdr.cellPadding = 0;this.xHdr.cellSpacing = 0;this.xHdr.style.width='100%' var r = this.xHdr.insertRow(0) var c = r.insertCell(0);r.insertCell(1).innerHTML = "      ";r.childNodes[1].style.width='100%';c.appendChild(this.hdr) this.objBuf = document.createElement("DIV");this.objBuf.appendChild(this.obj);this.entCnt = document.createElement("TABLE");this.entCnt.insertRow(0).insertCell(0) this.entCnt.insertRow(1).insertCell(0);this.entCnt.cellPadding = 0;this.entCnt.cellSpacing = 0;this.entCnt.width = "100%";this.entCnt.height = "100%";this.entCnt.style.tableLayout = "fixed";this.objBox = document.createElement("DIV");this.objBox.style.width = "100%";this.objBox.style.height = this.entBox.style.height;this.objBox.style.overflow = "auto";this.objBox.style.position = "relative";this.objBox.appendChild(this.objBuf);this.objBox.className = "objbox";this.hdrBox = document.createElement("DIV");this.hdrBox.style.width = "100%" if (((_isOpera)&&(_OperaRv<9)) ) this.hdrSizeA=25;else this.hdrSizeA=200;this.hdrBox.style.height=this.hdrSizeA+"px";if (_isIE)this.hdrBox.style.overflowX="hidden";else this.hdrBox.style.overflow = "hidden";this.hdrBox.style.position = "relative";this.hdrBox.appendChild(this.xHdr);this.preloadImagesAr = new Array(0) this.sortImg = document.createElement("IMG") this.sortImg.style.display = "none";this.hdrBox.insertBefore(this.sortImg,this.xHdr) this.entCnt.rows[0].cells[0].vAlign="top";this.entCnt.rows[0].cells[0].appendChild(this.hdrBox);this.entCnt.rows[1].cells[0].appendChild(this.objBox);this.entBox.appendChild(this.entCnt);this.entBox.grid = this;this.objBox.grid = this;this.hdrBox.grid = this;this.obj.grid = this;this.hdr.grid = this;this.cellWidthPX = new Array(0);this.cellWidthPC = new Array(0);this.cellWidthType = this.entBox.cellwidthtype || "px";this.delim = this.entBox.delimiter || ",";this._csvDelim = ",";this.hdrLabels = (this.entBox.hdrlabels || "").split(",");this.columnIds = (this.entBox.columnids || "").split(",");this.columnColor = (this.entBox.columncolor || "").split(",");this.cellType = dhtmlxArray((this.entBox.cellstype || "").split(","));this.cellAlign = (this.entBox.cellsalign || "").split(",");this.initCellWidth = (this.entBox.cellswidth || "").split(",");this.fldSort = (this.entBox.fieldstosort || "").split(",") this.imgURL = this.entBox.imagesurl || "gridCfx/";this.isActive = false;this.isEditable = true;this.raNoState = this.entBox.ranostate || null;this.chNoState = this.entBox.chnostate || null;this.selBasedOn = (this.entBox.selbasedon || "cell").toLowerCase() this.selMultiRows = this.entBox.selmultirows || false;this.multiLine = this.entBox.multiline || false;this.noHeader = this.entBox.noheader || false;this.xmlFileUrl = this.entBox.xmlfileurl || "";this.recordsNoMore = this.entBox.infinitloading || true;;this.useImagesInHeader = false;this.pagingOn = false;this.rowsBufferOutSize = 0;dhtmlxEvent(window,"unload",function(){try{self.destructor()}catch(e){}});this.loadXML = function(url,afterCall){if (this._dload){this._dload=url;this._askRealRows(null,afterCall);return true};if (this._xmlaR)this.setXMLAutoLoading(url);if(url.indexOf("?")!=-1) var s = "&";else var s = "?";var obj = this;this.callEvent("onXLS",[this]);if (afterCall)this.xmlLoader.waitCall=afterCall;this.xmlLoader.loadXML(url+""+s+"rowsLoaded="+this.getRowsNum()+"&lastid="+this.getRowId(this.getRowsNum()-1))};this.setSkin = function(name){this.entBox.className = "gridbox gridbox_"+name;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid()) this._fixAlterCss() this._sizeFix=this._borderFix=0;switch(name){case "clear": this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="";this.entBox.appendChild(this._topMb);this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="";this.entBox.appendChild(this._botMb);this.entBox.style.position="relative";this._gcCorr=20;break;case "modern": case "light": this.forceDivInHeader=true;this._sizeFix=1;break;case "xp": this.forceDivInHeader=true;this._srdh=22;this._sizeFix=1;break;case "mt": this._srdh=22;this._sizeFix=1;this._borderFix=(_isIE?1:0);break;break;case "gray": if ((_isIE)&&(document.compatMode != "BackCompat")) this._srdh=22;this._sizeFix=1;this._borderFix=(_isIE?1:0);break};if (_isIE && this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)};this.setSizes()};this.loadXMLString = function(str,afterCall){if (this._dload){this._dloadStr=str;this._askRealRows(null,afterCall);return true};this.callEvent("onXLS",[this]);if (afterCall)this.xmlLoader.waitCall=afterCall;this.xmlLoader.loadXMLString(str)};this.doLoadDetails = function(obj){var root = self.xmlLoader.getXMLTopNode(self._tttag) if (root.tagName!="DIV")if (self._refresh_mode){self._refreshFromXML(self.xmlLoader);self._refresh_mode=null}else if(!self.xmlLoader.xmlDoc.nodeName){self.parseXML(self.xmlLoader.xmlDoc.responseXML) }else{self.parseXML(self.xmlLoader.xmlDoc) };if(self.pagingOn)self.createPagingBlock() };this.xmlLoader = new dtmlXMLLoaderObject(this.doLoadDetails,window,true,this.no_cashe);if (_isIE)this.preventIECashing(true);this.dragger=new dhtmlDragAndDropObject();this._doOnScroll = function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll = function(e,mode){this.hdrBox.scrollLeft = this.objBox.scrollLeft;if (this.ftr)this.ftr.parentNode.scrollLeft = this.objBox.scrollLeft;this.setSortImgPos(null,true);if (mode)return;if(!this.pagingOn && this.objBox.scrollTop+this.hdrSizeA+this.objBox.offsetHeight>this.objBox.scrollHeight){if(this._xml_ready && (this.objBox._oldScrollTop!=this.objBox.scrollTop)&& this.addRowsFromBuffer()){this.objBox.scrollTop = this.objBox.scrollHeight - (this.hdrSizeA+1+this.objBox.offsetHeight) this.objBox._oldScrollTop=this.objBox.scrollTop}};if (this._dload){if (this._dLoadTimer)window.clearTimeout(this._dLoadTimer);this._dLoadTimer=window.setTimeout(function(){if (self.limit)self._askRealRows()},500)}};this.attachToObject = function(obj){obj.appendChild(this.entBox) this.objBox.style.height = this.entBox.style.height};this.init = function(fl){if ((this.isTreeGrid()) && (!this._h2)){this._aEx=new _dhtmlxArray();this._h2=new dhtmlxHierarchy();if ((this._fake)&&(!this._realfake)) this._fake._h2=this._h2;this._tgc={imgURL:null}};if(!this._hstyles)return;this.editStop() this.lastClicked = null;this.resized = null;this.fldSorted = this.r_fldSorted = null;this.gridWidth = 0;this.gridHeight = 0;this.cellWidthPX = new Array(0);this.cellWidthPC = new Array(0);if(this.hdr.rows.length>0){this.clearAll(true)};if(this.cellType._dhx_find("tree")!=-1){this.loadedKidsHash = new Hashtable();this.loadedKidsHash.put("hashOfParents",new Hashtable()) };var hdrRow = this.hdr.insertRow(0);for(var i=0;i