(function(){var k=function(){var a=zk.feature.pe;return function(){return a&&zk.isLoaded("zkex.grid")}}();zul.grid.Row=zk.$extends(zul.Widget,{$define:{align:function(a){var b=this.$n();b&&(b.align=a)},nowrap:function(a){var b=this.$n();if(b&&(b=b.cells))for(var c=b.length;c--;)b[c].noWrap=a},valign:function(a){var b=this.$n();b&&(b.vAlign=a)}},getGrid:function(){return this.parent?this.parent.parent:null},setVisible:function(a){this.isVisible()!=a&&(this.$supers("setVisible",arguments),this.desktop&&
this.isStripeable_()&&this.parent._syncStripe())},getSpans:function(){return zUtl.intsToString(this._spans)},setSpans:function(a){this.getSpans()!=a&&(this._spans=zUtl.stringToInts(a,1),this.rerender())},_getIndex:function(){return this.parent?this.getChildIndex():-1},getGroup:function(){if(k()&&this.parent&&this.parent.hasGroup())for(var a=this;a;a=a.previousSibling)if(a.$instanceof(zkex.grid.Group))return a;return null},setStyle:function(a){this._style!=a&&(zk._rowTime||(zk._rowTime=jq.now()),this._style=
a,this.rerender())},rerender:function(){this.desktop&&(this.$supers("rerender",arguments),this.parent&&this.parent._syncStripe())},getSclass:function(){var a=this.$supers("getSclass",arguments);if(null!=a)return a;var b=this.getGrid();return b?b.getSclass():a},_getChdextr:function(a){return a.$n("chdextr")||a.$n()},scrollIntoView:function(){var a=this.getGrid()._scrollbar;a?(a.syncSize(),a.scrollToElement(this.$n())):this.$supers("scrollIntoView",arguments)},insertChildHTML_:function(a,b,c){var d=
this.encloseChildHTML_({child:a,index:a.getChildIndex(),zclass:this.getZclass()});b?jq(this._getChdextr(b)).before(d):jq(this).append(d);a.bind(c)},removeChildHTML_:function(a){this.$supers("removeChildHTML_",arguments);jq(a.uuid+"-chdextr",zk).remove()},encloseChildHTML_:function(a){var b=a.out||new zk.Buffer,c=a.child,d=c.$instanceof(zul.wgt.Cell);d?c._headerVisible=a.visible:b.push('<td id="',c.uuid,'-chdextr"',this._childAttrs(c,a.index),'><div id="',c.uuid,'-cell" class="',a.zclass,'-content">');
c.redraw(b);d||b.push("</div></td>");if(!a.out)return b.join("")},_childAttrs:function(a,b){var c=b,d=1;if(this._spans)for(var e=0,h=this._spans.length;e<h;++e){if(e==b){d=this._spans[e];break}c+=this._spans[e]-1}if((b=this.getGrid())&&(b=b.columns)&&c<b.nChildren){var f=b.getChildAt(c);var k=f.isVisible();var g=f.getHeight();var l=f.getAlign();f=f.getValign()}c=this.domStyle_({visible:1,width:1,height:1});(b=zk.isLoaded("zkex.grid")&&a.$instanceof(zkex.grid.Detail))&&(e=a.getWidth())&&(c+="width:"+
e+";");if(g||l||f)g&&(c+="height:"+g+";"),l&&(c+="text-align:"+l+";"),f&&(c+="vertical-align:"+f+";");a=b?a.$s("outer"):this.$s("inner");g="";1!==d&&(g+=' colspan="'+d+'"');this._nowrap&&(g+=' nowrap="nowrap"');c&&(g+=' style="'+c+'"');!1===k&&(a+=" "+this.$s("hidden-column"));return g+' class="'+a+'"'},isStripeable_:function(){return!0},domStyle_:function(a){if(k()&&(this.$instanceof(zkex.grid.Group)||this.$instanceof(zkex.grid.Groupfoot))||a&&a.visible)return this.$supers("domStyle_",arguments);
var b=this.$supers("domStyle_",arguments),c=this.getGroup();this._align&&(b+=" text-align:"+this._align+";");this._valign&&(b+=" vertical-align:"+this._valign+";");return c&&!c.isOpen()?b+"display:none;":b},onChildAdded_:function(a){this.$supers("onChildAdded_",arguments);a.$instanceof(zul.grid.Detail)&&(this.detail=a)},onChildRemoved_:function(a){this.$supers("onChildRemoved_",arguments);a==this.detail&&(this.detail=null)},doFocus_:function(a){this.$supers("doFocus_",arguments);var b=this.getGrid(),
c=b?b.frozen:null,d=b&&b.rows?b.rows.$n():null;if(c&&d){var e=jq(a.domTarget).parents("td");for(var h=0,f=e.length;h<f;h++)if(c=e[h],c.parentNode.parentNode==d){b._moveToHidingFocusCell(c.cellIndex);break}}},doMouseOver_:function(a){if(!this._musin){this._musin=!0;var b=this.$n();b&&zk.gecko&&this._draggable&&!jq.nodeName(a.domTarget,"input","textarea")&&jq(b).addClass("z-draggable-over");this.$supers("doMouseOver_",arguments)}},doMouseOut_:function(a){var b=this.$n();this._musin&&jq.isAncestor(b,
a.domEvent.relatedTarget||a.domEvent.toElement)?this.parent._musout=this:(this._musin=!1,b&&zk.gecko&&this._draggable&&!jq.nodeName(a.domTarget,"input","textarea")&&jq(b).removeClass("z-draggable-over"),this.$supers("doMouseOut_",arguments))},domClass_:function(){var a=this.$supers("domClass_",arguments),b=this.getGrid();return b&&jq(this.$n()).hasClass(b=b.getOddRowSclass())?a+" "+b:a},deferRedrawHTML_:function(a){a.push("<tr",this.domAttrs_({domClass:1}),' class="z-renderdefer"></tr>')}})})();
