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

📄 grids.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
node._scrollSubtreeIntoView();}
else this._selectionModel.handleMouseDown(node,e);break;case"mouseup":if(!info.expandIconClicked||!node.hasNodes())
this._selectionModel.handleMouseUp(node,e);break;case"click":this._selectionModel.handleClick(node,e);break;case"dblclick":if(node&&node.hasNodes()){node.toggle();if(node.getExpanded())
node._scrollSubtreeIntoView();}
else this._selectionModel.handleDblClick(node,e);break;}};_p._onKeyDown=function(e){var leadItem=this._selectionModel.getLeadItem();if(leadItem){switch(e.getKeyCode()){case BiKeyboardEvent.RIGHT:if(leadItem.hasNodes()){if(leadItem.getExpanded())
this._selectionModel.setLeadItem(leadItem.getFirstNode());else{leadItem.setExpanded(true);leadItem._scrollSubtreeIntoView();}}
break;case BiKeyboardEvent.LEFT:if(leadItem.hasNodes()&&leadItem.getExpanded())
leadItem.setExpanded(false);else{var p=leadItem.getParentNode();if(p==leadItem.getTree())
break;this._selectionModel.setLeadItem(p);}
break;}}
this._selectionModel.handleKeyDown(e);};_p.getExpanded=function(){return true;};_p.setExpanded=function(b){};_p.reveal=function(){};_p._sort=function(fCompare,bAscending){if(this.hasNodes()){for(var i=0;i<this._nodes.length;i++)
this._nodes[i]._sort(fCompare,bAscending);this._nodes.sort(fCompare);if(!bAscending)
this._nodes.reverse();}};_p.getRowAtPoint=function(nClientX,nClientY)
{return this.getNodeAtPoint(nClientX,nClientY);};_p.getNodeAtPoint=function(nClientX,nClientY)
{if(BiBrowserCheck.ie)
{var el=this._document.elementFromPoint(nClientX,nClientY);if(el==null)return null;var res=this._getMouseEventInfo(null,el);return res?res.treeNode:null;}
else {var y=nClientY-this.getClientTop()-this.getInsetTop();if(this._getFillerHeight()>=y)
return null;y=y-this._getFillerHeight()+this.getScrollTop();var rowIndex=Math.floor(y/this._rowHeight);var rows=[];this._getAllRows(this,rows);if(rowIndex>rows.length)
return null;return rows[rowIndex];}};_p._getAllRows=function(p,out)
{if(p.getExpanded())
{var cs=p.getNodes();for(var i=0;i<cs.length;i++)
{out.push(cs[i]);this._getAllRows(cs[i],out);}}};function BiTreeNode(oData){if(_biInPrototype)return;BiAbstractGridRow.call(this);this._nodes=[];this._data=oData||[];}
_p=_biExtend(BiTreeNode,BiAbstractGridRow,"BiTreeNode");_p._indentWidth=19;_p._expanded=true;_p._icon=BiTree.DEFAULT_ICON;_p.getData=function(x)
{return this._data[x];};_p.setData=function(x,oData)
{this._data[x]=oData;};_p.matchesString=function(sText){return sText!=""&&BiLabel.htmlToText(this.getCellHtml(0).toLowerCase()).
indexOf(sText.toLowerCase())==0;};_p.matchesStringExact=function(sText){return sText!=""&&BiLabel.htmlToText(this.getCellHtml(0)).toLowerCase()==String(sText).toLowerCase();};_p.getHtml=function(){var childrenHtml;if(this.hasNodes()){var childrenSb=[];var cs=this._nodes;var l=cs.length;for(var y=0;y<l;y++)
childrenSb[y]=cs[y].getHtml();childrenHtml="<div class=\"bi-tree-children\" style=\""+this._getLineStyle()+(this.getExpanded()?"":"display:none;")+"\">"+childrenSb.join("")+"</div>"}
else childrenHtml="";return"<div class=\"bi-tree-node\" id=\""+this.toHashCode()+"\">"+this.getRowHtml()+childrenHtml+"</div>";};_p.getRowHtml=function()
{var tree=this.getTree();var sb=[];var cols=tree._columns;var cox;for(var x=0;x<cols.length;x++)
{cox=tree._columnOrders[x];if(cols[cox].getVisible())
sb.push(this.getCellHtml(cox));}
return"<div class=\""+this.getCssClassName()+"\""+this._getStyle()+">"+sb.join("")+"</div>";};_p.getCssClassName=function(){return"bi-tree-row grid-row"+(this._selected?" grid-row-selected":"");};_p.getCellHtml=function(nCol){var t=this.getTree();return"<span class=\"bi-tree-cell grid-cell col-"+nCol+"\">"+(nCol==t.getIndentColumn()?this.getExpandIconHtml():"")+(nCol==t.getIconColumn()?this.getIconHtml():"")+this.getLabelHtml(nCol)+"</span>";};_p.getLabelHtml=function(nCol){return this._data[nCol];};_p.getIconHtml=function(){var i=this.getIcon();if(!i)return"";if(i.getIconHtml)
return i.getIconHtml(this.getLabelHtml()!="",true,"left",3,"bi-tree-icon");else return"<img alt=\"\" class=\"bi-tree-icon\" src=\""+i+"\">";};_p.getExpandIconSrc=function(){var src;var tree=this.getTree();if(this.hasNodes()){if(!tree.getShowLines()||this.getLevel()==1&&!tree.getShowRootLines()){if(!tree.getShowPlusMinus())
src="blank-icon";else if(this.getExpanded())
src="minus-icon";else src="plus-icon";}
else if(this.isLastSiblingNode()){if(!tree.getShowPlusMinus())
src="l-icon";else if(this.getExpanded())
src="l-minus-icon";else src="l-plus-icon";}
else{if(!tree.getShowPlusMinus())
src="t-icon";else if(this.getExpanded())
src="t-minus-icon";else src="t-plus-icon";}}
else{if(!this.getTree().getShowLines()||this.getLevel()==1&&!tree.getShowRootLines())
src="blank-icon";else if(this.isLastSiblingNode())
src="l-icon";else src="t-icon";}
return application.getThemeManager().getDefaultTheme().getAppearanceProperty("grid",src);};_p._getExpandIconSrc=function(s)
{};_p.getExpandIconHtml=function(){if(!this.getTree().getShowPlusMinus()&&!this.getTree().getShowLines())
return"";return"<img alt=\"\" class=\"bi-tree-expand-icon\" src=\""+this.getExpandIconSrc()+"\">";};_p._getLineStyle=function(){return!this._getShowChildrenLine()?"background-position: -100px 0 !important;":"";};_p._getShowChildrenLine=function(){var tree=this.getTree();return tree.getShowLines()&&!this.isLastSiblingNode()&&!(!tree.getShowRootLines()&&this.getLevel()==1);};_p.update=function(){BiAbstractGridRow.prototype.update.call(this);this.getTree()._updateHeadersWidth();};_p.updateRow=function(){if(!this.getCreated()||!this.getTree())return;if(BiBrowserCheck.ie)
this._element.firstChild.outerHTML=this.getRowHtml();else {var dummy=this.getTree()._document.createElement("DIV");dummy.innerHTML=this.getRowHtml();this._element.firstChild.parentNode.replaceChild(dummy.firstChild,this._element.firstChild);}
this.getTree()._clearCache();};_p.addNode=function(oChild,oBefore){var p=oChild._parentNode;if(oBefore==null){if(p!=null)
p.removeNode(oChild);this._nodes.push(oChild);}
else{if(oBefore._parentNode!=this)
throw new Error("Can only add components before siblings");if(p!=null)
p.removeNode(oChild);var i=this._nodes.indexOf(oBefore);this._nodes.insertAt(oChild,i);}
oChild._parentNode=this;if(this.getTree()){oChild._grid=this.getTree();oChild._grid._clearCache();}
if(this.getLevel()!=null)
oChild._level=this.getLevel()+1;};_p.removeNode=function(oChild){var i=this._nodes.indexOf(oChild);return this.removeNodeAt(i);};_p.removeNodeAt=function(i){var oChild=this._nodes[i];if(oChild._parentNode!=this)
throw new Error("Can only remove children");this._nodes.removeAt(i);oChild._parentNode=null;if(oChild._grid){oChild._grid._clearCache();}
oChild._grid=null;oChild._level=null;return oChild;};_p.removeAll=function(){for(var i=this.getNodes().length-1;i>=0;i--){this.removeNodeAt(i).dispose();}};BiTreeNode.prototype.getParentNode=function(){return this._parentNode;};_p.getNodes=function(){return this._nodes;};_p.containsNode=function(oDescendant){if(oDescendant==null)return false;if(oDescendant==this)return true;var p=oDescendant._parentNode;return this.containsNode(p);};_p.getFirstNode=function(){return this._nodes[0];};_p.getLastNode=function(){return this._nodes[this._nodes.length-1];};_p.getPreviousSiblingNode=function(){var p=this._parentNode;if(p==null)return null;var cs=p._nodes;return cs[cs.indexOf(this)-1]};_p.getNextSiblingNode=function(){var p=this._parentNode;if(p==null)return null;var cs=p._nodes;return cs[cs.indexOf(this)+1]};_p.getLevel=function(){if(this._level!=null)
return this._level;if(this._parentNode){var pd=this._parentNode.getLevel();return this._level=(pd!=null?pd+1:null);}
return null;};_p.hasNodes=function(){return this._nodes.length>0;};_p.isLeaf=function(){return!this.hasNodes();};_p.getGrid=function(){return	this.getTree();};_p.getTree=function(){if(this._grid)
return this._grid;if(this._parentNode)
return this._grid=this._parentNode.getTree();return null;};_p.getDepth=function(){var d=0;var cs=this._nodes;var l=cs.length;for(var i=0;i<l;i++)
d=Math.max(d,cs[i].getDepth()+1);return d;};_p.isLastSiblingNode=function(){return this._parentNode&&this==this._parentNode.getLastNode();};BiTreeNode.prototype.getExpanded=function(){return this._expanded;};_p.setExpanded=function(b){if(this._expanded!=b){if(!this.hasNodes()){this._expanded=false;return;}
this._expanded=b;if(this.getCreated()){var rowEl=this._element.firstChild;var childrenEl=this._element.lastChild;if(BiBrowserCheck.ie)
rowEl.outerHTML=this.getRowHtml();else {var dummy=rowEl.ownerDocument.createElement("DIV");dummy.innerHTML=this.getRowHtml();rowEl.parentNode.replaceChild(dummy.firstChild,rowEl);}
childrenEl.style.display=b?"":"none";}
var tree=this.getTree();if(tree){if(!b)
tree._selectionModel._collapseNode(this);tree._updateHeadersWidth();}}};_p.reveal=function(){var p=this.getParentNode()
if(p){p.setExpanded(true);p.reveal();}};_p.toggle=function(){this.setExpanded(!this.getExpanded());};_p._sort=function(fCompare,bAscending){if(this.hasNodes()){for(var i=0;i<this._nodes.length;i++)
this._nodes[i]._sort(fCompare,bAscending);this._nodes.sort(fCompare);if(!bAscending)
this._nodes.reverse();}};_p._getAllNodes=function(oHash){oHash[this.toHashCode()]=this;var cs=this._nodes;var l=cs.length;for(var i=0;i<l;i++)
cs[i]._getAllNodes(oHash);};_p.dispose=function(){if(this._disposed)return;for(var i=this._nodes.length-1;i>=0;i--)
this._nodes[i].dispose();this._element=null;this._grid=null;this._disposed=true;};_p._scrollSubtreeIntoView=function(){if(!this.getCreated()){return;}
var p=this.getGrid();if(!p)return;var t=this.getTop();var st=p.getScrollTop();var ch=p.getClientHeight();var fh=p._getFillerHeight();var last=BiTreeHelper.getLastShownDescendant(this);var lastTop=last.getTop();var lastHeight=last.getHeight();var h=lastTop+lastHeight-t;if(h>ch||t-fh<st)
p.setScrollTop(t-fh);else if(t+h>st+ch)
p.setScrollTop(t+h-ch);};function BiTreeHelper(){if(_biInPrototype)return;BiObject.call(this);}
_p=_biExtend(BiTreeHelper,BiObject,"BiTreeHelper");BiTreeHelper.getLastShownDescendant=function(n){if(!n.getExpanded()||n.isLeaf())
return n;return BiTreeHelper.getLastShownDescendant(n.getLastNode());};BiTreeHelper.getNextShownNode=function(n){var cs=n.getNodes();if(cs.length>0&&n.getExpanded())
return cs[0];else{var p=n;var next;while(p!=null){next=p.getNextSiblingNode();if(next!=null)
return next;p=p.getParentNode();}
return null;}};BiTreeHelper.getPreviousShownNode=function(n){var ps=n.getPreviousSiblingNode();if(ps!=null){return BiTreeHelper.getLastShownDescendant(ps);}
var p=n.getParentNode();return p!=n.getTree()?n.getParentNode():null;};BiTreeHelper.getPreorderShownNodes=function(n){var res=[];BiTreeHelper._getPreorderShownNodes(n,res);return res;};BiTreeHelper._getPreorderShownNodes=function(n,arr){if(n!=n.getTree())

⌨️ 快捷键说明

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