⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isc_grids.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 5 页
字号:
,isc.A.loadSubtree=function(_1,_2,_3){if(!_1)_1=this.getRoot();if(_2==null)_2=this.loadBatchSize;this.$27o=_3?2:1;var _4=0,_5=1;while(_4<_2){var _6=this.$27p(_2,_1,_4,_5++);if(_6==0)break;_4+=_6}this.$27o=null;if(_4>0)this.$27f()},isc.A.loadingBatch=function(_1){if(_1)return this.$27o==2;else return this.$27o},isc.A.$27p=function(_1,_2,_3,_4){var _5=0;if(!this.isOpen(_2)){if(!this.isLoaded(_2))this.loadChildren(_2);if(this.isLoaded(_2)){if(this.openFolder(_2)===false)return _5}if(_2.children){_5+=_2.children.length;_3+=_2.children.length}}var _6=_2.children;if(_3>=_1||_4==0||_6==null)return _5;for(var i=0;i<_6.length;i++){var _8=_6[i];var _9=this.$27p(_1,_8,_3,_4-1);_5+=_9;_3+=_9;if(_3>=_1)return _5}return _5});isc.B._maxIndex=isc.C+81;isc.ClassFactory.defineClass("Selection");isc.A=isc.Selection.getPrototype();isc.A.$q7=true;isc.A=isc.Selection;isc.A.NONE="none";isc.A.SINGLE="single";isc.A.MULTIPLE="multiple";isc.A.SIMPLE="simple";isc.A.$24e=0;isc.A=isc.Selection.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function(){if(!this.selectionProperty)this.selectionProperty="_selection_"+isc.Selection.$24e++;this.setData((this.data?this.data:[]))},isc.A.setData=function(_1){if(this.data!=null)this.ignoreData(this.data);this.data=_1;if(this.data!=null)this.observeData(this.data)},isc.A.observeData=function(_1){this.observe(_1,"dataChanged","observer.dataChanged()");if(_1.dataArrived)this.observe(_1,"dataArrived","observer.dataChanged()")},isc.A.ignoreData=function(_1){this.ignore(_1,"dataChanged")},isc.A.dataChanged=function(){this.markForRedraw()},isc.A.markForRedraw=function(){this.$q7=true},isc.A.isSelected=function(_1){if(_1==null)return false;if(isc.isAn.XMLNode(_1))return"true"==_1.getAttribute(this.selectionProperty);return _1[this.selectionProperty]},isc.A.anySelected=function(){return this.getSelection().length>0},isc.A.multipleSelected=function(){return this.getSelection().length>1},isc.A.getSelection=function(){if(this.$q7)this.cacheSelection();return this.$27q},isc.A.getSelectedRecord=function(){var _1=this.getSelection();if(_1&&_1.length>0)return _1[0]},isc.A.cacheSelection=function(){this.$27q=[];var _1=this.data,_2=isc.isA.ResultSet!=null&&isc.isA.ResultSet(_1),_3=_1.getLength();if(_2&&!_1.lengthIsKnown()){this.$q7=false;return}for(var i=0;i<_3;i++){if(_2&&!_1.rowIsLoaded(i))continue;var _5=_1.get(i);if(_5!=null&&this.isSelected(_5)){this.$27q[this.$27q.length]=_5}}this.$q7=false},isc.A.setSelected=function(_1,_2){if(_1==null)return false;if(_1.enabled==false)return false;var _3=this.selectionProperty,_4=isc.isAn.XMLNode(_1);if(_2==null)_2=true;var _5=_4?_1.getAttribute(_3):_1[_3];if(_5==null)_5=false;if(_4){_1.setAttribute(_3,(_2==true)+"")}else{_1[_3]=_2}this.lastSelectionItem=_1;this.lastSelectionState=_2;if(_2==_5)return false;this.markForRedraw();return true},isc.A.select=function(_1){return this.setSelected(_1,true)},isc.A.deselect=function(_1){return this.setSelected(_1,false)},isc.A.selectSingle=function(_1){this.deselectAll();return this.select(_1)},isc.A.selectList=function(_1,_2){if(_2==null)_2=true;if(!_1)return false;var _3=false,_4=_1.getLength();for(var i=0;i<_4;i++){var _6=_1.get(i);if(this.isSelected(_6)==_2)continue;_3=this.setSelected(_6,_2)||_3}return _3},isc.A.deselectList=function(_1){this.selectList(_1,false)},isc.A.selectAll=function(){return this.selectRange(0,this.data.getLength())},isc.A.deselectAll=function(){return this.deselectList(this.getSelection())},isc.A.selectItem=function(_1){return this.selectRange(_1,_1+1)},isc.A.deselectItem=function(_1){return this.deselectRange(_1,_1+1)},isc.A.selectRange=function(_1,_2,_3){if(_3==null)_3=true;if(isc.isA.ResultSet!=null&&isc.isA.ResultSet(this.data)&&!this.data.rangeIsLoaded(_1,_2)){isc.warn("Can't select that many records at once.<br><br>"+"Please try working in smaller batches.");return false}return this.selectList(this.data.getRange(_1,_2),_3)},isc.A.deselectRange=function(_1,_2){return this.selectRange(_1,_2,false)},isc.A.selectOnMouseDown=function(_1,_2){var _3=_1.selectionType||isc.Selection.MULTIPLE;if(_3==isc.Selection.NONE)return false;this.startRow=this.lastRow=_2;this.logDebug("selectOnMouseDown: recordNum: "+_2);var _4=this.data.get(_2),_5=this.isSelected(_4),_6=this.getSelection();if(Array.isLoading(_4))return false;this.deselectRecordOnMouseUp=false;this.deselectOthersOnMouseUp=false;var _7=(isc.Browser.isMac?isc.EventHandler.metaKeyDown():isc.EventHandler.ctrlKeyDown()),_8=isc.EH.shiftKeyDown();if(_3==isc.Selection.SINGLE){if(_7&&_5)this.deselect(_4);else if(!_5)this.selectSingle(_4);return true}else if(_8){if(_6.length==0){this.select(_4);return true}else{var _9=this.data.indexOf(_6[0]),_10=this.data.indexOf(_6.last());if(_2>=_10){this.selectRange(_9,_2+1)}else if(_2<=_9){this.selectRange(_2,_10+1)}else{this.selectRange(_9,_2+1);this.deselectRange(_2+1,_10+1)}return true}}else if(_3==isc.Selection.SIMPLE){if(!_5){this.select(_4);return true}else{this.deselectRecordOnMouseUp=true;return false}}else if(_7){this.setSelected(_4,!_5);return true}else{if(!_5){this.selectSingle(_4);return true}else if(isc.EventHandler.rightButtonDown()){this.deselectOnDragMove=true;return false}else{if(this.dragSelection){if(this.simpleDeselect){this.deselectAll();this.selectOriginOnDragMove=true;return true}this.selectSingle(_4);return true}else{if(this.simpleDeselect){this.deselectAllOnMouseUp=true}else{this.deselectOthersOnMouseUp=(_6.length>1)}return false}}}},isc.A.selectOnDragMove=function(_1,_2){var _3=this.startRow,_4=this.lastRow;if(_2<0){this.logWarn("selectOnDragMove: got negative coordinate: "+_2);return}if(_2==_4)return;if(this.selectOriginOnDragMove){this.select(this.data.getItem(_3));this.selectOriginOnDragMove=false}else if(this.deselectOnDragMove||this.deselectAllOnMouseUp||this.deselectOthersOnMouseUp){this.selectSingle(this.data.getItem(_3));this.deselectAllOnMouseUp=this.deselectOthersOnMouseUp=this.deselectOnDragMove=false}if((_2>_3&&_3>_4)||(_4>_3&&_3>_2)){this.deselectAll();if(_3>_2){this.selectRange(_2,_3+1)}else{this.selectRange(_3,_2+1)}}else if(_3>=_4&&_4>_2){this.selectRange(_2,_4)}else if(_3>=_2&&_2>_4){this.deselectRange(_4,_2)}else if(_3<=_2&&_2<_4){this.deselectRange(_2+1,_4+1)}else if(_3<=_4&&_4<_2){this.selectRange(_4,_2+1)}else{this.logWarn("dragMove case not handled: lastRow: "+_4+", currRow: "+_2+", startRow "+_3)}this.lastRow=_2},isc.A.selectOnMouseUp=function(_1,_2){if(_1.selectionType==isc.Selection.NONE)return false;this.logDebug("selectOnMouseUp: recordNum: "+_2);if(this.deselectOthersOnMouseUp){this.selectSingle(this.data.getItem(_2));this.deselectOthersOnMouseUp=false;return true}else if(this.deselectRecordOnMouseUp){this.deselect(this.data.getItem(_2));this.deselectRecordOnMouseUp=false;return true}else if(this.deselectAllOnMouseUp){this.deselectAll();this.deselectAllOnMouseUp=false;return true}elsereturn false});isc.B._maxIndex=isc.C+27;isc.ClassFactory.defineClass("DetailViewer","Canvas");isc.A=isc.DetailViewer.getPrototype();isc.A.fieldIdProperty="name";isc.A.recordsPerBlock=1;isc.A.blockSeparator="<BR><BR>";isc.A.showEmptyField=true;isc.A.emptyCellValue="&nbsp;";isc.A.labelPrefix="";isc.A.labelSuffix=":";isc.A.labelStyle="detailLabel";isc.A.cellStyle="detail";isc.A.headerStyle="detailHeader";isc.A.separatorStyle="detail";isc.A.cellPadding=3;isc.A.showBorder=true;isc.A.showEmptyMessage=true;isc.A.emptyMessage="No items to display.";isc.A.emptyMessageStyle="normal";isc.A.loadingMessage="&nbsp;";isc.A.loadingMessageStyle="normal";isc.A.defaultHeight=35;isc.A=isc.DetailViewer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$g4="date";isc.B.push(isc.A.initWidget=function(){this.Super("initWidget",arguments);this.fields=this.bindToDataSource(this.fields)},isc.A.setData=function(_1){if(this.data)this.ignore(this.data,"dataChanged");this.data=_1;if(this.data&&this.data.dataChanged){this.observe(this.data,"dataChanged","observer.markForRedraw()")}this.markForRedraw("new data")},isc.A.getData=function(){return this.data},isc.A.getFields=function(){return this.fields},isc.A.getInnerHTML=function(){var _1=this.getData();if(isc.ResultSet!=null&&isc.isA.ResultSet(_1)&&!_1.lengthIsKnown()){_1.getRange(0,10000);return this.loadingMessageHTML()}if((_1==null||(isc.isAn.Array(_1)&&_1.getLength()==0))&&this.showEmptyMessage){return this.emptyMessageHTML()}if(this.fields==null||this.fields.length==0){return"Note: you must define detailViewer.fields to specify what to display!"}if(!isc.isA.List(_1))_1=[_1];if(_1.getLength()==1||this.recordsPerBlock=="*"){return this.getBlockHTML(_1)}else{var _2=isc.StringBuffer.newInstance();for(var _3=0;_3<_1.getLength();_3+=this.recordsPerBlock){_2.append(this.getBlockHTML(_1.getRange(_3,_3+this.recordsPerBlock)),this.blockSeparator)}return _2.toString()}},isc.A.getBlockHTML=function(_1){var _2=_1.getLength();var _3="<TABLE WIDTH="+this.getInnerWidth()+" CELLPADDING="+this.cellPadding;if(this.showBorder){_3+=(isc.Browser.isIE?" CELLSPACING=1 BORDER=0 STYLE='background-color:gray;'":" CELLSPACING=0 BORDER=1")}_3+=">";var _4=this.fields;for(var _5=0,_6=_4.length;_5<_6;_5++){var _7=_4[_5];if(!_7)continue;if(_7.showIf){if(!isc.isA.Function(_7.showIf)){isc.Func.replaceWithMethod(_7,"showIf","viewer,valueList")}if(_7.showIf(this,_1)==false)continue}var _8=_7.type?_7.type:"";if(_8!="separator"&&_8!="header"&&!this.showEmptyField){var _9=true;for(var i=0;i<_1.getLength();i++){var _11=_1.get(i)[_7[this.fieldIdProperty]]if(!(_11==null||_11=="")){_9=false;break}}if(_9)continue}if(_7.output){if(!isc.isA.Function(_7.output)){isc.Func.replaceWithMethod(_7,"output","fieldNum,field,valueList")}_3+=_7.output(_5,_7,_1)}else{_3+=this.outputItem(_5,_7,_1)}}_3+="</TABLE>"return _3},isc.A.outputItem=function(_1,_2,_3){var _4=(_2.type?_2.type:"value"),_5="output_"+_4,_6="";if(!this[_5])_5="output_value";_6+="<TR"+(this.rowClass!=null?" CLASS='"+this.rowClass+"'":"")+">";_6+=this[_5](_1,_2,_3);_6+="</TR>\r";return _6},isc.A.output_blob=function(_1,_2,_3){return this.output_binary(_1,_2,_3)},isc.A.output_upload=function(_1,_2,_3){return this.output_binary(_1,_2,_3)},isc.A.output_binary=function(_1,_2,_3){var _4="<TD WIDTH=10% CLASS='"+this.labelStyle+"' ALIGN=RIGHT"+(this.wrapLabel?">":" NOWRAP><NOBR>")+this.labelPrefix+(_2.title?_2.title:_2[this.fieldIdProperty])+this.labelSuffix+"<\/NOBR><\/TD>";for(var i=0;i<_3.getLength();i++){var _6=_3.get(i);var _7=this.getData().indexOf(_6);var _8=_6[_2.name+"_filename"];var _9=isc.Canvas.imgHTML("[SKIN]actions/view.png",16,16,null,"style='cursor:"+isc.Canvas.HAND+"' onclick='"+this.getID()+".viewRow("+_7+")'");var _10=isc.Canvas.imgHTML("[SKIN]actions/download.png",16,16,null,"style='cursor:"+isc.Canvas.HAND+"' onclick='"+this.getID()+".downloadRow("+_7+")'");var _11=_9+"&nbsp;"+_10+"&nbsp;"+_8;_4+="<TD CLASS='"+this.cellStyle+"'>"+_11+"<\/TD>"}return _4},isc.A.viewRow=function(_1){isc.DS.get(this.dataSource).viewFile(this.getData().get(_1))},isc.A.downloadRow=function(_1){isc.DS.get(this.dataSource).downloadFile(this.getData().get(_1))},isc.A.output_value=function(_1,_2,_3){var _4="<TD WIDTH=10% CLASS='"+this.labelStyle+"' ALIGN=RIGHT"+(this.wrapLabel?">":" NOWRAP><NOBR>")+this.labelPrefix+(_2.title?_2.title:_2[this.fieldIdProperty])+this.labelSuffix+"<\/NOBR><\/TD>";if(_2.valueMap&&isc.isA.String(_2.valueMap))_2.valueMap=this.getGlobalReference(_2.valueMap);for(var i=0;i<_3.getLength();i++){var _6=this.getCellValue(_3.get(i),_2);_4+="<TD CLASS='"+this.cellStyle+"'>"+_6+"<\/TD>"}return _4},isc.A.getCellValue=function(_1,_2){var _3=_1[_2[this.fieldIdProperty]];if(isc.isA.String(_2.formatCellValue)){_2.formatCellValue=isc.Func.expressionToFunction("value, record, field",_2.formatCellValue)}if(_2.getCellValue!=null){if(isc.isA.String(_2.getCellValue)){_2.getCellValue=isc.Func.expressionToFunction("value, record, field",_2.getCellValue)}_3=_2.getCellValue(_3,_1,_2);if(_2.formatCellValue)_3=_2.formatCellValue(_3,_1)}else{if(_2.valueMap!=null)_3=isc.getValueForKey(_3,_2.valueMap);if(_2.formatCellValue)_3=_2.formatCellValue(_3,_1);if(_3==null||isc.is.emptyString(_3))_3=this.emptyCellValue}if(this.formatCellValue){_3=this.formatCellValue(_3,_1,_2)}else{_3=this.$17c(_1,_2,_3);if(_2.asHTML)_3=_3.asHTML()}return _3},isc.A.$17c=function(_1,_2,_3){var _4=_2.type,_5=(_4!=null?isc.SimpleType.getBaseType(_4):null),_6;if(_5==this.$g4)_6=(_2.dateFormatter||_2.formatter||this.dateFormatter);if(_6!=null){if(isc.isA.Date(_3))_3=_3.toNormalDate(_6)}else{if(_2.$64!=null){_3=_2.$62.normalDisplayFormatter(_3,_2,this,_1)}else if(_2.type==null&&isc.isA.Date(_3))_3=_3.toNormalDate()}return isc.iscToLocaleString(_3)},isc.A.output_header=function(_1,_2,_3){return"<TD COLSPAN="+(_3.getLength()+1)+" CLASS='"+this.headerStyle+"'>"+_2.value+"</TD>"},isc.A.output_separator=function(_1,_2,_3){var _4=(_2.width==null?_2.defaultSeparatorWidth:_2.width),_5=(_2.height==null?_2.defaultSeparatorHeight:_2.height);return"<TD COLSPAN="+(_3.getLength()+1)+" CLASS='"+this.separatorStyle+"'>"+isc.Canvas.spacerHTML(_4,_5)+"</TD>"},isc.A.getEmptyMessage=function(){return this.emptyMessage},isc.A.getLoadingMessage=function(){return this.loadingMessage},isc.A.emptyMessageHTML=function(){return"<TABLE WIDTH=100%>"+"<TR><TD CLASS='"+this.emptyMessageStyle+"' ALIGN=CENTER><BR><BR>"+this.getEmptyMessage()+"<\/TD><\/TR><\/TABLE>"},isc.A.loadingMessageHTML=function(){return"<TABLE WIDTH=100%>"+"<TR><TD CLASS='"+this.loadingMessageStyle+"' ALIGN=CENTER><BR><BR>"+this.getLoadingMessage()+"<\/TD><\/TR><\/TABLE>"});isc.B._maxIndex=isc.C+21;isc.DetailViewer.registerStringMethods({getCellValue:"record,field",formatCellValue:"value,record,field"});isc.ClassFactory.defineClass("GridRenderer","Canvas");isc.A=isc.GridRenderer;isc.A.SELECTED="Selected";isc.A.DISABLED="Disabled";isc.A.OVER="Over";isc.A.standardStyleSuffixes=["","Over","Selected","SelectedOver","Disabled","DisabledOver","DisabledSelected","DisabledSelectedOver","Dark","OverDark","SelectedDark","SelectedOverDark","DisabledDark"];isc.A=isc.GridRenderer.getPrototype();isc.A.totalRows=0;isc.A.isSeparatorProperty="isSeparator";isc.A.singleCellValueProperty="singleCellValue";isc.A.scrollRedrawDelay=75;isc.A.drawAheadRatio=1.3;isc.A.quickDrawAheadRatio=1.3;isc.A.cellHeight=20;isc.A.fixedRowHeights=true;isc.A.fixedColumnWidths=true;isc.A.cellSpacing=0;isc.A.cellPadding=2;isc.A.canSelectOnRightMouse=true;isc.A.hoverByCell=true;isc.A.backgroundColor="white";isc.A.tableStyle="listTable";isc.A.baseStyle="cell";isc.A.alternateRowFrequency=1;isc.A.emptyCellValue="&nbsp;";isc.A.overflow="auto";isc.A.$r9=true;isc.A.canFocus=true;isc.A.animateRowsMaxTime=1000;isc.A.snapToCells=false;isc.A.snapInsideBorder=false;isc.A.snapHDirection=isc.Canvas.BEFORE;isc.A.snapVDirection=isc.Canvas.BEFORE;isc.A=isc.GridRenderer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$27r="none";isc.A.$27s="<DIV cellClipDiv=true style='overflow:hidden;";isc.A.recordCustomStyleProperty="customStyle";isc.A.$27t="NOBR";isc.A.$27u="cellClipDiv";isc.A.$o5="height";isc.A.$27v="minHeight";isc.B.push(isc.A.initWidget=function(){if(!this.$26a)this.setColumnWidths([]);if(this.selection)this.setSelection(this.selection);if(this.overflow==isc.Canvas.VISIBLE){this.showAllRows=true;this.showAllColumns=true}if(!this.fixedRowHeights&&!this.showAllRows){if(!this.avgRowHeight)this.avgRowHeight=60;if(this.virtualScrolling==null)this.virtualScrolling=true;this.$r9=true;if(this.showCustomScrollbars==false){this.logWarn("Variable height records cannot be used with native scrollbars;"+" set showCustomScrollbars:true globally or on this GridRenderer")}this.showAllColumns=true}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -