📄 isc_grids.js
字号:
,isc.A.scrollToRatio=function(_1,_2,_3,_4){if(!_1||!this.virtualScrolling){return this.invokeSuper(isc.GridRenderer,"scrollToRatio",_1,_2,_3,_4)}var _5=this.getTotalRows()-1,_6=_2*_5,_7=Math.floor(_6),_8=Math.round((_6-_7)*this.getRowSize(_7));this.$27y=_7;this.$27z=_8;this.$270();if(this.isDirty()){this.$271=_2;this.$27y=_7;this.$27z=_8}},isc.A.getScrollRatio=function(_1,_2,_3,_4){if(!_1||!this.virtualScrolling){return this.invokeSuper(isc.GridRenderer,"getScrollRatio",_1,_2,_3,_4)}if(this.isDirty()&&this.$271!=null)return this.$271;var _5=this.getTotalRows()-1;if(_5<=0)return 0;var _6=this.getScrollTop(),_7=this.getRowCoordinate(_6),_8=_7/ _5;return Math.min(1,_8)},isc.A.getViewportRatio=function(_1,_2,_3,_4){if(!_1||!this.virtualScrolling){return this.invokeSuper(isc.GridRenderer,"getViewportRatio",_1,_2,_3,_4)}var _5=this.$272||this.avgRowHeight;return Math.min(1,(this.getViewportHeight()/_5)/this.getTotalRows())},isc.A.$273=function(_1,_2){if(this.$274)return;var _3if(_2>0){_3=_1+this.getViewportHeight()}else{_3=_1}var _4=this.getEventRow(_3),_5=this.getTotalRows()-1,_6=_1;if(_4<0||_4>_5){this.$27y=_5;this.$27z=0;_6=this.getRowTop(_5)}else{this.$27y=_4;this.$27z=_1-this.getRowTop(this.$27y)+_2;if(Math.abs(this.$27z)>this.getViewportHeight()){this.logInfo("storeTargetRow: targetRow: "+_4+" with offset: "+this.$27z+", clearing","virtualScrolling");this.$27z=this.$27y=null}}return _6},isc.A.$270=function(){var _1=this.$27y,_2=this.$27z;var _3=this.getRowTop(_1)+_2;this.$274=true;this.$sz=null;this.scrollTo(null,_3);this.$274=false;this.$271=null},isc.A.scrollTo=function(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;if(this.virtualScrolling&&_2!=null&&!_3){var _5=this.getScrollTop(),_6=_2-_5;this.$273(_5,_6);_2=Math.min(_2,this.getRowTop(this.getTotalRows()-1))}this.invokeSuper(isc.GridRenderer,"scrollTo",_1,_2,_3,_4);if(this.isDirty()||this.$275)return;var _7=(this.$276()||this.$277());if(_7){if(this.scrollRedrawDelay==0){this.markForRedraw("scrolled")}else{this.fireOnPause("scrollRedraw","markForRedraw",this.scrollRedrawDelay)}this.$250=true}},isc.A.$276=function(){if(this.showAllRows)return false;var _1=this.getVisibleRows(),_2=_1[0],_3=_1[1];var _4=this.getTotalRows();if(_3>_4-1)_3=_4-1;var _5=(_2<this.$252||_3>this.$253);return _5},isc.A.$277=function(){if(this.showAllColumns)return false;var _1=this.getVisibleColumns(),_2=_1[0],_3=_1[1],_4=(_2<this.$254||_3>this.$255);return _4},isc.A.setOverflow=function(_1){if(_1==isc.Canvas.VISIBLE){this.showAllRows=true;this.showAllColumns=true}return this.Super("setOverflow",arguments)},isc.A.getRowChunkNum=function(_1){return Math.round(_1/ this.$508)},isc.A.getColChunkNum=function(_1){return Math.round(_1/ this.$509)},isc.A.getTableChunk=function(_1,_2){var _3=this.$51a;if(!_3)return;_1=_1||0;_2=_2||0;var _4=_3[_1];return _4?_4[_2]:null},isc.A.getTableChunkAt=function(_1,_2){var _3=this.getRowChunkNum(_1),_4=this.getColChunkNum(_2),_5=this.getTableChunk(_3,_4);if(_5!=null){this.$51b=_3*this.$508;this.$254=_4*this.$509;return _5}},isc.A.$rd=function(_1,_2,_3,_4){if(this.cacheDOM){this.drawVisibleChunks()}else{this.invokeSuper(isc.GridRenderer,"$rd",_1,_2,_3,_4)}},isc.A.drawVisibleChunks=function(){var _1=this.getVisibleRows(),_2=this.getVisibleColumns(),_3=this.getRowChunkNum(_1[0]),_4=this.getColChunkNum(_2[0]),_5=this.getRowChunkNum(_1[1]),_6=this.getColChunkNum(_2[1]);for(var _7=_3;_7<_5;_7++){for(var _8=_4;_8<_6;_8++){if(this.getTableChunk(_7,_8)==null){this.logWarn("drawing chunk: "+[_7,_8]);this.renderTableChunk(_7,_8)}}}var _9=this.getTableHTML()},isc.A.renderTableChunk=function(_1,_2){var _3=_1*this.$508,_4=_3+this.$508,_5=_2*this.$509,_6=_5+this.$509;var _7=this.getTableHTML([_5,_6],_3,_4),_8=isc.Element.insertAdjacentHTML(this.getHandle(),"beforeEnd",_7,true);var _9=this.$51a=this.$51a||[],_10=_9[_1]=_9[_1]||[];_10[_2]=_8},isc.A.getDrawnRows=function(){return this.getVisibleRows()},isc.A.startRowAnimation=function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10){this.finishRowAnimation();if(!this.isDrawn()||!this.isVisible()){if(_4!=null){var _11=_9?this.parentElement:this;_11.fireCallback(_4)}return}if(_1==null)_1=true;if(_2==null)_2=0;if(_3==null)_3=this.getTotalRows()-1;if(_2==_3){this.logWarn("startRowAnimation passed empty row range, aborting: "+[_2,_3]);return}var _12=this.readyToRedraw("animating show / hide of rows",false);if(!_12){this.$278=[_1,_2,_3,_4,_5,_6,_7,_8,_9];this.$279=isc.Timer.setTimeout({target:this,methodName:"$28a"},0);return}var _13=this.$28b(_1,_2,_3,_4,_9);this.animateRowHeight(this.$28c,(_1?_13:0),{target:this,methodName:"$28d"},_5,_6,_7,_8)},isc.A.$28a=function(){if(this.$278==null){this.logWarn("Unable to perform delayed row animation - bailing");return}var _1=this.$278,_2=_1[0],_3=_1[1],_4=_1[2],_5=_1[3],_6=_1[4],_7=_1[5],_8=_1[6],_9=_1[7],_10=_1[8];this.$278=null;this.$279=null;this.startRowAnimation(_2,_3,_4,_5,_6,_7,_8,_9,_10,true)},isc.A.$28b=function(_1,_2,_3,_4,_5){this.$28c=_2;this.$28e=_3;var _6=0;if(!_1){var _7=this.$26b();for(var i=_2;i<_3;i++){_6+=_7[i]}this.$28f=_6;this.redraw("initializing animated hide row")}else{this.$28f=1;this.redraw("initializing animated show row");var _9=this.getTableElement(this.$28c,0),_10=this.$28g(_9);if(!_10){_6=(_3-_2)*this.cellHeight}else _6=_10.scrollHeight}if(this.isDirty())this.redraw("Initializing row animation requires second redraw");this.$28h={callback:_4,target:(_5?this.parentElement:this)};return _6},isc.A.finishRowAnimation=function(){if(this.$28c!=null){this.finishAnimateRowHeight()}else{if(this.$279!=null){isc.Timer.clearTimeout(this.$279);var _1=this.$278,_2=_1[0],_3=_1[1],_4=_1[2],_5=_1[3],_6=_1[4],_7=_1[5];delete this.$278;delete this.$279;if(!this.readyToRedraw()){this.logWarn("Finish row animation called while Grid is not ready to redraw. "+"GridRenderer HTML will not be updated when callback fires.","animation");var _8=_7?this.parentElement:this;if(_5)_8.fireCallback(_5)}else{var _9=this.$28b(_2,_3,_4,_5,_7);this.setRowHeight(_3,(_2?_9:1));this.$28d()}}}},isc.A.$28d=function(){var _1=this.$28h;delete this.$28h;delete this.$28c;delete this.$28e;delete this.$28f;if(_1&&_1.callback)_1.target.fireCallback(_1.callback)},isc.A.animateRowHeight=function(_1,_2,_3,_4,_5,_6,_7,_8){if(!this.isDrawn()){if(_3){var _9=(_8?this.parentElement:this);_9.fireCallback(_3)}return}if(this.$28i!=null){this.logInfo("early finish of row animation, because new animation started","animation")this.finishAnimateRowHeight()}var _10=this.getRowSize(_1);if(_4!=null){var _11=(_2-_10);if(_11<0)_11=0-_11;_5=Math.round((_11/ _4)*1000);if(_5>this.animateRowsMaxTime)_5=this.animateRowsMaxTime}this.$28j={$24t:_1,$28k:_10,$28l:_2,$03:_3,$1n:_7,$28m:_8}_6=(_6||this.$27r);if(this.logIsInfoEnabled("animation")){this.logInfo("starting row animation, duration: "+_5+", effect: "+_6,"animation")}this.$28i=this.registerAnimation({target:this,method:this.$28n},_5,_6);if(this.overflow==isc.Canvas.AUTO||this.overflow==isc.Canvas.SCROLL)this.$417=true},isc.A.$28n=function(_1){var _2=this.$28j,_3=_2.$24t,_4=this.$04(_2.$28k,_2.$28l,_1);if(isc.Browser.isSafari&&_2.$28k>_2.$28l)this.$28o=true;this.setRowHeight(_3,_4,null,isc.emptyString,true,true,true);if(isc.Browser.isSafari)delete this.$28o;if(_2.$1n){var _5=this.$28g(this.getTableElement(_3,0));if(_5){var _6=_5.scrollHeight,_7=_5.offsetHeight;if(_6>_7)_5.scrollTop=_6-_7;else _5.scrollTop=0}}if(_1==1){isc.Timer.setTimeout({target:this,methodName:"$28p"},0)}},isc.A.$28p=function(){delete this.$417;this.adjustOverflow("row animation complete");var _1=this.$28j;delete this.$28i;delete this.$28j;if(_1&&_1.$03){var _2=_1.$28m?this.parentElement:this;_2.fireCallback(_1.$03)}},isc.A.finishAnimateRowHeight=function(){if(!this.$28i)return;this.cancelAnimation(this.$28i);this.$28n(1)},isc.A.getTableHTML=function(_1,_2,_3){var _4=isc.timeStamp();if(this.isEmpty()){this.$252=this.$253=this.$254=this.$255=null;return this.$27w()}var _5=(_2!=null&&_3!=null),_6=_2!=null?_2:0,_7=_3!=null?_3:this.getTotalRows();var _8=this.getDrawArea();if(!_5){this.$252=_8[0];this.$253=_8[1];if(this.$28c!=null){this.$253+=(this.$28e-this.$28c);var _9=this.getTotalRows();if(this.$253>=_9)this.$253=_9-1}this.$254=_8[2];this.$255=_8[3];_2=this.$252;_3=this.$253+1}else{var _10=_8[0],_11=_8[1]+1;if(this.$28q){if(_10>_3||_11<_2){_2=_3}}}var _12,_13;if(_1!=null){if(isc.isAn.Array(_1)){_12=_1[0];_13=_1[1]+1}else{_12=_1;_13=_1+1}}else{_12=this.$254;_13=this.$255+1}var _14=_13-_12;var _15=(this.showAllColumns||_1!=null);var _16=isc.StringBuffer.create(),_17=this.fields,_18=this.$26a;this.$28r=_12!=0?null:this.$26a[0];var _19,_20,_21,_22;if(!_15){_19=this.$26a.slice(0,_12).sum(),_20=this.$26a.slice(_13,this.$26a.length).sum(),_21=this.$26a.sum()_22=(this.cacheDOM||isc.Browser.isIE||isc.Browser.isSafari?"margin":"padding")}var _23=this.$26a.slice(_12,_13).sum(),_24=this.autoFit;var _25="";if(_1!=null){if(!_24&&this.fixedColumnWidths){_25=" WIDTH=100%"}}else if(isc.Browser.isMoz||isc.Browser.isSafari&&!_24){_25=" WIDTH="+_23}var _26=this.startSpace||0;if(_2!=_6){var _27=((_2-_6)*this.avgRowHeight);this.$514=_27;_26+=_27}else{this.$514=0}if(!this.cacheDOM){_16.append("<DIV style='height:",_26,"px;overflow:hidden;",(_26==0?"display:none;":null),"' ",(_5?">":" ID="+this.getID()+"$28s>"),isc.Canvas.spacerHTML(1,_26),"</DIV>")}_16.append("<TABLE BORDER=0",_25,(!_5?" ID="+this.getTableElementId():null),(this.tableStyle&&isc.Browser.isDOM?" CLASS='"+this.tableStyle+this.$ob:isc.$ad)," CELLSPACING=",this.cellSpacing," CELLPADDING=",this.cellPadding," STYLE='",(isc.Browser.isDOM&&!_24&&this.fixedColumnWidths?"table-layout:fixed;overflow:hidden;wrap:false;":""),(!_15?_22+(this.isRTL()?"-right: ":"-left:")+_19+"px;"+_22+(this.isRTL()?"-left:":"-right:")+_20+"px;":""),(this.cacheDOM&&this.$514>0?"margin-top:"+this.$514+"px;":""),(this.$27y!=null&&!(isc.Browser.isIE&&this.$r9)?"visibility:hidden;":""),"'>",(isc.Browser.isMoz?"<TBODY>":""));var _28=0,_29=0,_30=this.$54p();if((isc.Browser.isSafari||isc.Browser.isIE)&&isc.Browser.isStrict){_29=this.$54q();_28=(this.fixedRowHeights?0:this.cellPadding*2);_28+=(this.fixedRowHeights?isc.Element.$ym(_30):isc.Element.$yo(_30))}this.$28t=_28;this.$28u=_29;if(!_24&&isc.Browser.isDOM){for(_1=_12;_1<_13;_1++){_16.append("<COL WIDTH=",(_18[_1]-_29),">")}}_16.append("<TBODY>");var _31=this.cellHeight,_32=(this.wrapCells?"":"<NOBR>"),_33=(this.wrapCells?"":"</NOBR>");var _34=0;if(isc.Browser.isDOM){var _35=this.$28v(_31);var _36=[];_36[0]="<TD";_36[3]=" ALIGN=";_36[17]=this.fastCellUpdates?"' ":"' CLASS=";if(!_5&&this.getCellElementId)_36[19]=" ID=";_36[23]=">"+_32;_36[30]=_33+(_35?"</DIV></TD>":"</TD>");var _37=1,_38=2,_39=4,_40=5,_41=6,_42=7,_43=10,_44=11,_45=18,_46=20,_47=21,_48=24;var _49="<TR>",_50="</TR>",_51=" HEIGHT=",_52=" VALIGN=";if(isc.screenReader)_49="<TR tabIndex=-1>";var _53=[],_54=0,_55=[];var _56=" COLSPAN="+_14+" STYLE='"+(this.fixedRowHeights?"padding-top:0px;padding-bottom:0px;":"");this.$50d(_12,_13,_24,_29,_35);for(var _57=_2;_57<_3;_57++){var _58=(!_5&&this.$28c==_57);var _59=this.getCellRecord(_57);var _60=_58||this.$282(_57,_59);if(!_5&&this.getRowElementId){_16.append("<TR",(isc.screenReader?" tabIndex=-1":null)," ID=",this.getRowElementId(_57,_57-_2),">")}else{_16.append(_49)}if(this.fixedRowHeights||_35){var _61=_58?this.$28f:(this.getRowHeight!=null?this.getRowHeight(_59,_57):_31),_62=_58||(this.shouldFixRowHeight==null||this.shouldFixRowHeight(_59,_57)!=false);if(_62){_36[_37]=_51;_36[_38]=_61-_28;_36[_43]=null}else{_36[_37]=null;_36[_38]=null;_36[_43]=this.$281(_59,_57)}if(_35){_36[_47]=">"+this.$27s+this.$283(_61,_59,_57,_58)}}for(_1=_12;_1<_13;_1++){var _63=_17[_1];if(_53[_1]>0){_63.$28w[_57]=_55[_1];_53[_1]--;if(_53[_1]==0){_54--;_55[_1]=null}continue}if(this.grid&&this.grid.getCellAlign!=null){_36[_39]=this.grid.getCellAlign(_59,_57,_1)}else{_36[_39]=(_63.cellAlign||_63.align)}if(this.grid&&this.grid.getCellVAlign!=null){_36[_40]=_52_36[_41]=this.grid.getCellVAlign(_59,_57,_1)}if(_60){_34++;_36[_42]=_56;if(_35){_36[_47+1]=this.$ob}}else{_36[_42]=_63.$28x;if(this.getRowSpan){var _64=this.getRowSpan(_59,_57,_1);if(_64>1){var _65=" ROWSPAN="+_64;if(_36[_39]!=null)_36[_39]+=_65;else_36[_39]=_65;_53[_1]=_64-1;_54++;_55[_1]=_57;if(_63.$28w==null)_63.$28w={};_63.$28w[_57]=_57}}if(_35){_36[_47+1]=_63.$28y}else{_36[_47+1]=null}}var _66=this.getCellStyle(_59,_57,_1),_67=(this.getCellCSSText?this.getCellCSSText(_59,_57,_1):null);if(_58){var _68="padding:0px;border:0px;";if(_67)_67+=";"+_68else _67=_68}if(!this.fastCellUpdates){_36[_44]=_67_36[_45]=_66}else{_36[_44]=isc.Element.getStyleText(_66,true);_36[_44+1]=_67}if(_58){this.$28q=true;var _69=this.getTableHTML(null,this.$28c,this.$28e);delete this.$28q;if(!_35){_36[_48]=isc.SB.concat(this.$27s,this.$283(_61,_59,_57,_58),this.$ob,this.$oa,_69,"</DIV>")}else{_36[_48]=_69}}else_36[_48]=this.$22k(_59,_57,_1);if(!_5&&this.getCellElementId){_36[_46]=this.getCellElementId(_57,_57-_2,_1,_1-_12)}_16.append(_36);if(_60)break}_16.append(_50);if(_58){_57=this.$28e-1}}}_16.append("</TABLE>");var _70=_7-_3,_71=(!_5&&this.virtualScrolling);var _72=this.cacheDOM?0:(this.endSpace||0);this.$515=0;if(!this.showAllRows&&(_70!=0||(_71&&_70==0&&(this.overflow=="auto"||this.overflow=="scroll")))){var _73=_70*this.avgRowHeight;if(_71&&_70==0){var _74=this.getViewportHeight();if(_73<_74){_73=_74}}this.$515=_73;_72+=this.$515}if(!this.cacheDOM){_16.append("<DIV STYLE='overflow:hidden;width:1px;height:",_72,"px;",(_72==0?"display:none;":null),(_5?"'>":"' ID="+this.getID()+"$284>"),isc.Canvas.spacerHTML(1,_72),"</DIV>")}if(this.logIsDebugEnabled("gridHTML")){var _75=(isc.timeStamp()-_4),_76=((_13-_12)*(_3-_2)),_77=(_75/ _76),_78=(1000/_77);if(_77.toFixed!=null)_77=_77.toFixed(2);if(_78.toFixed!=null)_78=_78.toFixed(2);this.logDebug("getTableHTML: columns "+_12+"->"+(_13-1)+", rows "+_2+"->"+(_3-1)+", time: "+_75+"ms ("+_76+" cells at "+_77+"ms per cell, "+_78+" cells per second), "+"spacerHeights: ["+[_26,_72]+"], "+_34+" single cell rows","gridHTML")}return _16.release()},isc.A.$54p=function(){return(this.getBaseStyle!=null?this.getBaseStyle(this.getCellRecord(0,0),0,0):this.baseStyle)},isc.A.$50d=function(_1,_2,_3,_4,_5){var _6=this.fields,_7=this.$26a;for(var _8=_1;_8<_2;_8++){var _9=_6[_8];_9.$28w=null;if(_3){_9.$28x=(isc.Browser.isIE?" STYLE='":" STYLE='OVERFLOW:hidden;");_9.$28y=this.$ob}else{_9.$28x=(isc.Browser.isIE?" WIDTH="+(_7[_8]-_4)+" STYLE='":" STYLE='"+this.$28z(_8));if(_5){_9.$28y=this.$280(_8)+this.$ob}}if(!this.fixedRowHeights){_9.$28x+=this.$281()}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -