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

📄 isc_grids.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 5 页
字号:
,isc.A.getParent=function(_1){if(_1==null)return null;return _1[this.parentProperty]},isc.A.getParents=function(_1){var _2=[],_3=this.getParent(_1);while(_3){_2.add(_3);if(_3==this.root)break;_3=this.getParent(_3)}return _2},isc.A.getLevel=function(_1){return this.getParents(_1).length},isc.A.isFolder=function(_1){if(_1==null)return false;var _2=_1[this.isFolderProperty];if(_2!=null)return _2;if(_1[this.childrenProperty])return true;var _3=this.getName(_1);if(_3==null)return false;return isc.endsWith(_3,this.pathDelim)},isc.A.isLeaf=function(_1){return!this.isFolder(_1)},isc.A.isLast=function(_1){var _2=this.getParent(_1);if(!_2)return true;var _3=this.getChildren(_2,this.opendisplayNodeType,this.$27i,this.sortDirection,null,this.$45g);return _3[_3.length-1]==_1},isc.A.findById=function(_1){return this.find(this.idField,_1)},isc.A.find=function(_1,_2){var _3;if(_2===_3)return this.$27j(_1);if(_1==this.idField)return this.nodeIndex[_2];if(this.root[_1]==_2)return this.root;return this.getDescendants().find(_1,_2)},isc.A.findAll=function(_1,_2){return this.getDescendants().findAll(_1,_2)},isc.A.$27j=function(_1){if(_1==this.pathDelim)return this.root;var _2=this.getPath(this.root);if(_1==_2)return this.root;var _3=this.root,_4=0,_5=this.pathDelim.length;if(isc.startsWith(_1,_2)){_4=_2.length}else if(isc.startsWith(_1,this.pathDelim)){_4+=_5}while(true){var _6=_1.indexOf(this.pathDelim,_4);if(_6==_4){_4++;continue}var _7=(_6!=-1),_8=_1.substring(_4,_7?_6:_1.length),_9=this.findChildNum(_3,_8);if(_9==-1)return null;_3=_3[this.childrenProperty][_9];if(!_7)return _3;_4=_6+_5;if(_4==_1.length)return _3}},isc.A.findChildNum=function(_1,_2){var _3=this.getChildren(_1);if(_3==null)return-1;if(_2==null)return-1;var _4=_3.getLength(),_5=isc.endsWith(_2,this.pathDelim),_6=this.pathDelim.length;for(var i=0;i<_4;i++){var _8=this.getName(_3.get(i)),_9=_8.length-_2.length;if(_9==0&&_8==_2)return i;if(_9==_6){if(isc.startsWith(_8,_2)&&isc.endsWith(_8,this.pathDelim)&&!_5){return i}}else if(_5&&_9==-_6){if(isc.startsWith(_2,_8))return i}}return-1},isc.A.getChildren=function(_1,_2,_3,_4,_5,_6){if(_1==null)_1=this.root;if(this.isLeaf(_1))return null;if(_1[this.childrenProperty]==null){var _7=[];_1[this.childrenProperty]=_7;return _7}var _8=_1[this.childrenProperty],_9;if(_5){_9=[];for(var i=0,_11=_8.length;i<_11;i++){var _12=_8[i];if(this.fireCallback(_5,"node,parent,tree",[_12,_1,this]))_9[_9.length]=_12}_8=_9}if(_2==isc.Tree.FOLDERS_ONLY){_9=[];for(var i=0,_11=_8.length;i<_11;i++){if(this.isFolder(_8[i]))_9[_9.length]=_8[i]}}else if(_2==isc.Tree.LEAVES_ONLY){_9=[];for(var i=0,_11=_8.length;i<_11;i++){if(this.isLeaf(_8[i]))_9[_9.length]=_8[i]}}else{_9=_8}if(_3){_9.sortByProperty(this.sortProp,_4,_3,_6)}return _9},isc.A.getFolders=function(_1,_2,_3,_4,_5){return this.getChildren(_1,isc.Tree.FOLDERS_ONLY,_2,_3,_4,_5)},isc.A.getLeaves=function(_1,_2,_3,_4,_5){return this.getChildren(_1,isc.Tree.LEAVES_ONLY,_2,_3,_4,_5)},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())})}

⌨️ 快捷键说明

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