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

📄 olapgrid.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
this._width=nWidth;if(nHeight!=null)
this._height=nHeight;}
_p=_biExtend(BiArea,BiObject,"BiArea");_p._width=1;_p._height=1;BiArea.prototype.getLeft=function(){return this._left;};BiArea.prototype.setLeft=function(v){this._left=v;};BiArea.prototype.getTop=function(){return this._top;};BiArea.prototype.setTop=function(v){this._top=v;};BiArea.prototype.getWidth=function(){return this._width;};BiArea.prototype.setWidth=function(v){this._width=v;};BiArea.prototype.getHeight=function(){return this._height;};BiArea.prototype.setHeight=function(v){this._height=v;};_p.hitTest=function(x,y)
{return x>=this._left&&x<this._left+this._width&&y>=this._top&&y<this._top+this._width;};_p.contains=function(a)
{return this._left<=a._left&&this._left+this._width>=a._left+a._width&&this._top<=a._top&&this._top+this._height>=a._top+a._height;};_p.equals=function(oArea)
{return oArea!=null&&oArea._left==this._left&&oArea._top==this._top&&oArea._width==this._width&&oArea._height==this._height;};BiArea.enclose=function(a1,a2)
{var a=new BiArea;a._left=Math.min(a1._left,a2._left);a._top=Math.min(a1._top,a2._top);var r1=a1._left+a1._width;var r2=a2._left+a2._width;var r=Math.max(r1,r2);a._width=r-a._left;var b1=a1._top+a1._height;var b2=a2._top+a2._height;var b=Math.max(b1,b2);a._height=b-a._top;return a;};function BiAreaCollection()
{if(_biInPrototype)return;this._c=[];}
_p=_biExtend(BiAreaCollection,BiObject,"BiAreaCollection");_p.add=function(oArea)
{if(!this.contains(oArea))
this._c.push(oArea);};_p.hitTest=function(x,y)
{for(var i=0;i<this._c.length;i++)
{if(this._c[i].hitTest(x,y))
return true;}
return false;};_p.remove=function(oArea)
{for(var i=0;i<this._c.length;i++)
{if(this._c[i].equals(oArea))
{this._c.splice(i,1);return;}}};_p.removeAll=function()
{this._c=[];};_p.contains=function(oArea)
{for(var i=0;i<this._c.length;i++)
{if(this._c[i].contains(oArea))
return true;}
return false;};_p.getItemHashCode=function(oItem)
{return"{x:"+oItem._left+","+"y:"+oItem._top+","+"w:"+oItem._width+","+"h:"+oItem._height+"}";};_p.toArray=function()
{return this._c.concat();};_p.dispose=function()
{if(this._disposed)
return;BiObject.prototype.dispose.call(this);this._c=null;};_p.getChangeValue=function()
{var sb=[];for(var i=0;i<this._c.length;i++)
sb.push(this.getItemHashCode(this._c[i]));sb.sort();return sb.join(",");};_p.isEmpty=function()
{return this._c.length==0;};function BiOlapGridSelectionModel(oOwner)
{if(_biInPrototype)return;BiSelectionModel.call(this,oOwner);this._selectedItems=new BiAreaCollection;}
_p=_biExtend(BiOlapGridSelectionModel,BiSelectionModel,"BiOlapGridSelectionModel");_p._canDeselect=false;_p._dragSelection=true;_p.setCanDeselect=function(b){this._canDeselect=false;};_p.getViewManager=function()
{return this._owner.getViewManager();};_p.getDataModel=function()
{return this._owner.getDataModel();};_p.getFirst=function()
{var vm=this.getViewManager();var x=vm.getNonFixedCell(0);var y=vm.getNonFixedCell(1);if(x!=null&&y!=null)
return new BiArea(x,y);return null;};_p.getLast=function()
{var vm=this.getViewManager();var x=vm.getLastVisibleCell(0);var y=vm.getLastVisibleCell(1);if(x!=null&&y!=null)
return new BiArea(x,y);return null;};_p.isBefore=function(oItem1,oItem2)
{return this._compare(oItem1,oItem2)<0;};_p._compare=function(oItem1,oItem2)
{if(oItem1.getTop()==oItem2.getTop())
return oItem1.getLeft()-oItem2.getLeft();return oItem1.getTop()-oItem2.getTop();};_p.isEqual=function(oItem1,oItem2)
{return oItem1&&oItem1.equals(oItem2);};_p.getItems=function()
{var c=new BiAreaCollection();c.add(new BiArea(0,0,Infinity,Infinity));return c;};_p.getNext=function(oItem)
{var dm=this.getDataModel();var vm=this.getViewManager();var x,y;if(oItem==null)
{y=vm.getFirstVisibleCell(1);if(y==null)
return null;x=vm.getFirstVisibleCell(0);if(x==null)
return null;return new BiArea(x,y);}
y=vm.getNextVisibleCell(1,oItem.getTop());if(y!=null)
return new BiArea(oItem.getLeft(),y);return null;};_p.getPrevious=function(oItem)
{var dm=this.getDataModel();var vm=this.getViewManager();var x,y;if(oItem==null)
{y=vm.getLastVisibleCell(1);if(y==null)
return null;x=vm.getLastVisibleCell(0);if(x==null)
return null;return new BiArea(x,y);}
y=vm.getPreviousVisibleCell(1,oItem.getTop());if(y!=null)
return new BiArea(oItem.getLeft(),y);return null;};_p.getRight=function(oItem)
{var vm=this.getViewManager();if(oItem==null)
return this.getFirst();var x;if(this._owner.getRightToLeft())
x=vm.getPreviousVisibleCell(0,oItem.getLeft());else x=vm.getNextVisibleCell(0,oItem.getLeft());if(x!=null)
return new BiArea(x,oItem.getTop());return null;};_p.getLeft=function(oItem)
{var vm=this.getViewManager();if(oItem==null)
return this.getLast();var x;if(this._owner.getRightToLeft())
x=vm.getNextVisibleCell(0,oItem.getLeft());else x=vm.getPreviousVisibleCell(0,oItem.getLeft());if(x!=null)
return new BiArea(x,oItem.getTop());return null;};_p.getUp=function(oItem)
{return!oItem?this.getLast():this.getPrevious(oItem);};_p.getDown=function(oItem)
{return!oItem?this.getFirst():this.getNext(oItem);};_p.getHome=function(oItem)
{if(oItem==null)
return this.getFirst();var vm=this.getViewManager();var x=vm.getNonFixedCell(0);if(x!=null)
return new BiArea(x,oItem.getTop());return null;};_p.getCtrlHome=function(oItem)
{return this.getFirst();};_p.getEnd=function(oItem)
{if(oItem==null)
return this.getLast();var vm=this.getViewManager();var x=vm.getLastVisibleCell(0);if(x!=null)
return new BiArea(x,oItem.getTop());return null;};_p.getCtrlEnd=function(oItem)
{return this.getLast();};_p.getItemHashCode=function(oItem)
{return oItem.toHashCode();};_p.scrollItemIntoView=function(oItem)
{this.getViewManager().scrollAreaIntoView(oItem);};_p.getItemLeft=function(oItem)
{var vm=this.getViewManager();return vm.getCellLeft(oItem);};_p.getItemWidth=function(oItem)
{var vm=this.getViewManager();return vm.getAreaWidth(oItem);};_p.getItemTop=function(oItem)
{var vm=this.getViewManager();return vm.getCellTop(oItem);};_p.getItemHeight=function(oItem)
{var vm=this.getViewManager();return vm.getAreaHeight(oItem);};_p.updateItemSelectionState=function(oItem,bSelected)
{this._owner._updateAreaSelected(oItem);};_p.updateItemLeadState=function(oItem,bLead)
{this._owner._updateAreaSelected(oItem);};_p.updateItemAnchorState=function(oItem,bAnchor)
{this._owner._updateAreaSelected(oItem);};_p.getItemSelected=function(oItem)
{return this._selectedItems.contains(oItem);};_p._selectItemRange=function(item1,item2,bDeselect)
{var a=BiArea.enclose(item1,item2);if(bDeselect)
this._deselectAll();this._selectedItems.add(a);this.updateItemSelectionState(a,true);};_p._deselectItemRange=function(item1,item2)
{var a=BiArea.enclose(item1,item2);this._selectedItems.remove(a);this.updateItemSelectionState(a,false);};_p._deselectAll=function()
{var a=this._selectedItems.toArray();this._selectedItems.removeAll();for(var i=0;i<a.length;i++)
this.updateItemSelectionState(a[i],false);};_p._selectAll=function()
{if(!this._multipleSelection)return;var a=new BiArea(0,0,Infinity,Infinity);this._selectedItems.removeAll();this._selectedItems.add(a);this.updateItemSelectionState(a,true);};_p.getRowSelected=function(y)
{return this._selectedItems.contains(new BiArea(0,y,Infinity,1));};_p.setRowSelected=function(y,b)
{this.setItemSelected(new BiArea(0,y,Infinity,1),b);};_p.getColumnSelected=function(x)
{return this._selectedItems.contains(new BiArea(x,0,1,Infinity));};_p.setColumnSelected=function(x,b)
{this.setItemSelected(new BiArea(x,0,1,Infinity),b);};_p.getCellSelected=function(x,y)
{return this._selectedItems.contains(new BiArea(x,y));};_p.setCellSelected=function(x,y,b)
{this.setItemSelected(new BiArea(x,y),b);};_p.getCellIsLead=function(x,y)
{return this._leadItem!=null&&new BiArea(x,y).equals(this._leadItem);};_p.getCellIsAnchor=function(x,y)
{return this._anchorItem!=null&&new BiArea(x,y).equals(this._anchorItem);};_p.getItemToSelect=function(e)
{switch(e.getKeyCode())
{case BiKeyboardEvent.ENTER:if(e.getShiftKey())
{this._ignoreShift=true;return this.getUp(this._leadItem);}
else {return this.getDown(this._leadItem);}
case BiKeyboardEvent.TAB:if(!this._owner.getAllowTab())
{break;}
if(e.getShiftKey())
{this._ignoreShift=true;return this.getLeft(this._leadItem);}
else {return this.getRight(this._leadItem);}}
return BiSelectionModel.prototype.getItemToSelect.call(this,e);};_p._update=function(){};function BiOlapGridStateManager()
{if(_biInPrototype)return;BiEventTarget.call(this);this._active=new BiOlapGridCellInfo;this._hover=new BiOlapGridCellInfo;this._dragOver=new BiOlapGridCellInfo;}
_p=_biExtend(BiOlapGridStateManager,BiEventTarget,"BiOlapGridStateManager");BiOlapGridStateManager.prototype.getActive=function(){return this._active;};_p.setActive=function(oCellInfo)
{this._active=oCellInfo||new BiOlapGridCellInfo;};BiOlapGridStateManager.prototype.getHover=function(){return this._hover;};_p.setHover=function(oCellInfo,e)
{if(oCellInfo==null)
oCellInfo=new BiOlapGridCellInfo;if(!this._hover.equals(oCellInfo))
{this._hover=oCellInfo;this.dispatchEvent(new BiOlapStateEvent("hoverchanged",e.getCtrlKey(),e.getShiftKey()));}};BiOlapGridStateManager.prototype.getDrag=function(){return this._drag;};_p.setDrag=function(oCellInfo,e)
{this._active=oCellInfo||new BiOlapGridCellInfo;};_p.getDrag=function()
{return this._active

⌨️ 快捷键说明

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