📄 isc_grids.js
字号:
,isc.A.hasChildren=function(_1,_2){var _3=this.getChildren(_1,_2);return _3&&_3.length>0},isc.A.hasFolders=function(_1){return this.hasChildren(_1,isc.Tree.FOLDERS_ONLY)},isc.A.hasLeaves=function(_1){return this.hasChildren(_1,isc.Tree.LEAVES_ONLY)},isc.A.isDescendantOf=function(_1,_2){if(_1==_2)return false;var _3=_1;while(_3!=null){if(_3==_2)return true;_3=_3[this.parentProperty]}return false},isc.A.getDescendants=function(_1,_2,_3){if(!_1)_1=this.root;var _4=[];if(!_3)_3=function(){return true};if(this.isLeaf(_1))return _4;var _5=this.getChildren(_1);if(!_5)return _4;for(var i=0,_7=_5.length,_8;i<_7;i++){_8=_5[i];if(this.isFolder(_8)){if(_2!=isc.Tree.LEAVES_ONLY&&_3(_8))_4[_4.length]=_8;_4=_4.concat(this.getDescendants(_8,_2,_3))}else{if(_2!=isc.Tree.FOLDERS_ONLY&&_3(_8)){_4[_4.length]=_8}}}return _4},isc.A.getDescendantFolders=function(_1,_2){return this.getDescendants(_1,isc.Tree.FOLDERS_ONLY,_2)},isc.A.getDescendantLeaves=function(_1,_2){return this.getDescendants(_1,isc.Tree.LEAVES_ONLY,_2)},isc.A.dataChanged=function(){},isc.A.add=function(_1,_2,_3){if(isc.isA.String(_2))_2=this.find(_2);if(!_2){var _4=this.getParentPath(_1);if(_4)_2=this.find(_4);if(!_2)return false}this.$27e(_1,_2,_3);this.$27f();this.dataChanged();return _1},isc.A.$27e=function(_1,_2,_3){this.getName(_1);this.convertToFolder(_2);var _4=_2[this.childrenProperty];if(!_4)_4=_2[this.childrenProperty]=[];if(_4!=null&&!isc.isAn.Array(_4))_2[this.childrenProperty]=_4=[_4];if(_3==null||_3>_4.length){_4.add(_1)}else{_4.addAt(_1,_3)}var _5=this.idField_1[this.parentIdField]=_2[_5];_1[this.parentProperty]=_2;_1[this.treeProperty]=this.ID;this.nodeIndex[_1[_5]]=_1;this.setLoadState(_2,isc.Tree.LOADED);var _6=_1[this.childrenProperty];if(_6!=null){_1[this.childrenProperty]=[];if(!isc.isAn.Array(_6))this.$27e(_6,_1);else if(_6.length>0)this.$27k(_6,_1);this.setLoadState(_1,isc.Tree.LOADED)}else{var _7=_1[this.isFolderProperty];if(_7!=null&&!isc.isA.Boolean(_7))_7=isc.booleanValue(_7,true);if(_7==null&&this.defaultIsFolder)_7=true;_1[this.isFolderProperty]=_7}},isc.A.addList=function(_1,_2,_3){if(isc.isA.String(_2))_2=this.find(_2);if(!_2)return false;this.$27k(_1,_2,_3);this.$27f();this.dataChanged();return _1},isc.A.$27k=function(_1,_2,_3){for(var i=0,_5=_1.length;i<_5;i++)this.$27e(_1[i],_2,_3!=null?_3++:null)},isc.A.move=function(_1,_2,_3){this.moveList([_1],_2,_3)},isc.A.moveList=function(_1,_2,_3){var _4=_1[0],_5=this.getParent(_4),_6=this.getChildren(_5).indexOf(_4);this.removeList(_1);if(_2==_5&&_1.length==1){if(_3>_6)_3--}else{var _7=this.getChildren(_2);if(_7&&_3>_7.length)_3=_7.length}this.addList(_1,_2,_3);this.dataChanged()},isc.A.remove=function(_1,_2){var _3=this.getParent(_1);if(!_3)return false;var _4=this.getChildren(_3);if(!_4)return false;if(_4.remove(_1)){delete this.nodeIndex[_1[this.idField]];if(!_2){this.$27f();this.dataChanged()}return true}return false},isc.A.removeList=function(_1){var _2=false;for(var _3=_1.length-1,i=_3;i>=0;i--){if(this.remove(_1[i],true))_2=true}if(_2){this.$27f();this.dataChanged()}return _2},isc.A.getLoadState=function(_1){if(!_1)return null;if(!_1.$27g)return this.defaultLoadState;return _1.$27g},isc.A.isLoaded=function(_1){var _2=this.getLoadState(_1);return(_2==isc.Tree.LOADED||_2==isc.Tree.LOADING)},isc.A.setLoadState=function(_1,_2){_1.$27g=_2},isc.A.loadRootChildren=function(_1){this.loadChildren(this.root,_1)},isc.A.loadChildren=function(_1,_2){if(!_1)_1=this.root;this.setLoadState(_1,isc.Tree.LOADED);if(_2){this.fireCallback(_2,"node",[_1],this)}},isc.A.unloadChildren=function(_1,_2){if(this.isLeaf(_1))return;var _3;if(_2==isc.Tree.LEAVES_ONLY){_3=this.getLeaves(_1);_1[this.childrenProperty]=this.getFolders(_1);this.setLoadState(_1,isc.Tree.FOLDERS_LOADED)}else{_3=_1[this.childrenProperty];_1[this.childrenProperty]=[];this.setLoadState(_1,isc.Tree.UNLOADED)}if(_3){for(var i=0;i<_3.length;i++){var _1=_3[i];delete this.nodeIndex[_1[this.idField]]}}this.$27f();this.dataChanged()},isc.A.reloadChildren=function(_1,_2){this.unloadChildren(_1,_2);this.loadChildren(_1,_2)},isc.A.$27f=function(){this.$q7=true},isc.A.isOpen=function(_1){return _1!=null&&_1[this.openProperty]},isc.A.getOpenFolders=function(_1){if(_1==null)_1=this.root;var _2=this.getDescendantFolders(_1,new Function("node","return node."+this.openProperty));if(this.isOpen(_1))_2.add(_1);return _2},isc.A.getOpenFolderPaths=function(_1){var _2=this.getOpenFolders(_1);for(var i=0;i<_2.length;i++){_2[i]=this.getPath(_2[i])}return _2},isc.A.changeDataVisibility=function(_1,_2){if(this.isLeaf(_1))return false;_1[this.openProperty]=_2;this.$27f();if(_2&&!this.isLoaded(_1)){this.loadChildren(_1)}},isc.A.toggleFolder=function(_1){this.changeDataVisibility(_1,!this.isOpen(_1))},isc.A.openFolder=function(_1){if(_1==null)_1=this.root;if(!this.isOpen(_1)){this.changeDataVisibility(_1,true)}},isc.A.openFolders=function(_1){for(var i=0;i<_1.length;i++){var _3=_1[i];if(_3==null)continue;if(isc.isA.String(_3))_3=this.find(_3);if(_3!=null){this.openFolder(_3)}}},isc.A.closeFolder=function(_1){if(this.isOpen(_1)){this.changeDataVisibility(_1,false)}},isc.A.closeFolders=function(_1){for(var i=0;i<_1.length;i++){var _3=_1[i];if(_3==null)continue;if(isc.isA.String(_3))_3=this.find(_3);if(_3!=null){this.closeFolder(_3)}}},isc.A.openAll=function(_1){if(!_1)_1=this.root;var _2=this.getDescendants(_1,isc.Tree.FOLDERS_ONLY);for(var i=0,_4=_2.length;i<_4;i++){if(!this.isOpen(_2[i])){this.changeDataVisibility(_2[i],true)}}this.changeDataVisibility(_1,true)},isc.A.closeAll=function(_1){if(!_1)_1=this.root;var _2=this.getDescendants(_1,isc.Tree.FOLDERS_ONLY);for(var i=0,_4=_2.length;i<_4;i++){if(this.isOpen(_2[i])){this.changeDataVisibility(_2[i],false)}}if(!(_1==this.root&&this.showRoot==false))this.changeDataVisibility(_1,false)},isc.A.getOpenList=function(_1,_2,_3,_4,_5,_6){if(!_1)_1=this.root;if(_3==null)_3=this.$27i;if(_4==null)_4=this.sortDirection;if(_6==null)_6=this.$45g;if(this.isLeaf(_1)){if(_1==this.root)return[];return null}var _7=[];if(_2!=isc.Tree.LEAVES_ONLY)_7[_7.length]=_1;if(!this.isOpen(_1))return _7;var _8=this.getChildren(_1,_2,_3,_4,_5,_6);for(var i=0,_10=_8.length,_11;i<_10;i++){_11=_8[i];if(!_11){continue}var _12=_11[this.childrenProperty];if(_12&&_12.length){_7=_7.concat(this.getOpenList(_11,_2,_3,_4,_5))}else{if(_2!=isc.Tree.FOLDERS_ONLY){_7[_7.length]=_11}}}if(!this.showRoot&&_7[0]==this.root){_7=_7.slice(1,_7.length)}return _7},isc.A.$27l=function(){if(!this.$27m||this.$q7||!this.cacheOpenList){this.$27m=this.getOpenList(this.root,this.openDisplayNodeType,this.$27i,this.sortDirection,this.openListCriteria);this.$q7=false}return this.$27m},isc.A.getLength=function(){return this.$27l().length},isc.A.get=function(_1){return this.$27l()[_1]},isc.A.getRange=function(_1,_2){return this.$27l().slice(_1,_2)},isc.A.indexOf=function(_1,_2,_3){return this.$27l().indexOf(_1,_2,_3)},isc.A.lastIndexOf=function(_1,_2,_3){return this.$27l().lastIndexOf(_1,_2,_3)},isc.A.getAllItems=function(){return this.$27l()},isc.A.sortByProperty=function(_1,_2,_3,_4){if(_1!=null)this.sortProp=_1;if(_2!=null)this.sortDirection=_2;if(_3&&isc.isA.Function(_3)){this.$27i=_3}else{this.$27n()}this.$45g=_4;this.$27f();this.dataChanged()},isc.A.$27n=function(){var _1=this.sortProp,_2=this.sortDirection,_3=this.separateFolders!=false;var _4=isc.SB.create();_4.append("var __tree__ = ",this.getID(),";\rvar value = '';");if(_3)_4.append("value+=(__tree__.isFolder(obj) ? '0:' : '1:');");if(_1&&_1!="title"){_4.append("var prop = obj.",_1,";","if (isc.isA.Number(prop)) prop = prop.stringify(12);","if (isc.isA.Date(prop)) prop = prop.getTime();","if (prop != null) value += prop + ':';")}_4.append("var title = __tree__.getTitle(obj);","if (isc.isA.Number(title)) title = title.stringify(12);","if (isc.isA.Date(title)) title = title.getTime();","if (title != null) {title = title + ''; value += title.toLowerCase()}","return value;");this.addMethods({$27i:new Function("obj,property",_4.toString())})},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}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -