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

📄 column.js

📁 DWR is the way for AJAX implementation
💻 JS
字号:
/* * Copyright (c) 2001-2007, TIBCO Software Inc. * Use, modification, and distribution subject to terms of license. */jsx3.require("jsx3.gui.Block");jsx3.Class.defineClass("jsx3.gui.Matrix.Column",jsx3.gui.Block,null,function(o,c){var Ac=jsx3.util.Logger.getLogger(o.jsxclass.getName());var Lc=jsx3.gui.Event;o.DEFAULT_WIDTH=100;o.TYPE_TEXT="text";o.TYPE_NUMBER="number";o.DEFAULT_VALIGN="top";o.TEMPLATES={};o.TEMPLATES["default"]="<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:param name=\"jsx_row_number\"/>\n  <xsl:if test=\"@jsxcellstyle\">\n    <xsl:attribute name=\"style\"><xsl:value-of select=\"@jsxcellstyle\"/></xsl:attribute>\n  </xsl:if>\n  <xsl:value-of select=\"{0}\"/>&#160;\n</xsl:template>";o.TEMPLATES["empty"]="<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"></xsl:template>";o.TEMPLATES["unescape"]="<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:param name=\"jsx_row_number\"/>\n  <xsl:if test=\"@jsxcellstyle\">\n    <xsl:attribute name=\"style\"><xsl:value-of select=\"@jsxcellstyle\"/></xsl:attribute>\n  </xsl:if>\n  <xsl:value-of select=\"{0}\" disable-output-escaping=\"yes\"/>&#160;\n</xsl:template>";o.TEMPLATES["image"]="<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:if test=\"@jsxcellstyle\">\n    <xsl:attribute name=\"style\"><xsl:value-of select=\"@jsxcellstyle\"/></xsl:attribute>\n  </xsl:if>\n  <xsl:if test=\"{0} and not ({0} = '')\"><img style=\"position:relative;\" unselectable=\"on\">\n    <xsl:attribute name=\"src\"><xsl:apply-templates select=\"{0}\" mode=\"uri-resolver\"/></xsl:attribute>\n  </img></xsl:if>\n</xsl:template>";c.init=function(b){this.jsxsuper(b);};c.getValueTemplate=function(l){if(this.jsxvaluetemplate!=null){if(this.jsxvaluetemplate.charAt(0)=="@"){var x=o.TEMPLATES[this.jsxvaluetemplate.substring(1)];if(x){return x;}else{Ac.error("The following value template type is not supported: "+this.jsxvaluetemplate);}}else{if(this.jsxvaluetemplate.trim().indexOf("<xsl:template")==0){return this.jsxvaluetemplate;}}}if(l!=null)return l;};c.setValueTemplate=function(e){this.jsxvaluetemplate=e;this.Wg();};c.getResizable=function(){return this.jsxresize;};c.setResizable=function(q){this.jsxresize=q;this.qg();};c.getTriggers=function(){return this.jsxtriggers;};c.setTriggers=function(k){this.jsxtriggers=k;};c.getPath=function(){return this.jsxpath==null?"jsxid":this.jsxpath;};c.setPath=function(j,e){this.jsxpath=j;this.Wg();if(!e&&this.getParent())this.getParent().repaint();};c.getSortPath=function(){return this.jsxsortpath!=null?this.jsxsortpath:this.getPath();};c.setSortPath=function(j){this.jsxsortpath=j;};c.getDataType=function(){return this.jsxdatatype==null?o.TYPE_TEXT:this.jsxdatatype;};c.setDataType=function(p){this.jsxdatatype=p;};c.getSortDataType=function(){return this.jsxsortdatatype==null?this.getDataType():this.jsxsortdatatype;};c.setSortDataType=function(q){this.jsxsortdatatype=q;};c.getCanSort=function(){return this.jsxsort;};c.setCanSort=function(m){this.jsxsort=m;this.qg();};c.setFormatHandler=function(i){if(typeof(i)=="function"){this._jsxwk=new jsx3.gui.Matrix.ColumnFormat();this._jsxwk.format=i;}else{if(i&&typeof(i)=="object"&&typeof(i.format)=="function"){this._jsxwk=i;}else{delete this._jsxwk;this.jsxformathandler=i!=null?i+"":null;}}};c.getFormatHandler=function(){return this.jsxformathandler;};c.Nm=function(){if(typeof(this._jsxwk)=="undefined"){if(this.jsxformathandler){this._jsxwk=jsx3.gui.Matrix.ColumnFormat.getInstance(this.jsxformathandler,this);if(this._jsxwk==null){try{var fb=this.eval("var fn = "+this.jsxformathandler+"; fn;");if(typeof(fb)=="object"&&typeof(fb.format)=="function"&&typeof(fb.validate)=="function"){this._jsxwk=fb;}else{if(typeof(fb)=="function"){this._jsxwk=new jsx3.gui.Matrix.ColumnFormat();this._jsxwk.format=fb;}else{Ac.error("There is a signature/type error when evaluating the format handler: "+this.jsxformathandler);}}}catch(Kc){Ac.error("Error evaluating the format handler string: "+this.jsxformathandler,jsx3.NativeError.wrap(Kc));}}}else{this._jsxwk=null;}}return this._jsxwk;};c.k7=function(b,r,p){var A=this.RL(true,b);A.recalculate(b,null,p);var gc=this.getParent();var Ab=A.pQ(0);Ab.recalculate({height:A.P5()},null,p);var E=A.pQ(1);var wc={parentwidth:b.parentwidth};if(this.Wr()){var Mc=gc.getRowHeight(jsx3.gui.Matrix.DEFAULT_ROW_HEIGHT);wc.height=Mc?Mc:jsx3.gui.Matrix.DEFAULT_ROW_HEIGHT;}E.recalculate(wc,null,p);if(this.Wr()){var kb=E.pQ(0);kb.recalculate({height:E.P5()},null,p);}if(!p.isPositional()){var pb=gc.mC();if(pb&&pb._jsx_matrix_configured){var Cc=pb.selectSingleNode("//xsl:template[@name='"+this.getId()+"']/xsl:param[@name='jsx_cell_width']");if(Cc)Cc.setAttribute("select","'"+E.KZ()+"'");}}};c.T5=function(h){this.applyDynamicProperties();var Bb=this.getParent();if(Bb&&(h==null||isNaN(h.parentwidth)||isNaN(h.parentheight))){h=Bb.IO(this);}else{if(h==null){h={};}}h.width="100%";h.height="100%";h.boxtype="inline";h.tagname="td";var Ab,B;if((Ab=this.getBorder())!=null&&Ab!="")h.border=Ab;if((B=this.getPadding())!=null&&B!="")h.padding=B;var T=new jsx3.gui.Painted.Box(h);var N={};N.height=T.P5();N.boxtype="inline";N.tagname="div";var hb=new jsx3.gui.Painted.Box(N);T.W8(hb);var Mb={};if(this.Wr()){var ib=Bb.getRowHeight(jsx3.gui.Matrix.DEFAULT_ROW_HEIGHT);Mb.height=ib?ib:jsx3.gui.Matrix.DEFAULT_ROW_HEIGHT;}Mb.width="100%";Mb.boxtype="inline";Mb.tagname="td";Mb.parentwidth=h.parentwidth;if((Ab=this.getCellBorder())!=null&&Ab!="")Mb.border=Ab;if((B=this.getCellPadding())!=null&&B!="")Mb.padding=B;var Cb=new jsx3.gui.Painted.Box(Mb);T.W8(Cb);var zc={};if(this.Wr())zc.height=Cb.P5();zc.boxtype="inline";zc.tagname="div";var Dc=new jsx3.gui.Painted.Box(zc);Cb.W8(Dc);return T;};c.Wr=function(){var xc=this.getParent();if(xc){if(xc.getPagingModel()==jsx3.gui.Matrix.PAGING_PAGED)return true;return xc.getRowHeight()!=0;}return true;};c.paint=function(){this.applyDynamicProperties();var Hc=this.getParent();var cb=this.RL(true);cb.setAttributes("id=\""+this.getId()+"\" unselectable=\"on\" "+this.vH()+Hc.RX(jsx3.gui.Event.MOUSEDOWN,"Ik")+Hc.RX(jsx3.gui.Event.CLICK,"UG"));cb.setStyles(this.I6()+this.UZ()+this.K2()+this.QP()+this.D6()+this.eQ()+this.paintVAlign());var Ub=cb.pQ(0);Ub.setAttributes("class=\"jsx30matrixcolumn_value\" unselectable=\"on\"");Ub.setStyles(this.paintWrap()+this.oY()+this.g0()+this.Gf());return cb.paint().join(Ub.paint().join(this.AN()));};c.repaint=function(){this.qg();};c.Gf=function(){if(this.getSortPath()==this.getParent().getSortPath()){return "background-image:url("+(this.getParent().getSortDirection()==jsx3.gui.Matrix.SORT_ASCENDING?jsx3.gui.Matrix.SORT_ASCENDING_IMG:jsx3.gui.Matrix.SORT_DESCENDING_IMG)+");";}return "";};c._applySortIcon=function(i){this.getRendered().childNodes[0].style.backgroundImage=i?"url("+(this.getParent().getSortDirection()==jsx3.gui.Matrix.SORT_ASCENDING?jsx3.gui.Matrix.SORT_ASCENDING_IMG:jsx3.gui.Matrix.SORT_DESCENDING_IMG)+")":"";};c.Wi=function(){return "<colgroup style=\""+this.a7()+"\"></colgroup>";};c.setWidth=function(p,s){this.jsxwidth=p;var Db=this.getParent();if(Db)Db.nW(Db.getParent().IO(Db),s);};c.setDisplay=function(e,g){this.jsxdisplay=e;var Bb=this.getParent();if(Bb){Bb.Wc();if(g)Bb.repaint();}return this;};c.getDisplayIndex=function(){var Nb=this.getParent();if(Nb){var Jc=Nb.pi();for(var uc=0;uc<Jc.length;uc++){if(Jc[uc]==this)return uc;}}};c.a7=function(){return this.getCellBackgroundColor()?"background-color:"+this.getCellBackgroundColor()+";":"{$jsx_rowbg}";};c.CM=function(){return this.getCellBorder()?this.getCellBorder()+";":"";};c.jW=function(){return this.getCellColor()?"color:"+this.getCellColor()+";":";";};c.q6=function(){return this.getCellCursor()?"cursor:"+this.getCellCursor()+";":"";};c.jP=function(){if(!this.getCellFontName())return "";return "font-family:"+(this.getCellFontName()?this.getCellFontName():jsx3.gui.Block.DEFAULTFONTNAME)+";";};c.bR=function(){if(!this.getCellFontSize())return "";return "font-size:"+(this.getCellFontSize()?this.getCellFontSize():jsx3.gui.Block.DEFAULTFONTSIZE)+"px;";};c.N_=function(){return this.getCellFontWeight()?"font-weight:"+this.getCellFontWeight()+";":"";};c.paintWrap=function(){return this.getWrap(jsx3.Boolean.FALSE)==jsx3.Boolean.FALSE?"white-space:nowrap;overflow:hidden;":"";};c.KY=function(){return this.getCellWrap(jsx3.Boolean.FALSE)==jsx3.Boolean.FALSE?"white-space:nowrap;overflow:hidden;":"";};c.c_=function(){return "text-align:"+(this.getCellTextAlign()?this.getCellTextAlign():jsx3.gui.Block.ALIGNLEFT)+";";};c.paintVAlign=function(){return "vertical-align:"+(this.getVAlign()?this.getVAlign():o.DEFAULT_VALIGN)+";";};c.T8=function(){return "vertical-align:"+(this.getCellVAlign()?this.getCellVAlign():o.DEFAULT_VALIGN)+";";};c.getCellBackgroundColor=function(){return this.jsxcellbgcolor;};c.setCellBackgroundColor=function(s){this.jsxcellbgcolor=s;this.Wg();};c.getCellBorder=function(){return this.jsxcellborder;};c.setCellBorder=function(f,l){this.jsxcellborder=f;this.Wg();if(!l&&this.getParent())this.getParent().repaint();};c.getCellColor=function(){return this.jsxcellcolor;};c.setCellColor=function(a){this.jsxcellcolor=a;this.Wg();};c.getCellCursor=function(){return this.jsxcellcursor;};c.setCellCursor=function(l){this.jsxcellcursor=l;this.Wg();};c.getCellFontName=function(){return this.jsxcellfontname;};c.setCellFontName=function(n){this.jsxcellfontname=n;this.Wg();};c.getCellFontSize=function(){return this.jsxcellfontsize;};c.setCellFontSize=function(l){this.jsxcellfontsize=l;this.Wg();};c.getCellFontWeight=function(){return this.jsxcellfontweight;};c.setCellFontWeight=function(l){this.jsxcellfontweight=l;this.Wg();};c.getCellPadding=function(){return this.jsxcellpadding;};c.setCellPadding=function(r,s){this.jsxcellpadding=r;this.Wg();if(!s&&this.getParent())this.getParent().repaint();};c.getCellTextAlign=function(){return this.jsxcelltextalign;};c.setCellTextAlign=function(p){this.jsxcelltextalign=p;this.Wg();};c.getCellVAlign=function(){return this.jsxcellvalign;};c.setCellVAlign=function(j){this.jsxcellvalign=j;this.Wg();};c.getCellWrap=function(l){return this.jsxcellwrap!=null?this.jsxcellwrap:l!=null?l:null;};c.setCellWrap=function(e){this.jsxcellwrap=e;this.Wg();};c.setBorder=function(s){this.jsxborder=s;this.vQ();this.qg();};c.setPadding=function(h){this.jsxpadding=h;this.vQ();this.qg();};c.getWrap=function(h){return this.jsxwrap!=null?this.jsxwrap:h!=null?h:null;};c.setWrap=function(e){this.jsxwrap=e;this.qg();};c.getVAlign=function(){return this.jsxvalign;};c.setVAlign=function(j){this.jsxvalign=j;this.qg();};c.setText=function(p,g){this.jsxtext=p;var pb;if(g&&(pb=this.getRendered())!=null)pb.childNodes[0].innerHTML=p;return this;};c.paintChild=function(i){};c.getEditMask=function(){return this.getChild(0);};c.getEditMasks=function(){return this.getChildren();};c.getValueForRecord=function(i){var zb=this.getParent().getRecordNode(i);if(zb)return zb.getAttribute(this.getPath());else{if(i=="jsxautorow")return this.getParent().getAutoRowSession()[this.getPath()];}};c.setValueForRecord=function(f,q){var wc=this.getParent().getRecordNode(f);if(wc)wc.setAttribute(this.getPath(),q);else{if(f=="jsxautorow")this.getParent().getAutoRowSession()[this.getPath()]=q;}};c.onSetParent=function(b){return jsx3.gui.Matrix&&b instanceof jsx3.gui.Matrix;};c.Wg=function(){var vc=this.getParent();if(vc)vc.Wc();};c.qg=function(){var S=this.getParent();if(S)S.repaintHead();};});jsx3.gui.MatrixColumn=jsx3.gui.Matrix.Column;

⌨️ 快捷键说明

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