AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlTableBasePeer",!1);
AdfDhtmlTableBasePeer.InitSubclass=function(){AdfRichUIPeer.addDomEventHandlers(this,AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE,AdfDhtmlLookAndFeel.KEY_DOWN_EVENT_TYPE,AdfDhtmlLookAndFeel.MOUSE_MOVE_EVENT_TYPE);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.MOUSE_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfComponentEvent.FOCUS_EVENT_TYPE,AdfComponentEvent.BLUR_EVENT_TYPE,AdfUIInputEvent.DOUBLE_CLICK_EVENT_TYPE,
AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE,AdfValueChangeEvent.VALUE_CHANGE_TYPE);AdfRichUIPeer.addComponentPropertyChanges(this,"selectedRowKeys","disclosedRowKeys","scrollTop","scrollLeft","activeRowKey");AdfRichUIPeer.addSuppressedPPRAttributes(this,"first");AdfRichUIPeer.addSuppressedPPRAttributes(this,"rows");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollTop");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollLeft");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollTopRowKey");AdfRichUIPeer.addSuppressedPPRAttributes(this,
"activeRowKey");this._SEL_UPDATE_ALL_SELECT=0;this._SEL_UPDATE_ALL_UNSELECT=1;this._SEL_UPDATE_ALL_UPDATE=2;this.AUTO_PPR_UPDATE_BLOCK=0;this.AUTO_PPR_INSERT_BEFORE_BLOCK=1;this.AUTO_PPR_INSERT_AFTER_BLOCK=2;this.AUTO_PPR_REMOVE_BLOCK=3;this.AUTO_PPR_FETCH_ID=-99;this.SCROLL_SUCCEEDED=0;this.SCROLL_INDEX_NOT_FOUND=1;this.SCROLL_CANCELLED=2;this.MISSING_AFTER=1;this.MISSING_BEFORE=2;this.NO_BLOCKS=4;this.VIEWPORT_SATISFIED=0;this.NO_SCROLL=-1;this.DW_SUB_ID="dataW";this._CELL_TEXT_KEY="_afrCTK";this._ROW_KEY=
"_afrRK";this._ROW_HEADER="_afrRH";this._LEAF_COLUMN="_afrLeaf";this._ROOT_COLUMN="_afrRoot";this._FILTER_COLUMN="_afrFilterCol";this._PANEL_COLLECTION_ID="_afrPCId";this._SELECT_ALL="_afrSelAll";this._COL_COUNT="_afrColCount";this._FILTERABLE="_afrFilterable";this.__SORT_INDICATOR="afrSI";this._SORT_ASCENDING="_afrSortAsc";this._SORT_DESCENDING="_afrSortDesc";this._SORTED_TYPE="_afrSorted";AdfDhtmlTableBasePeer._REMAIN_READ_ONLY="_afrRemainReadOnly";this._SORTED_ASCENDING="1";this._SORTED_DESCENDING=
"2";this._SUPPORTS_HOVER="_afrHoverable";this.SELECTALL_KEY_PROPERTY="afrSelectAll";this._SELECTED_CLASS="p_AFSelected";this._INACTIVE_CLASS="p_AFInactive";this._DROP_TARGET_CLASS="p_AFDropTarget";this._HIGHLIGHTED_CLASS="p_AFHighlighted";this._FOCUSED_CLASS="p_AFFocused";this._AUTOSCROLL_MARGIN=40;this._HSCROLLER=0;this._VSCROLLER=1;this._SELECTION_SINGLE="single";this._SELECTION_MULTIPLE="multiple";this._SELECTION_MULTIPLE_NOSELECTALL="multipleNoSelectAll";this._SELECTION_NONE="none";this._EDIT_MODE_CLICKTOEDIT=
"clickToEdit";this._MAXIMUM_ROW_REVEAL=8;this._SELECT_PAGE_UP=1;this._SELECT_PAGE_DOWN=2;this._SELECT_ARROW_UP=3;this._SELECT_ARROW_DOWN=4;this._FOCUS_RH_ARROW_UP=5;this._FOCUS_RH_ARROW_DOWN=6;this._FOCUS_ROW_ARROW_UP=7;this._FOCUS_ROW_ARROW_DOWN=8;this._ROW_HEADER_FOCUS_TYPE=0;this._COLUMN_HEADER_FOCUS_TYPE=1;this._TABLE_BODY_FOCUS_TYPE=2;this._SELECT_ALL_FOCUS_TYPE=3;this._FILTER_CELL_FOCUS_TYPE=4;this._FETCH_MORE_CANVAS_SPACE=25;this._INPUT_REGEXP=/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/;this._TWINKLE_ON_STYLE_CLASS=
"p_AFTwinkleOn";this._TWINKLE_OFF_STYLE_CLASS="p_AFTwinkleOff";AdfDhtmlTableBasePeer._TWINKLE_TIMER_ID_ATTR="__afrTwinkleTimer";this._ICON_STYLE_EXPANDED="af|table::disclosed-icon-style";this._ICON_STYLE_COLLAPSED="af|table::undisclosed-icon-style";this._ICON_EXPANDED="af|table::disclosed-icon";this._ICON_COLLAPSED="af|table::undisclosed-icon";this._EXPANDED_NODE_KEY="af_table.TIP_EXPANDED_NODE";this._COLLAPSED_NODE_KEY="af_table.TIP_COLLAPSED_NODE";this._DETAIL_COLUMN_MARKER="_afrDetCol";this._DETAIL_ROW_MARKER=
"_afrDetRow";this._HAS_DETAIL_MARKER="_hasDetail";this.NEEDS_REFRESH_ATTRIBUTE="_afrNdsRfr";this.UNDO_FETCH_ATTRIBUTE="_afrUndFch";this.NO_RESIZE_MARKER="_noRsz";this._AUTO_HEIGHT_ROWS="_afrAutoHR";this._MAX_ROWHEADER_MSGTYPE_EXPANDO="_afrMRMT";this._CSS_HEIGHT_LIMIT=5E5;this._NAVBAR_FIRST="nb_fr";this._NAVBAR_PREVIOUS="nb_pv";this._NAVBAR_NEXT="nb_nx";this._NAVBAR_LAST="nb_ls";this._NAVBAR_PAGE="nb_pg";this._NAVBAR_PAGE_CNT="nb_cnt_pg";this._NAVBAR_PAGE_INPUT="nb_in_pg";this._NAVBAR_RANGE_TEXT="nb_rng";
this.RERENDER_SELF="RERENDER_SELF";this.RERENDER_CELL="RERENDER_CELL";this.RERENDER_ROW="RERENDER_ROW";this.RERENDER_CONTAINER_CHILDREN="RERENDER_CONTAINER_CHILDREN";this.RERENDER_CONTAINER="RERENDER_CONTAINER";this._RERENDER_PRIORITY={RERENDER_SELF:0,RERENDER_CELL:1,RERENDER_ROW:2,RERENDER_CONTAINER_CHILDREN:3,RERENDER_CONTAINER:4};this._DEFAULT_MAX_CACHED_ROWS_FOR_TOUCH=300;this._MAX_CACHED_ROWS_FOR_TOUCH="_afrMaxTouchRows";this._DATAWRAPPER="dbw";this._SCROLLBAR_BEHAVIOR="_afrScrollBarBehavior";
this._SCROLLBAR_BEHAVIOR_OVERLAY="overlay";this._IMPLICIT_LOAD_MORE="_afrImpldm";this._LOAD_MORE_TOP_DIV="ldmrtp";this._LOAD_MORE_TOP_LINK="ldmrtplnk";this._LOAD_MORE_BOTTOM_DIV="ldmrbttm";this._LOAD_MORE_BOTTOM_LINK="ldmrbttmlnk";this._LOAD_INDEX_ATTR="data-afrldIndx";this._LOAD_MORE_RNG_TOP_TEXT="ldmrrngtptxt";this._LOAD_MORE_RNG_BOTTOM_TEXT="ldmrrngbttmtxt";this._SCROLLER_ANIMATION_CLASS="af|table::scroll-container";this._HIDDEN_WIDTH_DOM_WHEN_STRETCHED_ID="_afrHwdwsId"};
AdfDhtmlTableBasePeer.prototype.InitDomElement=function(a,b){var d=AdfPage.PAGE,e=AdfAgent.AGENT;AdfDhtmlTableBasePeer.superclass.InitDomElement.call(this,a,b);AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,b,AdfDhtmlLookAndFeel.MOUSE_MOVE_EVENT_TYPE);AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,b,AdfDhtmlLookAndFeel.KEY_DOWN_EVENT_TYPE);this._autoHeightRows=e.getIntAttribute(b,AdfDhtmlTableBasePeer._AUTO_HEIGHT_ROWS,0);var f=this.GetDataBody(b);this._colCount=
f?e.getIntAttribute(f,AdfDhtmlTableBasePeer._COL_COUNT,0):0;this._colSelEventSelectedColIds={};this._colSelEventUnselectedColIds={};this._supportsFocusRowNavigation=this.SupportsFocusRowNavigation(a);this._contextMenuSelect=a.getContextMenuSelect();if(!a.getColumnResizing||"enabled"==a.getColumnResizing())this._colResizeDragCallback=this.createCallback(this._handleColResizeDrag),this._colResizeDropCallback=this.createCallback(this._handleColResizeDrop);a.getColumnStretching&&(this._columnStretching=
f=a.getColumnStretching(),"blank"==f?this._stretchedColumnId="_afrBlankColumn":0==f.indexOf("column:")&&(this._stretchedColumnId=f.substring(7)));this._editableTableReadOnlyMode=!1;this._hoverHighlightRow=this._isRowSelectionEnabled(a)&&"false"!=d.getLookAndFeel().getSkinProperty("af|table-tr-hover-highlight-row");this._activeDataCount=-1;this._fetchId=0;this._lastColWidth=this._lastColWidthOverride=this._unavailableRowIndex=-1;this._associatedId=a.getProperty("_afrMasterId");null==this._associatedId&&
(this._associatedId=a.getProperty("_afrSlaveId"));this._focusManager={};this._streamingDisabled=d.isStreamingDisabled();this._isTouch=e.isTouchFirstDevice();this._maxCachedRowsForTouch=null!=a.getProperty(AdfDhtmlTableBasePeer._MAX_CACHED_ROWS_FOR_TOUCH)?a.getProperty(AdfDhtmlTableBasePeer._MAX_CACHED_ROWS_FOR_TOUCH):AdfDhtmlTableBasePeer._DEFAULT_MAX_CACHED_ROWS_FOR_TOUCH;e.getOS()==AdfAgent.MAC_OS?this._scrollbarBehavior=null:this._scrollbarBehavior=a.getProperty(AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR);
this._hShiftLoadMoreDataBody=this._hShiftDataBody="0px";this._insertDeleteAnimationInEffect=!1;"loadMore"==a.getProperty("scrollPolicy")&&(this._isLoadMore=!0);if(this._isImplicitLoadMore=a.getProperty(AdfDhtmlTableBasePeer._IMPLICIT_LOAD_MORE))this._isLoadMore=!0;this._disableRowMouseDownCellFocus=a.getProperty("_disableRowMouseDownCellFocus");this._isSyncRows=a.getProperty("_afrSyncRows");this._twinkledCells=[];this._twinkledCellAnnouncements="";this._avoidSettingFocusOnColumnHeader=!1;AdfPage.PAGE.__registerDescendantResizeNotifyComponent(a)};
AdfDhtmlTableBasePeer.prototype.isDragAvailable=function(a){AdfAssert.assertDomElement(a);if(a){var b=this._isTargetCellEditable(a),d=null!=this._getTargetRowHeader(a);a=this._isTargetTextOnlyNode(a);if(d||b||a)return!1}return!0};AdfDhtmlTableBasePeer.prototype.TruncateClientId=function(a,b,d,e){b=d.split(":");a=a.getClientId();a=AdfStrings.count(a,":")+1;(b=b[a])&&(isNaN(b)||e.push(a))};
AdfDhtmlTableBasePeer.prototype.ComponentRemoved=function(a){this._touchMoveManager&&this._touchMoveManager.unregister();if(this._handleTouchEndCallback){var b=AdfAgent.AGENT,d=this.GetDataBody();d&&b.removeBubbleEventListener(d,"touchend",this._handleTouchEndCallback);(d=this.__getColumnHeader())&&b.removeBubbleEventListener(d,"touchend",this._handleTouchEndCallback)}AdfPage.PAGE.__unregisterDescendantResizeNotifyComponent(a);AdfDhtmlTableBasePeer.superclass.ComponentRemoved.call(this,a)};
AdfDhtmlTableBasePeer.prototype.needsChildVisibilityChanges=function(a){return!0};AdfDhtmlTableBasePeer.prototype.ChildVisibilityChanged=function(a,b,d){AdfPage.PAGE.addPartialTargets(this.getComponent());return!0};AdfDhtmlTableBasePeer.prototype.SupportsFocusRowNavigation=function(){return!0};AdfDhtmlTableBasePeer.prototype.AllowCellNavigation=function(){return 0<this.getDomElement().id.indexOf("_afrDropDownContent")?!1:!0};AdfDhtmlTableBasePeer.prototype.needsResizeNotify=function(a){return!0};
AdfDhtmlTableBasePeer.prototype.GetPanelCollectionPeer=function(a){if(!this._pcPeer&&(a=null,a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID),null!=a&&(a=AdfPage.PAGE.findComponent(a))))this._pcPeer=a.getPeer();return this._pcPeer};AdfDhtmlTableBasePeer.prototype.GetPanelCollectionComponent=function(){if(!this._pcComponent){var a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID);null!=a&&(this._pcComponent=AdfPage.PAGE.findComponent(a))}return this._pcComponent};
AdfDhtmlTableBasePeer.prototype._allRowsAvailableOnClient=function(a,b){var d=!1;if(0<b)var d=a[0],e=a[b-1],e=e.startRow+e.numRows,f=this.GetRowCount(),d=0<f&&0==d.startRow&&e==f;return d};AdfDhtmlTableBasePeer.prototype._updateScrollDivHeight=function(a){if(a){a=a.childNodes;var b=a.length;1===b&&this._allRowsAvailableOnClient(a,b)&&(a=a[0].offsetHeight,a>this._canvasHeight&&(this._canvasHeight=a,this._setFakeCanvasHeight(a)))}};
AdfDhtmlTableBasePeer.prototype.ResizeNotify=function(a,b,d,e){if(this.BusyAnimating()){var f=this;this.delayedResizeNotify=function(){f.ResizeNotify(a,b,d,e)}}else{delete this._cachedFirstVisibleRowKeyAndRow;var g=AdfAgent.AGENT,h=this.getComponent(),h=h.getClientId();if(g=g.getElementById(AdfRichUIPeer.CreateSubId(h,AdfDhtmlTableBasePeer._HIDDEN_WIDTH_DOM_WHEN_STRETCHED_ID)))g.style.width=d+"px";if(this._virtInitialized){g=AdfAgent.AGENT;g=this.GetDataBody();this.isHeightAutoSized()?this.AdjustAutoHeight():
(this._updateScrollDivHeight(g),this._setScrollerHeight(e,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight));this._setScrollerWidth(d,this._frozenWidth);this.SizeDataBody(g,d,e);var h=this.__getScrollLeft(),k=this._getScrollTop();(this._currentScrollTop!=k||this._currentScrollLeft!=h)&&this.scrollToPos(this._currentScrollLeft,this._currentScrollTop);this._stretchTheColumns();this._syncDataBodyHeights();!this._isPaged&&(!this._isLoadMore&&-1==this._rowCount&&this._canvasHeight<e-this._cachedCHHeight-
this._cachedCFHeight)&&(this._canvasHeight=e-this._cachedCHHeight-this._cachedCFHeight+AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,this._setFakeCanvasHeight(this._canvasHeight));this._fillViewPort(g,g.offsetHeight,!1)}else if(this._isImmediateContentDelivery(this.getComponent())||this._isInlineDataAvailable(this.getComponent())){g=this.GetDataBody();h=null;if(g){this._unavailableRowIndex=this._getUnavailableRowIndex(g);g=g.childNodes;for(k=g.length-1;0<=k;k--)if("TABLE"==g[k].tagName){h=g[k];break}}this._fixOuterHeight();
this._initColumnHeader();this._initColumnFooter();this._initNavBar();this._initLoadMore();null!=h&&0<h.rows.length?(this._initVirtualization(h,!0),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10)):(this.IsEmpty=!0,this.getDomElement().style.overflow="auto",this.AdjustAutoHeight(),this._updatePCState());if(this.IsEmpty){if(g=this.__getColumnHeader())h=this.getDomElement(),g.style.border="0px",k=g.offsetWidth,k<=h.clientWidth&&(h.style.overflow=
"hidden");if(k=this._getColumnFooter())h=this.getDomElement(),k.style.border="0px",k.offsetWidth<=h.clientWidth&&(h.style.overflow="hidden");(g||k)&&this.AdjustAutoHeight()}this._stretchTheColumns();this._checkLoadMore()}else if(this._firstBlockRequested)!this._headerless&&this.IsEmpty&&this._stretchTheColumns(),this.IsEmpty&&(0<this._autoHeightRows&&(!this._hasSingleScroller()||this._isPaged||this._isLoadMore))&&this.AdjustAutoHeight();else if(g=AdfAgent.getAgent(),h=this.getDomElement(),this.IsEmpty=
g=g.getAttribute(h,"_afrEmpty",!1),g||(this._firstBlockRequested=!0,h=this.getComponent(),(this._streamingDisabled||!AdfPage.PAGE.isStreamingRequestPending(h.getClientId()))&&this._queueFetchEvent(!0,AdfTableDataFetchEvent.INITIAL_SUBTYPE,-1),AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait")),this._initColumnHeader(),this._initColumnFooter(),this._initNavBar(),this._initLoadMore(),g||(h=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_FETCHING"),this.DisplayStatus(h,!0)),
g){this.getDomElement().style.overflow="auto";this._stretchTheColumns();if(g=this.__getColumnHeader())h=this.getDomElement(),g.style.border="0px",k=g.offsetWidth,k<=h.clientWidth&&(h.style.overflow="hidden");this._updatePCState()}this._hasNavBar&&this._resizeNavBar(d,e);this._anchorRowKey||(this._anchorRowKey=this.GetLastRowKey())}};
AdfDhtmlTableBasePeer.prototype._initColumnHeader=function(){var a=AdfAgent.getAgent(),b=a.getIntAttribute(this.getDomElement(),"_lastFrozen",-1),a=a.getIntAttribute(this.getDomElement(),"_firstFrozen",-1);this._lastFrozen=b;this._firstFrozen=a;if(b=this.__getColumnHeader()){if(0<this._autoHeightRows&&this._hasFrozenColumn()&&!this._columnHeaderUnwrapped){var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"TABLE"),e=d.rows[0],f=a=null;this._freezeColumnsToEnd()?(a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[1],
"TABLE"),f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[0],"DIV")):(a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[0],"TABLE"),f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[1],"DIV"));a.parentNode.removeChild(a);f.parentNode.removeChild(f);b.removeChild(d);this._freezeColumnsToEnd()?f.style.cssText="overflow:hidden;position:absolute;top:0px;":(d=a.style.width,e="left:",AdfDhtmlTableBasePeer._isRTL()&&(e="right:"),f.style.cssText="overflow:hidden;position:absolute;top:0px;"+
e+d);this._freezeColumnsToEnd()?(b.appendChild(f),b.appendChild(a)):(b.appendChild(a),b.appendChild(f));this._columnHeaderUnwrapped=!0}this._synchronizeColumnRowHeights(b,"t","d2","t2");this._cachedCHHeight=b.offsetHeight;if(AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&8>AdfAgent.AGENT.getVersion()){if((d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"))&&d.rows.length)d.rows[0].style.position="absolute";if(b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2")){if((d=AdfDhtmlTableBasePeer.__getChildBySubId(b,
"t2"))&&d.rows.length)d.rows[0].style.position="absolute";AdfDhtmlTableBasePeer._isRTL()&&(d.style.right="0px")}}}else this._headerless=!0,this._cachedCHHeight=0};AdfDhtmlTableBasePeer.prototype._hasFrozenColumn=function(){return 0<=this._lastFrozen||0<=this._firstFrozen};AdfDhtmlTableBasePeer.prototype._freezeColumnsToStart=function(){return 0<=this._lastFrozen};AdfDhtmlTableBasePeer.prototype._freezeColumnsToEnd=function(){return 0<=this._firstFrozen};
AdfDhtmlTableBasePeer.prototype._areAllColumnsFrozen=function(a){return 0<=this._lastFrozen&&a==this._lastFrozen+1||0==this._firstFrozen};AdfDhtmlTableBasePeer.prototype._isColumnFrozen=function(a){return 0<=this._lastFrozen&&a<=this._lastFrozen||0<=this._firstFrozen&&a>=this._firstFrozen};AdfDhtmlTableBasePeer.prototype._hasSingleScroller=function(){return this._footerless&&!this._freezeColumnsToEnd()};
AdfDhtmlTableBasePeer.prototype._initColumnFooter=function(){var a=this._getColumnFooter();a?(this._synchronizeColumnRowHeights(a,"ft","fd2","ft2"),this._cachedCFHeight=a.offsetHeight):(this._footerless=!0,this._cachedCFHeight=0)};
AdfDhtmlTableBasePeer.prototype._initNavBar=function(){var a=this._getNavigationBar();if(a){this._hasNavBar=!0;setTimeout(function(){var a=AdfPage.PAGE.getActiveDomElement(),b=AdfPage.PAGE.getLookAndFeel().getSkinProperty("af|table::navbar-page-link");null!=a&&a.className==b&&a.blur()},0);this._cachedNBHeight=a.offsetHeight;var b=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),"nb_cnt"));this._cachedNBWidth=b.offsetWidth;this._isPaged=!0;this.RegisterFirstPropertyChange();
if(null!=this.getComponent().getProperty("_afrSlaveId")||null!=this.getComponent().getProperty("_afrMasterId"))a.firstChild.style.display="none",a.style.height=0,this._cachedNBHeight=a.offsetHeight,this._cachedNBWidth=b.offsetWidth}else this._cachedNBWidth=this._cachedNBHeight=0;this._nbarMin=!1};
AdfDhtmlTableBasePeer.prototype._initLoadMore=function(){var a=this._getLoadMore(!1),b=this._getLoadMore(!0);a?(this._cachedFMHeight=a.offsetHeight,this._cachedFMWidth=a.offsetWidth,a.style.display="none",a.style.overflow="hidden",a.style.zIndex=1,a.style.visibility="visible",b.style.display="none",b.style.overflow="hidden",b.style.zIndex=1,b.style.visibility="visible",a=this.__getColumnHeader(),null!=a&&(a.style.zIndex=2)):this._cachedFMWidth=this._cachedFMHeight=0};
AdfDhtmlTableBasePeer.prototype.__fixPanelCollectionDimensions=function(a){if(this._autoHeightRows){var b=this.getDomElement(),d=this.GetPanelCollectionPeer(),e=d.getDomElement(),f=d.getDomElement(),g=this.GetPanelCollectionComponent(),h=AdfAgent.getAgent(),k=h.getPlatform()==AdfAgent.WEBKIT_PLATFORM;if(d&&g){var l=g.getClientId(),g=h.getElementById(AdfRichUIPeer.CreateSubId(l,d.__getAutoHeightTopFacetId())),l=h.getElementById(AdfRichUIPeer.CreateSubId(l,d.__getAutoHeightBottomFacetId())),g=g?g.offsetHeight:
0,l=l?l.offsetHeight:0;d.isDetached()?(e=b.parentNode.parentNode,d=b.style,!a&&null==f.getAttribute("_afrPreDetachW")&&(a=d.width,""===a&&(a=this.GetDataBody().offsetWidth+this._getScrollbarWidth(),a+="px"),f.setAttribute("_afrPreDetachW",a),f.setAttribute("_afrPreDetachH",d.height)),k?(f=h.getComputedStyle(b),b.style.width=e.clientWidth-parseInt(f.borderLeftWidth)-parseInt(f.borderRightWidth)+"px"):h.setOuterWidth(b,e.clientWidth),h.setOuterHeight(b,e.clientHeight-g-l)):(h=f.getAttribute("_afrPreDetachH"),
void 0!=h&&(b.style.height=h,f.removeAttribute("_afrPreDetachH")),h=f.getAttribute("_afrPreDetachW"),void 0!=h&&(b.style.width=a?"":h,f.removeAttribute("_afrPreDetachW")),this._sizeOuterContainer(e,b.offsetHeight+g+l))}}};AdfDhtmlTableBasePeer.prototype._isContainerStretched=function(){var a=this.getDomElement().style;return"absolute"==a.position&&a.top&&0<a.top.length&&a.bottom&&0<a.bottom.length};
AdfDhtmlTableBasePeer.prototype._isPCContainerStretched=function(){var a=!1;this.getDomElement();var b=this.GetPanelCollectionPeer();b&&(a=b.getDomElement().style,a="absolute"==a.position&&a.top&&0<a.top.length&&a.bottom&&0<a.bottom.length);return a};AdfDhtmlTableBasePeer.prototype.isHeightAutoSized=function(){return 0<this._autoHeightRows};
AdfDhtmlTableBasePeer.prototype._fixOuterHeight=function(){var a=!1;if(0<this._autoHeightRows){var b=AdfAgent.AGENT,d=this.getDomElement(),e=d.style;"auto"==e.height&&!this._isContainerStretched()&&(b.getPlatform()==AdfAgent.IE_PLATFORM&&8>b.getVersion()&&d.scrollWidth<=d.offsetWidth&&(e.height=d.clientHeight+"px",a=!0),a||(b.setOuterHeight(d,d.offsetHeight),a=!0));e.overflowX="";e.overflowY=""}return a};AdfDhtmlTableBasePeer.prototype.BeginHandleDataBlocks=function(){};
AdfDhtmlTableBasePeer.prototype.ReplaceDomElement=function(a,b){var d=a.id;if(0<d.indexOf(AdfDhtmlTableBasePeer.DW_SUB_ID)){var d=AdfAgent.AGENT,e=this.GetDataBody();this.BeginHandleDataBlocks();var f=AdfDhtmlTableBasePeer._findFirstLevelChildrenByTagName(a,"TABLE");this._unavailableRowIndex=this._getUnavailableRowIndex(a);var g=!1;if(this._virtInitialized){0==f.length&&(g=!0);var h=d.getIntAttribute(a,"_fetchId",-1),k=this._pendingFetch;if(void 0!=k&&this._pendingId==h){h=this._pendingRenderOnly;
this.CancelPendingFetch();this._cleanUpDataFetchElement(b);if(d.getBooleanAttribute(a,AdfDhtmlTableBasePeer.NEEDS_REFRESH_ATTRIBUTE,!1)){AdfPage.PAGE.addPartialTargets(this.getComponent());return}if(d.getBooleanAttribute(a,AdfDhtmlTableBasePeer.UNDO_FETCH_ATTRIBUTE,!1)){k==AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE||k==AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE||k==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE||k==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE?this._undoScroll():k==AdfTableDataFetchEvent.EXPAND_SUBTYPE||
k==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE?this._restoreSavedDisclosureState():k==AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW&&this._restoreActiveRowKey();AdfDhtmlTableBasePeer.SetCursor(e,"");this._hideStatus();this.getComponent().setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!1,!1,AdfUIComponent.PROPAGATE_ALWAYS);return}delete this._cachedFirstVisibleRowKeyAndRow;this._savedDisclosedState=void 0;for(var l=0;l<f.length;l++){a.removeChild(f[l]);this._pruneKeyCache||(this._pruneKeyCache=d.getAttribute(f[l],
"_pruneKeyCache",null));var m=d.getIntAttribute(f[l],"_adsCounter",-1),n=!1;0==l&&this._applyBufferedADSEvents(m,!0);n=this._handleDataCallback(f[l],k,h,f.length-l-1);l==f.length-1&&(this._applyBufferedADSEvents(m,!1),this._resetActiveMessageBuffer(),this._activeDataCount<m&&(this._activeDataCount=m));n||this._addInvalidDataBlockToFetchElement(b,f[l]);d.elementsAdded(f[l])}this._fillViewPort(e,e.offsetHeight,!1);this.FetchCompleted()}else if(h==AdfDhtmlTableBasePeer.AUTO_PPR_FETCH_ID&&void 0==k){if(!this._handleAutoPPRDataFetch(a,
f,e,g))return}else this._handleIrrelaventFetchBlocks(a,b,f)}else this._firstBlockRequested||(this._initColumnHeader(),this._initColumnFooter(),this._initNavBar(),this._initLoadMore(),this._firstBlockRequested=!0),this.CancelPendingFetch(),0<f.length&&0<f[0].rows.length?(this._initVirtualization(f[0],!1),d.elementsAdded(f[0]),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10),this.AdjustAutoHeight()):g=!0;g?this._hasRefreshAutoPPRBlock(f)?
AdfPage.PAGE.addPartialTargets(this.getComponent()):(this._handleEmptyTextBlock(a,e),this.AdjustAutoHeight()):(this._editableTableReadOnlyMode&&this._disableTabStop(!0),(d=this._getActiveCellNode())?(e=AdfAgent.AGENT.getScrollLeft(d))&&e==this._currentScrollLeft&&this._setFocusOnNode(d):this._restoreActiveCellFromDom())}else if(0<d.indexOf("nbar")){if(d=this._getNavigationBar())d.parentNode.replaceChild(a,d),AdfAgent.AGENT.elementsAdded(a)}else if(e=(d=AdfDhtmlTableBasePeer._findHiddenLabel(b))?d.textContent:
null,AdfDhtmlTableBasePeer.superclass.ReplaceDomElement.call(this,a,b),e&&(d=AdfDhtmlTableBasePeer._findHiddenLabel(a))&&this._matchLabelEnds(e,d.textContent))d.textContent=e};AdfDhtmlTableBasePeer.prototype._matchLabelEnds=function(a,b){if(!b)return!0;var d=a.length,e=b.length,f;if(d<e)return!1;for(f=0;f<e&&a.charAt(f)==b.charAt(f);f++);return b.substr(f)==a.substr(d-(e-f))};
AdfDhtmlTableBasePeer.prototype._handleAutoPPRDataFetch=function(a,b,d,e){var f=this._hasRefreshAutoPPRBlock(b),g=AdfAgent.AGENT;if(f)return AdfPage.PAGE.addPartialTargets(this.getComponent()),!1;if(!e){e=!1;for(var f=(f=AdfPage.PAGE.getActiveDomElement())?f.id:null,h=0;h<b.length;h++){a.removeChild(b[h]);this._pruneKeyCache||(this._pruneKeyCache=g.getAttribute(b[h],"_pruneKeyCache",null));var k=g.getIntAttribute(b[h],"_autopprBlock",-1);this._updateComponentDisclosureState(b[h]);this._updateComponentSelectionState(b[h]);
this._updateAutoPPRActiveRowKey(b[h]);this.AutoPPRBlockReceived(b[h]);switch(k){case AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_BEFORE_BLOCK:case AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_AFTER_BLOCK:var l=g.getIntAttribute(b[h],"insertPath",null),m=this.FindRowByKey(l);if(m){var n=b[h].rows.length,p=null;0<n&&(l=b[h].rows[0],p=l.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY));p&&!this.FindRowByKey(p)&&(l=m.index,void 0!=l&&this.IsInsertAllowed(l)&&(k==AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_AFTER_BLOCK&&l++,
g.elementsAdded(b[h]),k=AdfDhtmlTableBasePeer._getBlockRowCount(b[h]),p=AdfAgent.AGENT.getIntAttribute(b[h],"totalInserted",0),this.InsertBlock(b[h],l,k,p,0),this.UpdateRange(!1)))}break;case AdfDhtmlTableBasePeer.AUTO_PPR_REMOVE_BLOCK:e=this.HandleAutoPPRRemove(b[h]);break;case AdfDhtmlTableBasePeer.AUTO_PPR_UPDATE_BLOCK:n=b[h].rows.length,0<n&&(l=b[h].rows[0],p=l.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),k=1<n&&this._hasDetailStamp?b[h].rows[1]:null,this._replaceRowByKey(p,l,k),f&&(p=g.getElementById(f))&&
(AdfDomUtils.isAncestor(l,p)||k&&AdfDomUtils.isAncestor(k,p))&&AdfFocusUtils.focusElement(p))}}this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!0);a=this._currentScrollLeft;0!=a&&this._handleHorizontalScroll(a);e&&this._fillViewPort(d,d.offsetHeight,!1)}return!0};
AdfDhtmlTableBasePeer.prototype._handleEmptyTextBlock=function(a,b){if(this._virtInitialized)AdfLogger.LOGGER.severe("Empty data block received:"+id);else{for(var d=a.childNodes,e=d.length,f=0;f<e;f++){var g=d[0];a.removeChild(g);b.appendChild(g)}this._updatePCState();this._hideStatus();this.getDomElement().style.overflow="auto";this.IsEmpty=!0;this._stretchTheColumns();if(d=this.__getColumnHeader())d.style.border="0px",e=this.getDomElement(),d.offsetWidth<=e.clientWidth&&(e.style.overflow="hidden");
AdfDhtmlTableBasePeer.SetCursor(b,"")}};AdfDhtmlTableBasePeer.prototype._handleIrrelaventFetchBlocks=function(a,b,d){var e=AdfAgent.AGENT;this._cleanUpDataFetchElement(b);for(var f=0;f<d.length;f++)a.removeChild(d[f]),this._addInvalidDataBlockToFetchElement(b,d[f]),e.elementsAdded(d[f])};
AdfDhtmlTableBasePeer.prototype._addInvalidDataBlockToFetchElement=function(a,b){for(var d=b.rows,e=d.length,f=null,g=0;g<e;g++){var h=d[g],k=h.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);null!=k&&null!=this.FindRowByKey(k)&&(f||(f=[]),f.push(h))}if(null!=f){e=f.length;for(g=0;g<e;g++)f[g].parentNode.removeChild(f[g])}a.appendChild(b)};AdfDhtmlTableBasePeer.prototype._cleanUpDataFetchElement=function(a){for(;null!=a.firstChild;){var b=a.firstChild;this._unregisterNode(b);a.removeChild(b)}};
AdfDhtmlTableBasePeer.prototype._hasRefreshAutoPPRBlock=function(a){for(var b=AdfAgent.AGENT,d=0;d<a.length;d++)if(b.getBooleanAttribute(a[d],AdfDhtmlTableBasePeer.NEEDS_REFRESH_ATTRIBUTE,!1))return!0;return!1};AdfDhtmlTableBasePeer.prototype.AutoPPRBlockReceived=function(a){};AdfDhtmlTableBasePeer.prototype.HandleAutoPPRRemove=function(a){var b=!1;if(a=AdfAgent.AGENT.getAttribute(a,"_parentKey",null))if(a=this.FindRowByKey(a))this.DeleteBlock(a.index,1,1,0,null),this.UpdateRange(!1),b=!0;return b};
AdfDhtmlTableBasePeer.prototype.DomReplaceNotify=function(a){return 0<a.id.indexOf(AdfDhtmlTableBasePeer.DW_SUB_ID)?null:a};AdfDhtmlTableBasePeer.prototype._getUnavailableRowIndex=function(a){var b=-1,d=AdfAgent.AGENT;if(a){var e=AdfDhtmlTableBasePeer.__getChildBySubId(a,"unAvail");e&&(b=d.getIntAttribute(e,"_unavailableRowIndex",-1),a.removeChild(e))}return b};
AdfDhtmlTableBasePeer.prototype._queueExpandFetchEvent=function(){var a=this._queueFetchEvent(!1,AdfTableDataFetchEvent.EXPAND_SUBTYPE);AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait");this._pruneKeyCache&&(a.setClientTokens(this._collectClientTokens(this._pruneKeyCache)),this._pruneKeyCache=null)};AdfDhtmlTableBasePeer.prototype._queueCollapseFetchEvent=function(){this._queueFetchEvent(!1,AdfTableDataFetchEvent.COLLAPSE_SUBTYPE);AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait")};
AdfDhtmlTableBasePeer.prototype.BlockInserted=function(a,b,d){};AdfDhtmlTableBasePeer.prototype.BlockDeleted=function(){};
AdfDhtmlTableBasePeer.prototype.DeleteBlock=function(a,b,d,e,f){for(var g=this.GetDataBody(),h=g.childNodes,k=0,l=0,m=0,n=h.length-1;0<=n&&m<b;n--){var p=h[n],k=k+p.cachedHeight,q=Math.max(a,p.startRow),r=Math.min(a+b-1,p.startRow+p.numRows-1),s=0,u=0,t=null;if(q==p.startRow&&r==p.startRow+p.numRows-1)u=p.cachedHeight,t=p,s=p.numRows,f&&(f.push(p),f.totalHeight+=p.offsetHeight);else{for(;r>=q;r--){var v=r-p.startRow;if(0==v){AdfAssert.assert(null!=p.rows&&null!=p.rows[0],"Unable to copy cell widths when the block contains no rows!");
for(var w=p.rows[0].cells,z=p.rows[1].cells,y=0;y<z.length;y++)z[y].style.width=w[y].style.width}v=p.rows[v];f&&(f.push(v),f.totalHeight+=v.offsetHeight);this._unregisterNode(v);v.parentNode.removeChild(v);s++}0<s&&(q=p.offsetHeight,u=p.cachedHeight-q,p.cachedHeight=q,p.numRows=p.rows.length);l+=p.cachedHeight}if(0<s){for(p=n+1;p<h.length;p++)q=h[p],q.startPos-=u,q.startRow-=s;t&&(this._unregisterNode(t),g.removeChild(t))}m+=s}a=m==d?l-k:-this._averageRowHeight*d;this._knownRowCount-=d;-1!=this._rowCount&&
(this._rowCount-=d);0<this._knownRowCount&&(missing=this._isViewportSatisfied(g,g.offsetHeight),missing&AdfDhtmlTableBasePeer.MISSING_AFTER&&this._addBelow(g,g.offsetHeight,!1));this._adjustCanvasHeight(a,g);0==e&&(this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(g),this.BlockDeleted())};AdfDhtmlTableBasePeer.prototype.FetchCompleted=function(){};
AdfDhtmlTableBasePeer.prototype.GetAssociatedComponent=function(){return null!=this._associatedPeer?this._associatedPeer.getComponent():null};AdfDhtmlTableBasePeer.prototype._updateInitialARK=function(a){var b=this.getComponent();if(a=a.getAttribute("_initARK")){this._ignoreActiveRowKeyChange=!0;try{b.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),b.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER)}finally{this._ignoreActiveRowKeyChange=!1}}};
AdfDhtmlTableBasePeer.prototype._updateComponentSelectionState=function(a){var b=this.getComponent();if(a=a.getAttribute("_selState"))eval("var st\x3d"+a+";"),b.setProperty("selectedRowKeys",st,!1,AdfUIComponent.PROPAGATE_NEVER)};
AdfDhtmlTableBasePeer.prototype._updateAutoPPRActiveRowKey=function(a){var b=this.getComponent();a=AdfAgent.AGENT.getAttribute(a,"_autopprActiveRow",null);if(null!=a){this._ignoreActiveRowKeyChange=!0;try{a=0==a.length?null:a,b.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),b.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10)}finally{this._ignoreActiveRowKeyChange=
!1}}};AdfDhtmlTableBasePeer.prototype._updateComponentDisclosureState=function(a){var b=this.getComponent();if(a=a.getAttribute("_discState"))eval("var st\x3d"+a+";"),b.setProperty("disclosedRowKeys",st,!1,AdfUIComponent.PROPAGATE_NEVER)};
AdfDhtmlTableBasePeer.prototype._initVirtualization=function(a,b){try{this._hideStatus();this._virtInitialized=!0;var d=AdfAgent.AGENT,e=d.getIntAttribute(a,"_startRow",0),f=d.getIntAttribute(a,"_visibleRow",-1),g=AdfDhtmlTableBasePeer._getBlockRowCount(a),h=this.getComponent(),k=this.GetDataBody(),l=d.getIntAttribute(a,"_rowCount",-1),m=this._isPaged,n=this._isLoadMore,p=this._getEstimatedRowCount(a);0<=p&&(g=p,l=-1);0==this._unavailableRowIndex?l=-1:0<this._unavailableRowIndex&&(l=this._unavailableRowIndex);
var q=this._knownRowCount=this._rowCount=l,r=0;-1==q&&(this._knownRowCount=q=g);this._updateComponentSelectionState(a);this._updateInitialARK(a);var s=this.getDomElement();d.setScrollLeft(s,0);var u=s.clientWidth,t=s.clientHeight,v=d.getIntAttribute(a,"_frWidth",0);this._frozenWidth=v;var w=d.getIntAttribute(a,"_totalWidth",-1);this._totalWidth=w;this._unfrozenWidth=w-v;this._hasDetailStamp=d.getAttribute(a,AdfDhtmlTableBasePeer._HAS_DETAIL_MARKER,!1);if(!b){for(var z=k.childNodes,y=z.length-1;0<=
y;y--)k.removeChild(z[y]);k.appendChild(a);u=s.clientWidth;t=s.clientHeight}var A=a.offsetHeight,B=AdfDhtmlTableBasePeer._getBlockRowCount(a);a.cachedHeight=A;var C=Math.round(A/B);this._averageRowHeight=C;var D;D=!m&&!n&&q>g?C*q:-1==l&&!m&&!n&&A<t-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight?t-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight:A;-1==l&&(!m&&!n)&&(0<p&&(D+=C*p),D+=AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE);a.style.position="relative";k.scrollTop=
0;a.startRow=e;a.numRows=B;a.startPos=!m&&!n&&0<e?r=C*e:0;var G=this._createAndInitializeScroller(s,u,t,D,v,a);this._scrollbarBehavior!=AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&this._addScrollEventListeners(k);this._innerTableScrollCallback=this.createCallback(this._handleInnerTableScroll);this._registerInnerScrollCallback(a);if(!this._headerless){var E=this.__getColumnHeader();if(this._hasFrozenColumn()){if(!this._areAllColumnsFrozen(this._colCount)){var H=AdfDhtmlTableBasePeer.__getChildBySubId(E,
"d2");H.onscroll=this._innerTableScrollCallback}}else E.onscroll=this._innerTableScrollCallback}if(!this._footerless){var I=this._getColumnFooter();this._hasFrozenColumn()?this._areAllColumnsFrozen(this._colCount)||(H=AdfDhtmlTableBasePeer.__getChildBySubId(I,"fd2"),H.onscroll=this._innerTableScrollCallback):I.onscroll=this._innerTableScrollCallback}var J=this.SizeDataBody(k,u,t);k.style.zIndex=1;r=this._computeInitialScrollTop(h,a,e,D,J,A);this._initScrollLeftTop(G,r);!this.isHeightAutoSized()&&
-1<f&&this.scrollToRowIndex(f);this._restoreScrollPosition();this._synchronizeRowHeights(a);this.isHeightAutoSized()&&(this.AdjustAutoHeight(),this._currentScrollTop=r=this._computeInitialScrollTop(h,a,e,D,k.offsetHeight,A),0<r&&(this._hasSingleScroller()&&!m?G.scrollTop=r:G[0].scrollTop=G[1].scrollTop=r),-1<f&&this.scrollToRowIndex(f));this._stretchTheColumns();this._fillViewPort(k,k.offsetHeight,!1);this._syncDataBodyHeights();this._setReadOnlyMode(!0,null,!1)}finally{this._updatePCState(),this.UpdateRange(!0),
this._virtInitializedComplete=!0}};AdfDhtmlTableBasePeer.prototype._computeInitialScrollTop=function(a,b,d,e,f,g){if(this._isPaged)return 0;var h=0;0<d&&(h=Math.min(b.startPos,e-f),h=Math.max(0,h));"last"==a.getDisplayRow()&&f<e&&(h=e-f,b.startPos=e-g);return h};AdfDhtmlTableBasePeer.prototype._handleTouchMovement=function(a,b){var d=this.__getScrollPos();d&&(scrollLeft=d.x-a,scrollTop=d.y-b,this._scrollerScrollToPos(scrollLeft,scrollTop))};
AdfDhtmlTableBasePeer.prototype._syncDataBodyHeights=function(){var a=this.getComponent(),b=a.getProperty("_afrMasterId"),d=a.getProperty("_afrSlaveId");(b||d)&&this._hasSingleScroller()&&AdfPage.PAGE.scheduleTimer(this,this._syncDataBodyHeightsTimeout,a,0)};
AdfDhtmlTableBasePeer.prototype._syncDataBodyHeightsTimeout=function(a){a=a.getParent().findComponent(this._associatedId);AdfAssert.assert(null!=a,"There is no associated table");var b=a.getPeer();a=this.GetDataBody();var d=b.GetDataBody(),e=this.GetScroller(),b=b.GetScroller();if(e&&b){var f=e.firstChild,g=b.firstChild;if(f&&g){var h=("auto"==e.style.overflowX||"auto"==e.style.overflow)&&e.offsetHeight>e.clientHeight,k=("auto"==b.style.overflowX||"auto"==b.style.overflow)&&b.offsetHeight>b.clientHeight,
l=parseInt(a.style.height),m=parseInt(d.style.height);!isNaN(l)&&!isNaN(m)&&(k&&!h?(a.style.height=m+"px",e.style.height=b.style.height,e.style.overflowX="scroll",f.style.height=g.style.height):h&&!k?(d.style.height=l+"px",b.style.height=e.style.height,b.style.overflowX="scroll",g.style.height=f.style.height):"auto"==b.style.overflowX?(e.style.overflowX="auto",a.style.height=m+"px",e.style.height=b.style.height,f.style.height=g.style.height):(b.style.overflowX="auto",d.style.height=l+"px",b.style.height=
e.style.height,g.style.height=f.style.height))}}};
AdfDhtmlTableBasePeer.prototype._createAndInitializeScroller=function(a,b,d,e,f,g){var h=AdfAgent.AGENT,k;if(this._hasSingleScroller()&&!this._isPaged&&!this._freezeColumnsToEnd()){var l=this.getDomDocument();k=l.createElement("div");k.tabIndex=-1;k.id=a.id+"::scroller";var m=k.style;m.position="absolute";this._isTouch&&h.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&(m.setProperty("-webkit-overflow-scrolling","touch"),m.setProperty("-webkit-transform","translateZ(0px)"),h.getOS()==AdfAgent.MAC_OS&&AdfDomUtils.addCSSClassName(k,
AdfPage.PAGE.getLookAndFeel().getStyleClass(AdfDhtmlTableBasePeer._SCROLLER_ANIMATION_CLASS)));if(null!=this._associatedId){var n=this.getComponent();null!=n.getProperty("_afrSlaveId")?(m.overflowX="auto",m.overflowY="hidden"):m.overflow="auto";n=n.getParent().findComponent(this._associatedId);AdfAssert.assert(null!=n,"There is no associated table");this._associatedPeer=n.getPeer();n=n.getPeer();null!=n&&n._associatedPeer!=this&&(n._associatedPeer=this)}else this._freezeColumnsToEnd()?(m.overflowX=
"auto",m.overflowY="hidden"):m.overflow="auto";m.zIndex=0;m.width=Math.max(b-f,0)+"px";m.top=this._cachedCHHeight+"px";m.height=Math.max(d-this._cachedCHHeight,0)+"px";AdfDhtmlTableBasePeer._isRTL()?this._freezeColumnsToEnd()?m.right="0px":m.left="0px":this._freezeColumnsToEnd()?m.left="0px":m.right="0px";l=l.createElement("div");m=h.getIntAttribute(g,"_totalWidth",-1);-1==m&&(m=g.offsetWidth);h.getPlatform()==AdfAgent.IE_PLATFORM&&(l.style.position="absolute");l.style.width=m-f+"px";this._canvasHeight=
e;e>AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT?(l.style.height=AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT+"px",this._canvasHeightLimited=!0):(l.style.height=e+"px",this._canvasHeightLimited=!1);l.style.visibility="hidden";k.appendChild(l);a.appendChild(k);h.elementsAdded(k)}else k=this._createAndInitializeColumnFooterScroller(a,b,d,e,f,g);this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(e=this.GetDataBody(),g=h.getComputedStyle(a),f=this.getDomDocument().createElement("div"),
f.setAttribute("id",AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlTableBasePeer._DATAWRAPPER)),l=f.style,this._cachedScrollerWidthAddl=a.offsetWidth-b,this._cachedScrollerHeightAddl=a.offsetHeight-d,l.height=a.offsetHeight-this._cachedCHHeight-this._cachedCFHeight+"px",l.width=a.offsetWidth+"px",l.backgroundColor=g.backgroundColor,l.overflowX="hidden",l.overflowY="hidden",l.position="relative",l.zIndex=1,this._addScrollEventListeners(f),a.insertBefore(f,e),this._isLoadMore?(a=this._getLoadMore(!1),b=this._getLoadMore(!0),
null!=b&&f.appendChild(b),f.appendChild(e),null!=a&&f.appendChild(a)):f.appendChild(e),h.elementsAdded(f),this._hasSingleScroller()&&!this._isPaged?(vscroller=this.GetScroller(),hscroller=this.GetScroller()):(vscroller=this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],hscroller=this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER]),vscroller.style.visibility="hidden",hscroller.style.visibility="hidden",this._dataBodyWrapped=this._scrollbarHidden=!0);return k};
AdfDhtmlTableBasePeer.prototype._initScrollLeftTop=function(a,b){this._currentScrollTop=b;this._hasSingleScroller()&&!this._isPaged?(0<b&&(a.scrollTop=b),this._currentScrollLeft=AdfDhtmlTableBasePeer._isRTL()?AdfAgent.AGENT.getScrollLeft(a):0,AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,a,AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE)):(0<b&&(a[0].scrollTop=a[1].scrollTop=b),this._currentScrollLeft=AdfDhtmlTableBasePeer._isRTL()?AdfAgent.AGENT.getScrollLeft(a[0]):0,AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,
a[0],AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE),AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,a[1],AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE))};
AdfDhtmlTableBasePeer.prototype._createAndInitializeColumnFooterScroller=function(a,b,d,e,f,g){var h=[],k=AdfAgent.AGENT,l=this.getDomDocument();hscroller=l.createElement("div");vscroller=l.createElement("div");hscroller.id=a.id+"::hscroller";vscroller.id=a.id+"::vscroller";hscroller.tabIndex=-1;vscroller.tabIndex=-1;var m=hscroller.style,n=vscroller.style;m.position=n.position="absolute";if(null!=this._associatedId){var p=this.getComponent();null!=p.getProperty("_afrSlaveId")?n.overflowY="hidden":
n.overflowY="auto";n.overflowX="hidden";m.overflowY="hidden";m.overflowX="auto";p=p.findComponent(this._associatedId);AdfAssert.assert(null!=p,"There is no associated table");this._associatedPeer=p.getPeer();p=p.getPeer();null!=p&&p._associatedPeer!=this&&(p._associatedPeer=this)}else n.overflowY="auto",n.overflowX="hidden",m.overflowY="hidden",m.overflowX="auto",this._isTouch&&k.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&(n.setProperty("-webkit-overflow-scrolling","touch"),n.setProperty("-webkit-transform",
"translateZ(0px)"),m.setProperty("-webkit-overflow-scrolling","touch"),m.setProperty("-webkit-transform","translateZ(0px)"),k.getOS()==AdfAgent.MAC_OS&&(m.overflow="scroll",AdfPage.PAGE.getLookAndFeel().getStyleClass(AdfDhtmlTableBasePeer._SCROLLER_ANIMATION_CLASS),AdfDomUtils.addCSSClassName(vscroller,AdfDhtmlTableBasePeer.animationStyleClass),AdfDomUtils.addCSSClassName(hscroller,AdfDhtmlTableBasePeer.animationStyleClass)));m.zIndex=n.zIndex=0;n.width=Math.max(b-f,0)+"px";n.top=this._cachedCHHeight+
"px";n.height=Math.max(d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight,0)+"px";AdfDhtmlTableBasePeer._isRTL()?(this._freezeColumnsToEnd()?m.right="0px":m.left="0px",n.left="0px"):(this._freezeColumnsToEnd()?m.left="0px":m.right="0px",n.right="0px");var p=l.createElement("div"),l=l.createElement("div"),q=k.getIntAttribute(g,"_totalWidth",-1);-1==q&&(q=g.offsetWidth);k.getPlatform()==AdfAgent.IE_PLATFORM&&(p.style.position=l.style.position="absolute");p.style.width=l.style.width=q-
f+"px";this._canvasHeight=e;p.style.height=l.style.height=e+"px";hscroller.appendChild(p);vscroller.appendChild(l);a.appendChild(vscroller);k.elementsAdded(vscroller);m.top=this._cachedCHHeight+"px";m.height=Math.max(d-this._cachedCHHeight,0)+"px";e=vscroller.offsetWidth-vscroller.clientWidth;AdfDhtmlTableBasePeer._isRTL()?m.left=e+"px":m.right=e+"px";m.width=Math.max(b-f-e,0)+"px";this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(m.width+=e);a.appendChild(hscroller);k.elementsAdded(hscroller);
a=hscroller.offsetHeight-hscroller.clientHeight;n.height=Math.max(d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight-a,0)+"px";this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(n.height+=a);h[AdfDhtmlTableBasePeer._HSCROLLER]=hscroller;h[AdfDhtmlTableBasePeer._VSCROLLER]=vscroller;return h};
AdfDhtmlTableBasePeer.prototype._updatePCState=function(){var a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID);null!=a&&(a=this._pcPeer=AdfPage.PAGE.findComponent(a).getPeer(),a.resetState(),a.updateStandardMenuToolbarItems(),a.updateStandardStatusbarItems(),a.updateRowSelectionContext())};
AdfDhtmlTableBasePeer.prototype.__getVisibleLeafColumns=function(){if(null!=this._visibleLeafColumns)return this._visibleLeafColumns;var a=this.getDomElement(),a=AdfAgent.AGENT.getAttribute(a,"_leafColClientIds"),a=eval(a),b=[];if(null!=a)for(var d=a.length,e=0;e<d;e++){var f=AdfPage.PAGE.findComponent(a[e]);b.push(f)}return this._visibleLeafColumns=b};
AdfDhtmlTableBasePeer.__getSortOrderForColumn=function(a){var b=null;if(a=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(a,AdfDhtmlTableBasePeer.__SORT_INDICATOR)))a=a.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),a==AdfDhtmlTableBasePeer._SORTED_DESCENDING?b=!1:a==AdfDhtmlTableBasePeer._SORTED_ASCENDING&&(b=!0);return b};AdfDhtmlTableBasePeer.prototype.__getColumnResizeMargin=function(){AdfAssert.failedInAbstractFunction()};
AdfDhtmlTableBasePeer.prototype.HandleDomMouseMove=function(a,b){if(!this._headerless&&this._virtInitialized)if(this._resizedTH){var d=this._getParentTH(b);d&&(!a.getColumnResizing||"enabled"==a.getColumnResizing())&&AdfDhtmlTableBasePeer.SetCursor(d,AdfAgent.AGENT.getCursor("col-resize"))}else if(d=this._mdPos){var e=AdfAgent.AGENT.getMousePosition(b);Math.abs(e.x-d.x)>this.__getColumnResizeMargin()&&(this._mdPos=null,this._processColumnReorderAction(b))}else if(this._reorderTH)AdfDhtmlTableBasePeer.SetCursor(this._reorderTH,
"move");else if(d=this.__getColumnHeaderMouseAction(b))e=d.cell,"resize"==d.type&&this._getResizedCellInfo(d)&&(!a.getColumnResizing||"enabled"==a.getColumnResizing())?AdfDhtmlTableBasePeer.SetCursor(e,AdfAgent.AGENT.getCursor("col-resize")):"move"==d.type?AdfDhtmlTableBasePeer.SetCursor(e,AdfAgent.AGENT.getCursor("move")):"default"==d.type?AdfDhtmlTableBasePeer.SetCursor(e,"default"):AdfDhtmlTableBasePeer.SetCursor(e,"")};
AdfDhtmlTableBasePeer.prototype.__handleColumnResizing=function(a,b){if(null==b&&(b=this.__getColumnHeaderMouseAction(a.getNativeEvent()),null==b))return;if("resize"==b.type){var d=this._getResizedCellInfo(b);d&&(this._resizedTH=d.cell,this._resizedIndex=d.displayIndex,this._showColumnResizeIndicator(d.cell,d.displayIndex),this._resizeColDelta=0,d=this.__getColumnHeader(),AdfAgent.AGENT.disableUserSelect(d),a.cancel(),d=a.getNativeEvent(),AdfPage.PAGE.startDrag(d,this._colResizeDragCallback,this._colResizeDropCallback))}};
AdfDhtmlTableBasePeer.prototype.HandleComponentMouseDown=function(a){var b=a.getNativeEvent(),d=this.__getColumnHeaderMouseAction(b),e=d?d.type:null;if((this._virtInitialized||"clearAllFilter"==e)&&this.__isOwnComponentEvent(a)){var f=AdfAgent.AGENT,g=f.getEventTarget(b),h=this.__getColumnHeader();h&&"readOnly"!=this.getComponent().getEditingMode()&&AdfDomUtils.disableTabStop(h,!1);var k=this.GetRowKeyAndRow(g,this.getDomElement());if(null!=k&&(h=k[0],k=k[1],null!=h)){this._handleRowMouseDown(b,g,
f.isLeftButton(b),f.isSelectionToggle(b),b.shiftKey,h,k);return}f.isLeftButton(b)&&(h=this._isTargetCellFilter(g),this._isTargetCellEditable(g,h)&&"clearAllFilter"!=e?h&&(this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,g,!1),this._setHeaderCellFocus(this._getParentTH(b))):e&&("selectAll"==e?(this._grabFocus(),(b=this.getComponent().getSelectedRowKeys())&&b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(this._selUnselectAll(),this._queueColumnSelectionEvent()):this._selSelectAll()):"clearAllFilter"==
e?(b=this.getComponent(),f=new AdfQueryEvent(b),f.setClearAll(!0),b.queueEvent(f),b.setSelectedRowKeys(null)):"resize"==e?this.__handleColumnResizing(a,d):"move"==e?(this._mdPos=f.getMousePosition(b),this._reorderTH=d.cell,a.cancel()):"select"==e&&(this._grabFocus(),a=d.colIndices,0<a.length&&(b.shiftKey||(this._anchorColumnHeader=d.cell),this._doColumnSelections(b,a,d.colIds),this._isMultipleColumnSelect()&&(null==this._handleColumnHeaderDragCallback&&(this._handleColumnHeaderDragCallback=this.createCallback(this._handleColumnHeaderDrag),
this._handleColumnHeaderDropCallback=this.createCallback(this._handleColumnHeaderDrop)),a=this.__getColumnHeader(),f.disableUserSelect(a),AdfPage.PAGE.startDrag(b,this._handleColumnHeaderDragCallback,null)))),"resize"!=e&&("sort"!=e&&null!=d.cell)&&this._setHeaderCellFocus(d.cell)))}};AdfDhtmlTableBasePeer.prototype.HandleComponentMouseUp=function(a){this._reorderTH=this._mdPos=null};
AdfDhtmlTableBasePeer.prototype._selectInputOnMouseUp=function(a){var b,d;null!=a.selectionStart&&(b=0<a.selectionEnd-a.selectionStart);d=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&9>AdfAgent.AGENT.getVersion()?this.getDomDocument().selection.createRange().text:window.getSelection().toString();!b&&""!=d&&a.select()};
AdfDhtmlTableBasePeer.prototype.HandleComponentDblClick=function(a){this._virtInitialized&&(this.__isOwnComponentEvent(a)&&this._isTargetCellEditable(a.getNativeEventTarget()))&&(this._ctePatternStart=void 0)};
AdfDhtmlTableBasePeer.prototype._getOnlyTextNode=function(a){var b=a.ownerDocument,d=null;if(b.evaluate&&AdfAgent.AGENT.getPlatform()!=AdfAgent.EDGE_PLATFORM)a=b.evaluate(".//text()",a,null,XPathResult.ANY_TYPE,null),(d=a.iterateNext())&&a.iterateNext()&&(d=null);else{(b=a.firstChild)&&3==b.nodeType&&(d=b);a=a.getElementsByTagName("*");for(var e=a.length,f=0;f<e;f++)if((b=a[f].firstChild)&&3==b.nodeType)if(d){d=null;break}else d=b}return d};
AdfDhtmlTableBasePeer.prototype._isCellTruncated=function(a){var b=a.cloneNode(!0),d=!1;AdfAgent.AGENT.copyStyle(a,b);b.style.width="";for(var e=b.getElementsByTagName("input"),f=e.length-1;0<=f;f--){var g=e[f];g.id="";g.name=""}e=this.getDomElement();f=a.ownerDocument.createElement("table");e.appendChild(f);f.insertRow(-1).appendChild(b);a.offsetWidth<b.offsetWidth&&(d=!0);e.removeChild(f);return d};
AdfDhtmlTableBasePeer.prototype.getClickLocation=function(a){var b=AdfAgent.AGENT,d=this.__getColumnHeader(),e;d&&(e=b.getElementPosition(d));a=b.getMousePosition(a);return d&&a.y-e.y<=this._cachedCHHeight?"header":"body"};
AdfDhtmlTableBasePeer.prototype.HandleComponentContextMenu=function(a){var b=a.getNativeEvent(),d=AdfAgent.AGENT;if(a.isPositionalRequest())if("header"===this.getClickLocation(b))this._handleColumnContextMenu(b);else{if(a=d.getEventTarget(b),!this._isTargetCellEditable(a)){d=this.GetRowKeyAndRow(a,this.getDomElement());if(null!=d&&(a=d[0],d=d[1],null!=a)){this.HandleRowContextMenu(b,a,d);return}this._handleBodyContextMenu(b)}}else this._handleKeyboardContextMenu(b,!1)};
AdfDhtmlTableBasePeer.prototype._hideColumnSortableIndicator=function(a,b){if(b&&2>b.colSpan){var d=AdfRichUIPeer.CreateSubId(b.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR),d=a.getElementById(d);if(null!=d){var e=d.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),f=d.getAttribute(AdfDhtmlTableBasePeer._SUPPORTS_HOVER);null==e&&f&&(d.style.visibility="hidden")}}};
AdfDhtmlTableBasePeer.prototype.HandleComponentClick=function(a){if(!this.__isOwnComponentEvent(a))return!1;var b=this.getComponent(),d=AdfAgent.AGENT,e=a.getNativeEvent(),f=d.getEventTarget(e),g=this.GetRowKeyAndRow(f,this.getDomElement());if(null!=g){var h=g[0],g=g[1];if(null!=h)return a.isLeftButtonPressed()&&(a=this._getExpandAction(f),"expand"==a?b.setDisclosedRowKey(h,!0):"collapse"==a?b.setDisclosedRowKey(h,!1):this._handleRowClick(f,d.isLeftButtonClick(e),d.isSelectionToggle(e),e.shiftKey,
h,g)),!0}if(!this._headerless&&(h=this.__getColumnHeaderMouseAction(e))&&"sort"==h.type&&!a.isCanceled())return AdfTableUtils.queueSortEvent(b,[h.sortProperty],[h.sortOrder]),d.eatEvent(e),!1;this._hasNavBar&&this.__handleNavBarItemsClick(e,f);this._isLoadMore&&this.__handleLoadMoreItemsClick(e,f);return!0};AdfDhtmlTableBasePeer.prototype.HandleComponentValueChange=function(a){this._handleComponentEventForFilterCell(a)};
AdfDhtmlTableBasePeer.prototype._handleComponentEventForFilterCell=function(a){if(!a.isCanceled()){var b=a.getSource(),d=b.getPeer();d.bind(b);b=d.getDomElement();this._isTargetCellFilter(b)&&a.propagatesToServer()&&this._handleFilterCellAction()}};AdfDhtmlTableBasePeer.prototype._skipScrollRequest=function(){return AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&this._scrollTopUpdating&&(!this._isTouch||"Windows"==AdfAgent.guessOS())&&this._currentScrollTop==this._getScrollTop()};
AdfDhtmlTableBasePeer.prototype.HandleDomScroll=function(a,b){if(!this._skipScrollRequest()){var d=this.__getScrollLeft(),e;e=null!=this._associatedPeer&&AdfAgent.AGENT.getPlatform()==AdfAgent.GECKO_PLATFORM&&null!=a.getProperty("_afrSlaveId")?-1:this._getScrollTop();this.scrollToPos(d,e);this._associatedPeerScroll(-1,e)}};
AdfDhtmlTableBasePeer.prototype._associatedPeerScroll=function(a,b,d){if(null!=this._associatedPeer)if(d=!d?1:++d,this._associatedPeer._virtInitialized)this._associatedPeer.scrollToPos(a,b);else if(4>d){var e=this;setTimeout(function(){e._associatedPeerScroll(a,b,d)},0)}else AdfLogger.LOGGER.severe("Tried 3 times w/ _associatedPeerScroll "+a+" : "+b)};
AdfDhtmlTableBasePeer.prototype._handleInnerTableScroll=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfAgent.AGENT.getEventTarget(a);null!=this._touchMoveManager&&(b=a.target);this.scrollToPos(AdfAgent.AGENT.getScrollLeft(b),-1)};
AdfDhtmlTableBasePeer.prototype._handleDataBodyScroll=function(){var a=-1,b,d;if(this._skipScrollRequest())if(b=this.GetDataBody(),d=b.firstChild){var e=AdfAgent.AGENT.getScrollLeft(b);if(e==this._currentScrollLeft)return;this._hasFrozenColumn()||(a=e)}else return;!0===this._handleDataCallbackBeingProcessed?(null!=this._handleDataBodyScrollTimeout&&(window.clearTimeout(this._handleDataBodyScrollTimeout),delete this._handleDataBodyScrollTimeout),this._handleDataBodyScrollTimeout=window.setTimeout(this.createCallback(this._handleDataBodyScroll),
0)):(b||(b=this.GetDataBody()),d||(d=b.firstChild),d&&(d=b.scrollTop+d.startPos-parseInt(this._hShiftDataBody)-parseInt(this._hShiftLoadMoreDataBody),!this._hasFrozenColumn()&&-1==a&&(a=AdfAgent.AGENT.getScrollLeft(b)),this.scrollToPos(a,d),this._associatedPeerScroll(-1,d)))};AdfDhtmlTableBasePeer.prototype.__getScrollPos=function(){return null!=this.GetScroller()?{x:this.__getScrollLeft(),y:this._getScrollTop()}:null};
AdfDhtmlTableBasePeer.prototype.__restoreScrollerPositions=function(a,b){this._setScrollTop(b);this._setScrollLeft(a)};
AdfDhtmlTableBasePeer.prototype.scrollToPos=function(a,b,d,e){var f=this.getComponent(),g=AdfDhtmlTableBasePeer.NO_SCROLL;void 0===e&&(e=!0);if(-1!=b&&this._currentScrollTop!=b){delete this._cachedFirstVisibleRowKeyAndRow;d||f.setProperty("scrollTop",b,!0,AdfUIComponent.PROPAGATE_ALWAYS);this._setScrollTop(b);g=this._handleVerticalScroll(b,e);this._isPaged||(b=this.GetFirstVisibleRowKeyAndRow(),null!=b.rowKey&&f.setProperty("scrollTopRowKey",b.rowKey,!0,AdfUIComponent.PROPAGATE_ALWAYS));b=this.GetDataBody().childNodes;
for(e=b.length-1;0<=e;e--)this._synchronizeRowHeights(b[e])}-1!=a&&this._currentScrollLeft!=a&&(d||f.setProperty("scrollLeft",a,!0,AdfUIComponent.PROPAGATE_ALWAYS),this._setScrollLeft(a),this._handleHorizontalScroll(a));return g};
AdfDhtmlTableBasePeer.prototype.HandleDomKeyDown=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),f=d.getEventTarget(b),g=b.keyCode;switch(g){case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:case AdfKeyStroke.ARROWRIGHT_KEY:case AdfKeyStroke.ARROWLEFT_KEY:case AdfKeyStroke.HOME_KEY:case AdfKeyStroke.END_KEY:e=!0;this._isTargetCellEditable(f)||(g==AdfKeyStroke.HOME_KEY||g==AdfKeyStroke.END_KEY?this._handleHomeEndKey(g,b):this._handleArrow(g,b),e=!1);e||d.eatEvent(b);break;case AdfKeyStroke.ENTER_KEY:d=
this._getParentTH(b),g=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_PAGE_INPUT),d&&null!=d.getAttribute("_afrFH")?(e=new AdfQueryEvent(a),e.setClearAll(!0),a.queueEvent(e),a.setSelectedRowKeys(null)):f.id==g&&(d=a.getProperty("rows"),0<d&&(f=(f.value-1)*d,0<=f?this._handlePageRowClick(f,b):(d=AdfPage.PAGE.getLookAndFeel(),f=d.getTranslatedString("af_table.MSG_NAVBAR_PAGE_INVALID"),d=d.getTranslatedString("af_table.MSG_NAVBAR_PAGE_INVALID_DETAIL"),f=new AdfFacesMessage(AdfFacesMessage.TYPE_ERROR,
f,d),AdfPage.PAGE.clearMessages(e),AdfPage.PAGE.hasMessages(null)&&AdfPage.PAGE.clearMessages(null),AdfPage.PAGE.addMessage(e,f),a.focus())))}};
AdfDhtmlTableBasePeer.prototype._handleHorizontalScroll=function(a){var b=AdfAgent.AGENT,d=this.GetDataBody();if(this._hasFrozenColumn()){this._headerless||AdfDhtmlTableBasePeer._scrollColumnHeader(this.__getColumnHeader(),a);this._footerless||AdfDhtmlTableBasePeer._scrollColumnFooter(this._getColumnFooter(),a);for(var b=d.childNodes,e=0;e<b.length;e++)this._positionInnerTable(b[e],a)}else this._headerless||b.setScrollLeft(this.__getColumnHeader(),a),this._hasSingleScroller()||b.setScrollLeft(this._getColumnFooter(),
a),b.setScrollLeft(d,a);this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(a=this.__getColumnHeader(),this._isScrollerRight()?this._getScrollHeight()>this._getScrollerOffsetHeight()&&(b=this._getScrollerOffsetWidth()-this._getScrollerClientWidth(),AdfDhtmlTableBasePeer._isRTL()?(d.style.left=b+"px",this._headerless||(a.style.left=b+"px")):(d.style.left=-1*b+"px",this._headerless||(a.style.left=-1*b+"px"))):(d.style.left="0px",this._headerless||(a.style.left="0px")))};
AdfDhtmlTableBasePeer.prototype._handleVerticalScroll=function(a,b){if(!(this._pendingFetch==AdfTableDataFetchEvent.EXPAND_SUBTYPE||this._pendingFetch==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE)&&!this._insertDeleteAnimationInEffect){var d=this.GetDataBody();if(this._isPaged)return d.scrollTop=a,AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;if(this._isLoadMore)return d.scrollTop=a,this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&this._checkScrollbarHidingAffordance(),this._checkLoadMore(),
AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;d=this._fillViewPort(d,d.offsetHeight,b,!0);null!=this._selectionRequest&&(d==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?this._processSelectionRequest():d!=AdfDhtmlTableBasePeer.MISSING_BEFORE&&d!=AdfDhtmlTableBasePeer.MISSING_AFTER&&delete this._selectionRequest);null!=this._clickEditRequest&&d==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED&&this._processClickToEditActivateRequest();this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&this._checkScrollbarHidingAffordance();
return d}};
AdfDhtmlTableBasePeer.prototype._fillViewPort=function(a,b,d,e){var f=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;if(this._isPaged)return this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),this.AdjustAutoHeight(),f;if(this._isLoadMore)return this._stretchTheColumns(),f=this._isViewportSatisfied(a,b),f&AdfDhtmlTableBasePeer.MISSING_AFTER?this._addBelow(a,b,d,e):(this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),this.AdjustAutoHeight()),f;0<this._knownRowCount&&(f=this._isViewportSatisfied(a,b),
f==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?(this._repositionBlocksForScroll(a),this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),b=(this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight)-b,0<b&&(this._currentScrollTop<b/2?this._checkStart(a):this._checkEnd(a)),this.AdjustAutoHeight()):f&AdfDhtmlTableBasePeer.MISSING_BEFORE?this._addAbove(a,b,d,e):f&AdfDhtmlTableBasePeer.MISSING_AFTER?this._addBelow(a,b,d,e):this._handleLongJump(a,b,d,e));return f};
AdfDhtmlTableBasePeer.prototype._isScrollerTop=function(){var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],b=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),b=b>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:b;return a.scrollTop<b?!0:!1};
AdfDhtmlTableBasePeer.prototype._isScrollerBottom=function(){if(null==this.GetScroller())return!1;var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER];if(0==a.scrollTop)return!1;var b=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),b=b>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:b;AdfAgent.guessOS()==AdfAgent.ANDROID_OS&&(b=Math.ceil(a.offsetHeight/10));return a.scrollHeight-
a.scrollTop-a.offsetHeight<=b?!0:!1};
AdfDhtmlTableBasePeer.prototype._isScrollerRight=function(){if(null==this.GetScroller())return!1;var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER];if(0==a.scrollLeft)return!1;var b=a.scrollWidth-a.clientWidth,d=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),d=d>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:d;return b-a.scrollLeft<=d?!0:!1};
AdfDhtmlTableBasePeer.prototype._checkLoadMore=function(){if(this._isLoadMore){var a=AdfAgent.AGENT,b=this.getComponent(),d=this.GetDataBody();this._loadMoreAdjWidth=this._loadMoreFullWidth=d.style.width;if(this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY){var e=this.getDomElement();this._loadMoreAdjWidth=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(e.id,AdfDhtmlTableBasePeer._DATAWRAPPER)).style.width}var e=d.childNodes,f=this._getLoadMore(!1),g=this._getLoadMore(!0),
h=!1,k=!1,l=this.GetScroller();null!=l&&!this._hasSingleScroller()&&(l=l[AdfDhtmlTableBasePeer._VSCROLLER]);var m=0<this._getScrollbarWidth()?!0:!1,l=null==l?!1:l.scrollHeight>l.clientHeight?!0:!1;this._isScrollerBottom()||!m&&!l?this._checkMoreHasRows(d,!1)&&(h=!0):this._isScrollerTop()&&this._checkMoreHasRows(d,!0)&&(k=!0);if(h){if(this._isImplicitLoadMore&&!this._implicitLoadMoreFetched)this._loadMoreFetch(!0),this._implicitLoadMoreFetched=!0;else if(!this._isBottomLoadMoreDisplayed&&!this._isImplicitLoadMore){this._hShiftLoadMoreDataBody=
(m||l)&&d.scrollHeight+this._cachedFMHeight>=d.clientHeight?-1*this._cachedFMHeight+"px":"0px";d.style.top=parseInt(this._hShiftLoadMoreDataBody)+parseInt(this._hShiftDataBody)+"px";f.style.top=parseInt(this._hShiftLoadMoreDataBody)+parseInt(this._hShiftDataBody)+"px";f.style.display="block";f.style.width=this._loadMoreAdjWidth;this._isBottomLoadMoreDisplayed=!0;if(!this._bottomLoadMoreHeight){var n=f.offsetHeight;n&&(h=f.childNodes[0].childNodes[0].offsetHeight,h=Math.ceil((n-h)/2),this._isTouch?
(f=a.getElementById(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_LINK)),f.style.paddingTop=h+"px",f.style.display="inline-block"):f.childNodes[0].style.top=h+"px",this._bottomLoadMoreHeight=n)}!m&&!l&&this._adjustCanvasHeight(this._bottomLoadMoreHeight,d,!1)}m=e.length;d=e[0];m=e[m-1];this._updateLoadMoreItemsRangeText(d.startRow,m.startRow+m.numRows,this._knownRowCount,!1)}else this._isImplicitLoadMore&&this._implicitLoadMoreFetched?this._implicitLoadMoreFetched=
!1:this._isBottomLoadMoreDisplayed&&!this._isImplicitLoadMore&&(d.style.top="0px",f.style.top="0px",f.style.display="none",this._isBottomLoadMoreDisplayed=!1,this._hShiftLoadMoreDataBody="0px");if(k){if(this._isImplicitLoadMore&&!this._implicitLoadMoreFetched)this._loadMoreFetch(!1);else if(!this._isTopLoadMoreDisplayed&&!this._isImplicitLoadMore&&(g.style.display="block",g.style.width=this._loadMoreAdjWidth,this._isTopLoadMoreDisplayed=!0,!this._topLoadMoreHeight&&(k=g.offsetHeight)))h=g.childNodes[0].childNodes[0].offsetHeight,
h=Math.ceil((k-h)/2),this._isTouch?(a=a.getElementById(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_TOP_LINK)),a.style.paddingTop=h+"px",a.style.display="inline-block"):g.childNodes[0].style.top=h+"px",this._topLoadMoreHeight=k;m=e.length;d=e[0];m=e[m-1];this._updateLoadMoreItemsRangeText(d.startRow,m.startRow+m.numRows,this._knownRowCount,!0)}else this._isImplicitLoadMore&&this._implicitLoadMoreFetched?this._implicitLoadMoreFetched=!1:this._isTopLoadMoreDisplayed&&!this._isImplicitLoadMore&&
(g.style.display="none",this._isTopLoadMoreDisplayed=!1)}};AdfDhtmlTableBasePeer.prototype._checkMoreHasRows=function(a,b){for(var d=a.childNodes,e=d.length,f=0,g=!1,h=0;h<e;h++)null!=d[h].rows&&(f+=d[h].rows.length);if(0<f&&!this._allRowsAvailableOnClient(d,e))if(f=d[0],d=d[e-1],b&&0<f.startRow)g=!0;else if(!b&&(d.startRow+d.numRows<this.GetKnownRowCount()||0>this.GetRowCount()))g=!0;return g};
AdfDhtmlTableBasePeer.prototype._checkScrollbarHidingAffordance=function(){var a=this.GetDataBody();this._isScrollerBottom()?this._getScrollWidth()>this._getScrollerOffsetWidth()&&(this._hShiftDataBody=-1*(this._getScrollerOffsetHeight()-this._getScrollerClientHeight())-this._cachedCFHeight+"px",a.style.top=this._isBottomLoadMoreDisplayed?parseInt(this._hShiftDataBody)+parseInt(this._hShiftLoadMoreDataBody)+"px":this._hShiftDataBody):(this._hShiftDataBody="0px",a.style.top="0px")};
AdfDhtmlTableBasePeer.prototype._isViewportSatisfied=function(a,b){for(var d=a.childNodes,e=d.length,f=AdfDhtmlTableBasePeer.NO_BLOCKS,g=this._currentScrollTop,h=0,k=0;k<e;k++)h+=d[k].rows.length;if(0<h&&(f=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED,!this._allRowsAvailableOnClient(d,e))){var h=d[0],d=d[e-1],e=this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight,k=h.startPos-g,l=d.startPos+d.cachedHeight-g;if(0<k||0==g&&0<h.startRow)f|=AdfDhtmlTableBasePeer.MISSING_BEFORE;
if(this._isLoadMore)l<b&&(f|=AdfDhtmlTableBasePeer.MISSING_AFTER);else{if(l<b&&e>=b||g>=e-b&&d.startRow+d.numRows<this.GetKnownRowCount())f|=AdfDhtmlTableBasePeer.MISSING_AFTER;if(f!=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED&&(k>b||0>l))f=AdfDhtmlTableBasePeer.NO_BLOCKS}}return f};
AdfDhtmlTableBasePeer.prototype._addAbove=function(a,b,d,e){var f=a.childNodes,g=f.length,h=f[0];if(0==h.startRow){for(h=e=0;h<g;h++){var k=f[h],l=k.cachedHeight;k.startPos=e;e+=l}this._setScrollTop(0);this._fillViewPort(a,b,d)}else a=h.startRow,b=this._getBlockFirstRowKey(h),this._startFetch(AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE,a,b,d,!e)};
AdfDhtmlTableBasePeer.prototype._addBelow=function(a,b,d,e){var f=a.childNodes,g=f.length,h=f[g-1],k=h.startRow+h.numRows,l=this.GetRowCount();if(0<l&&k>=l){e=this._canvasHeight-b;h=this._canvasHeight;k=!1;for(g-=1;0<=g;g--)l=f[g],h-=l.cachedHeight,l.startPos!=h&&(k=!0,l.startPos=h);if(this._currentScrollTop!=e||k)this._setScrollTop(e),this._fillViewPort(a,b,d)}else a=k-1,b=this._getBlockLastRowKey(h),this._startFetch(AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE,a,b,d,!e)};
AdfDhtmlTableBasePeer.prototype._handleLongJump=function(a,b,d,e){var f,g,h,k,l,m=this.getComponent().getFetchSize();f=this._currentScrollTop;k=this.GetKnownRowCount();var n=AdfPage.PAGE.getLookAndFeel();h=this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight;g=-1==this.GetRowCount()||this._canvasHeightLimited?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:0;f>=h-g-b?(h=AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE,g=k-1,f=n.getTranslatedString("af_table.LABEL_END"),-1==
this.GetRowCount()&&(f=n.getTranslatedString("af_table.LABEL_ROW",g+1)),l=g,k=l-m+1):(h=AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE,0==f?(f=n.getTranslatedString("af_table.LABEL_START"),g=0):(g=Math.round(f/this._averageRowHeight),f=n.getTranslatedString("af_table.LABEL_ROW",g+1),AdfAssert.assert(g<k)),k=g,l=g+m-1);var p=a.childNodes;if(0<p.length){m=p[p.length-1];p=p[0].startRow;m=m.startRow+m.numRows;if(k>=p&&k<m){this._addBelow(a,b,d,e);return}if(l>=p&&l<m){this._addAbove(a,b,d,e);return}}d&&this.DisplayStatus(n.getTranslatedString("af_table.LABEL_GOING_TO",
f));this._startFetch(h,g,null,d,!e)};
AdfDhtmlTableBasePeer.prototype._deleteOffscreenBlocks=function(a,b,d){var e=this.getComponent(),f=this,g=a.childNodes,h=g.length,k,e=this._isLoadMore?e.getMaxClientRows():this._maxCachedRowsForTouch;if((this._isTouch||this._isLoadMore)&&0<h)if(k=g[h-1],k=k.startRow-g[0].startRow+k.numRows,k<=e)return;var l=!0;g[0]!=d&&(l=!1);var m=function(e,h){var k=g[e];if(k==d)return h;var l=k.startPos-n;if(0>l+k.cachedHeight||l>b){if(f._isLoadMore){l=k.startPos;0==l&&e+1<g.length&&(l=g[e+1].startPos);for(var m=
e+1;m<g.length;m++)g[m].startPos-=l;f._adjustCanvasHeight(-1*k.cachedHeight,a);0<f._currentScrollTop-l&&f._setScrollTop(f._currentScrollTop-l)}l=k.numRows;f._unregisterNode(k);a.removeChild(k);h-=l}return h},n=this._currentScrollTop;if(l||!this._isLoadMore)for(l=h-1;0<=l&&!((this._isTouch||this._isLoadMore)&&k<=e);l--)k=m(l,k);else for(l=0;l<h&&!(l>g.length-1||(this._isTouch||this._isLoadMore)&&k<=e);l++)k=m(l,k)};
AdfDhtmlTableBasePeer.prototype._unregisterNode=function(a){AdfPage.PAGE.removeComponentsInSubtree(a);AdfAgent.AGENT.elementsRemoved(a)};AdfDhtmlTableBasePeer.prototype._repositionBlocksForScroll=function(a){var b=a.firstChild,d=this._currentScrollTop;b&&(a.scrollTop=d-b.startPos);if((!this._isTouch||"Windows"==AdfAgent.guessOS())&&AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM)this._scrollTopUpdating=!0,setTimeout(AdfDhtmlTableBasePeer._resetScrollTopUpdating,100,this)};
AdfDhtmlTableBasePeer._resetScrollTopUpdating=function(a){a._scrollTopUpdating=!1};AdfDhtmlTableBasePeer.prototype._undoScroll=function(){var a=this.GetDataBody(),b=a.firstChild;b&&this._setScrollTop(b.startPos+a.scrollTop)};AdfDhtmlTableBasePeer.prototype._restoreSavedDisclosureState=function(){this.getComponent().setProperty("disclosedRowKeys",this._savedDisclosedState,!1,AdfUIComponent.PROPAGATE_NEVER);this._savedDisclosedState=void 0};
AdfDhtmlTableBasePeer.prototype._queueFetchEvent=function(a,b,d,e){var f=this._fetchId++,g=this.getComponent(),h=new AdfTableDataFetchEvent(g,f,b,d,e);h.setPartial(!0);h.setRenderOnly(a);var k=!1;a?AdfPage.PAGE.queueEventToServer(h):(g.queueEvent(h),k=h.isCanceled());k||(this._pendingFetch=b,this._pendingId=f,this._fetchIndex=d,this._fetchKey=e,this._pendingRenderOnly=a);return k?null:h};
AdfDhtmlTableBasePeer.prototype._checkViewportSize=function(a){var b=a.childNodes;0!=b.length&&(b=b[0],void 0!==b.numRows&&(a=Math.round(a.clientHeight/(b.offsetHeight/b.numRows)+0.5),b=this.getComponent(),this._isSyncRows&&b.setProperty("viewportSize",a,!1,AdfUIComponent.PROPAGATE_ALWAYS)))};
AdfDhtmlTableBasePeer.prototype._startFetch=function(a,b,d,e,f){a==this._pendingFetch&&b==this._fetchIndex&&d==this._fetchKey||(e?(e=new Function("var c \x3d arguments.callee;c._self._delayedNavigate(c._sTop, c._subtype, c._index, c._key, c._renderOnly);"),e._sTop=this._currentScrollTop,e._subtype=a,e._index=b,e._key=d,e._renderOnly=f,e._self=this,setTimeout(e,300),this.CancelPendingFetch()):(a=this._queueFetchEvent(f,a,b,d))?(b=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_FETCHING"),
this.DisplayStatus(b),AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait"),this._pruneKeyCache&&(a.setClientTokens(this._collectClientTokens(this._pruneKeyCache)),this._pruneKeyCache=null)):this._undoScroll())};AdfDhtmlTableBasePeer.prototype._delayedNavigate=function(a,b,d,e,f){this._currentScrollTop==a&&this._startFetch(b,d,e,!1,f)};AdfDhtmlTableBasePeer.prototype.CancelPendingFetch=function(){this._pendingRenderOnly=this._pendingId=this._fetchKey=this._fetchIndex=this._pendingFetch=void 0};
AdfDhtmlTableBasePeer.prototype.IsFetchPending=function(){return void 0!=this._pendingFetch};AdfDhtmlTableBasePeer.prototype.isDisclosureFetchPending=function(){return this._pendingFetch==AdfTableDataFetchEvent.EXPAND_SUBTYPE||this._pendingFetch==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE||this._pendingFetch==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE};
AdfDhtmlTableBasePeer.prototype._rowIndexToBlock=function(a){for(var b=this.GetDataBody().childNodes,d=0;d<b.length;d++){var e=b[d],f=e.startRow;if(a>=f&&a<=f+e.numRows)return e}return null};
AdfDhtmlTableBasePeer.prototype._splitBlock=function(a,b){AdfAssert.assert(0<=b);AdfAssert.assert(b<a.numRows);var d=a.cloneNode(!1);d.numRows=a.numRows-b;var e=AdfDomUtils.getFirstDescendentElement(a,"TBODY");AdfAssert.assert(null!=e,"Illegal State: data block with no tbody");for(var f=e.cloneNode(!1),g=a.rows,h=a.numRows-1;h>=b;h--){var k=g[h];e.removeChild(k);f.insertBefore(k,f.firstChild)}e=AdfAgent.AGENT;this._processColGroup()&&(h=AdfDomUtils.getFirstDescendentElement(a,"COLGROUP"))&&d.appendChild(h.cloneNode(!0));
d.appendChild(f);f=d.rows[0].cells;g=g[0].cells;h=f.length;for(k=0;k<h;k++)f[k].style.width=g[k].style.width;e.elementsAdded(d);a.numRows=b;a.cachedHeight=a.offsetHeight;return d};AdfDhtmlTableBasePeer.prototype._truncateBlock=function(a,b){AdfAssert.assert(0<=b);AdfAssert.assert(b<a.numRows);for(var d=a.rows,e=a.numRows-1;e>=b;e--)this._unregisterNode(d[e]),a.deleteRow(e);a.numRows=b;a.cachedHeight=a.offsetHeight};
AdfDhtmlTableBasePeer.prototype._insertBlockDom=function(a,b,d,e,f,g){var h=null;e-=b.startRow;0!=e&&(e<b.numRows&&(f==g?h=this._splitBlock(b,e):this._truncateBlock(b,e)),b=b.nextSibling);a.insertBefore(d,b);return h};
AdfDhtmlTableBasePeer.prototype.InsertBlock=function(a,b,d,e,f){this._initNewBlock(a,b,d);var g=this.GetDataBody(),h=g.offsetHeight;this._sizeBlockForFrozenColumns(a,g.offsetWidth);this._registerInnerScrollCallback(a);this._stretchLastBlockColumn(a);var k=this._rowIndexToBlock(b);AdfAssert.assert(k);var l=this._insertBlockDom(g,k,a,b,d,e);this.SetNewBlockScrollLeft(a);a.cachedHeight=a.offsetHeight;a.startPos=b==k.startRow?k.startPos:k.startPos+k.cachedHeight;this._synchronizeRowHeights(a);l&&(g.insertBefore(l,
a.nextSibling),l.cachedHeight=l.offsetHeight,this.SetNewBlockScrollLeft(l));if(d==e){for(k=a;l=k.nextSibling;)l.startRow=k.startRow+k.numRows,l.startPos=k.startPos+k.cachedHeight,k=l;k=a.cachedHeight}else{for(k=g.lastChild;a!=k;)this._unregisterNode(k),g.removeChild(k),k=g.lastChild;k=this._averageRowHeight*e}this._knownRowCount+=e;-1!=this._rowCount&&(this._rowCount+=e);this._adjustCanvasHeight(k,g);0==f&&(this.isHeightAutoSized()||this._deleteOffscreenBlocks(g,h,a),this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(g),
this.BlockInserted(a,b,d))};AdfDhtmlTableBasePeer.prototype._initNewBlock=function(a,b,d){a.style.position="relative";a.startRow=b;a.numRows=d};AdfDhtmlTableBasePeer.prototype.SetNewBlockScrollLeft=function(a){var b=this._currentScrollLeft;this._hasFrozenColumn()&&0!=b&&this._positionInnerTable(a,b)};
AdfDhtmlTableBasePeer.prototype._adjustCanvasHeight=function(a,b,d,e){if(0!=a){var f=this._canvasHeight;if(this._isPaged||this._isLoadMore)this._canvasHeight+=a;else{var g=this._canvasHeight+a,h=-1==this.GetRowCount()?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:0,k=this.GetKnownRowCount();this._averageRowHeight=Math.round((g-h)/k);this._canvasHeight=this._averageRowHeight*k+h}this._setFakeCanvasHeight(this._canvasHeight);if(e&&(e=this._canvasHeight/f,f=b.firstChild)){g=f.startPos;f.startPos=Math.round(f.startPos*
e);g=f.startPos-g;for(f=f.nextSibling;f;)f.startPos+=g,f=f.nextSibling;this._setScrollTop(Math.round(this._currentScrollTop*e))}this._currentScrollTop=this._getScrollTop()}if(0!=a||d)a=this.getDomElement(),this.SizeDataBody(b,a.clientWidth,a.clientHeight)};
AdfDhtmlTableBasePeer.prototype._checkForScrollableLastBlockInViewport=function(a){var b=a.lastChild,d=b.startPos,e=b.previousSibling;null!=e&&e.cachedHeight!=e.offsetHeight&&(d=e.startPos+e.offsetHeight,e.cachedHeight=e.offsetHeight,b.startPos=d);null!=b&&(this.GetRowCount()==b.startRow+b.numRows&&d+b.cachedHeight>this._canvasHeight)&&(this._canvasHeight=d+b.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight),b=this.getDomElement(),this.SizeDataBody(a,b.clientWidth,b.clientHeight))};
AdfDhtmlTableBasePeer.prototype.SizeDataBody=function(a,b,d){var e=AdfAgent.AGENT,f=this._getScrollbarWidth(),g=this._getScrollbarHeight();b=Math.max(0,b-f);this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(b+=f);a.style.width=b+"px";d=Math.max(0,d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight-g);this._checkLoadMore();this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(d+=g);a.style.height=d+"px";this._headerless||(f=this.__getColumnHeader().style,
f.width=a.style.width,0<g?f.borderRightWidth="":f.borderRightWidth="0px");this._footerless||(f=this._getColumnFooter().style,f.width=a.style.width,0<g?f.borderRightWidth="":f.borderRightWidth="0px");!this.IsEmpty&&this._hasFrozenColumn()&&this._sizeRegionsForFrozenColumns(a,b);this._dataBodyHeight=d;this._checkViewportSize(a);if(this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(a=this.getDomElement(),b=e.getElementById(AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlTableBasePeer._DATAWRAPPER))))g=
e=0,this._scrollbarHidden||(this._hasSingleScroller()&&!this._isPaged?(vscroller=this.GetScroller(),hscroller=this.GetScroller()):(vscroller=this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],hscroller=this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER]),null!=hscroller&&null!=hscroller&&(e=vscroller.offsetWidth-vscroller.clientWidth,g=hscroller.offsetHeight-hscroller.clientHeight)),b=b.style,b.height=a.offsetHeight-this._cachedCHHeight-this._cachedCFHeight-g+"px",b.width=a.offsetWidth-e+"px";
return d};AdfDhtmlTableBasePeer.prototype._getScrollbarWidth=function(){if(this.IsEmpty)return 0;var a=0,b=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)b=b[AdfDhtmlTableBasePeer._VSCROLLER];0<b.clientWidth&&(a=b.offsetWidth-b.clientWidth);return a};
AdfDhtmlTableBasePeer.prototype._getScrollbarHeight=function(){var a;if(this.IsEmpty)a=this.getDomElement(),a=a.offsetHeight-a.clientHeight;else{a=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)a=a[AdfDhtmlTableBasePeer._HSCROLLER];a=3<a.clientHeight?a.offsetHeight-a.clientHeight:0}return a};
AdfDhtmlTableBasePeer.prototype._handleDataCallback=function(a,b,d,e){var f=AdfAgent.AGENT,g=f.getIntAttribute(a,"_startRow",0),h=AdfDhtmlTableBasePeer._getBlockRowCount(a);if(b==AdfTableDataFetchEvent.EXPAND_SUBTYPE)return this.HandleExpand(a,h,e);if(b==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE)return this.HandleCollapse(a,g,e);if(b==AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW)return this.HandleClickToEditActiveRow(a,h,e);var k=this.GetDataBody();e=k.offsetHeight;var l=k.childNodes,m=l.length,n=this._currentScrollTop;
this._initNewBlock(a,g,h);0<h&&(this._sizeBlockForFrozenColumns(a,k.offsetWidth),this._registerInnerScrollCallback(a),this._stretchLastBlockColumn(a));this._handleDataCallbackBeingProcessed=!0;try{if(b==AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE||b==AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE){this.RemoveAllBlocks(k);k.appendChild(a);var p=a.offsetHeight;this._adjustRowCountFromResponse(k,a,h,p);d=0;if(n>=(this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight)-e||this._canvasHeightLimited&&
this.GetRowCount()==a.startRow+a.numRows)d=p-e;a.startPos=n-d;a.cachedHeight=p}else{if(b==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE){var q=l[m-1];if(0==h)if(-1==this.GetRowCount()){var r=f.getIntAttribute(q,"_rowCount",-1);this._rowCount=-1==r?this._knownRowCount:r;0==l[0].startPos&&q.startPos+q.cachedHeight<=this._canvasHeight&&(this._canvasHeight=q.startPos+q.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight))}else this._adjustRowCountFromResponse(k,a);else{a.startPos=q.startPos+q.cachedHeight;
k.appendChild(a);a.cachedHeight=a.offsetHeight;var s=g-q.startRow-q.numRows;0!=s&&this.ShiftIndex(q,s,!1);this._adjustRowCountFromResponse(k,a);if(0!=s&&!this.IsReceivingActiveEvents())for(var u=q;u;){var t=u.previousSibling;this._unregisterNode(u);k.removeChild(u);u=t}var v=g+h-this.GetKnownRowCount();if(0<v){this._knownRowCount+=v;var w=a.cachedHeight;if(v<h)for(var w=0,z=a.rows,g=h-v;g<h;g++)w+=z[g].offsetHeight;this._adjustCanvasHeight(w,k)}else this._checkForScrollableLastBlockInViewport(k),
this._isLoadMore&&(a&&0<a.cachedHeight)&&(w=a.cachedHeight,this._adjustCanvasHeight(w,k));l=k.childNodes;m=l.length;this._allRowsAvailableOnClient(l,m)&&(q=l[m-1],this._canvasHeight=q.startPos+q.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight))}}else if(b==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE){var y=l[0];k.insertBefore(a,y);var A=a.offsetHeight;a.cachedHeight=A;if(this._isLoadMore){a.startPos=0;for(p=1;p<l.length;p++)l[p].startPos+=A;w=a.cachedHeight;this._adjustCanvasHeight(w,k)}else a.startPos=
y.startPos-A;s=g-y.startRow+h;0!=s&&this.ShiftIndex(y,s,!0);var B=this._adjustRowCountFromResponse(k,a);if((0!=s||0!=B)&&!this.IsReceivingActiveEvents())for(u=y;u;)t=u.nextSibling,this._unregisterNode(u),k.removeChild(u),u=t}d||this._deleteOffscreenBlocks(k,e,a);this._isLoadMore&&(a&&0<a.cachedHeight)&&this._checkLoadMore();this._repositionBlocksForScroll(k);this._processSelectionRequest();null!=this._clickEditRequest&&this._processClickToEditActivateRequest()}}finally{delete this._handleDataCallbackBeingProcessed}0!=
h&&(this.SetNewBlockScrollLeft(a),this._synchronizeRowHeights(a));this.UpdateRange(!1);return!0};
AdfDhtmlTableBasePeer.prototype._adjustRowCountFromResponse=function(a,b,d,e){var f=0,g=this.GetRowCount();if(-1!=g){var h=AdfAgent.AGENT.getIntAttribute(b,"_rowCount",-1);0==this._unavailableRowIndex?h=-1:0<this._unavailableRowIndex&&(h=this._unavailableRowIndex);-1!=h&&(f=h-g)}0!=f&&(this._rowCount=this._knownRowCount=h,this._adjustCanvasHeight(void 0!=d&&void 0!=e&&d==h?e-this._averageRowHeight*g:this._averageRowHeight*f,a,!1));return f};
AdfDhtmlTableBasePeer.prototype.HandleExpand=function(a,b,d){return this._handleExpandCollapse(a,d,!0)};AdfDhtmlTableBasePeer.prototype.HandleCollapse=function(a,b,d){return this._handleExpandCollapse(a,d,!1)};
AdfDhtmlTableBasePeer.prototype._handleExpandCollapse=function(a,b,d){var e=a.getAttribute("_startKey"),f=null;e&&(f=this.FindRowByKey(e));if(f){var g=AdfPage.PAGE,h=f.tr,e=f.block;this._changeDetailIcon(h,d);var k=e.cachedHeight,f=null,l;g.isAnimationEnabled()&&!this.isHeightAutoSized()&&(l=parseInt(g.getLookAndFeel().getSkinProperty("af|table-tr-detail-animation-duration")));d?(g=h.cells.length,a=a.rows[0],1<g&&(a.cells[0].colSpan=g),a.parentNode.removeChild(a),h.parentNode.insertBefore(a,h.nextSibling),
AdfAgent.AGENT.elementsAdded(a),0<l&&(f=a.cells[0])):(a=h.nextSibling,AdfAgent.getAgent().getAttribute(a,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)?(this._unregisterNode(a),0<l?(a.style.display="none",f=a.cells[0]):a.parentNode.removeChild(a)):AdfLogger.LOGGER.severe("Unable to locate detail row"));a=e.offsetHeight;e.cachedHeight=a;k=a-k;for(e=e.nextSibling;e;)e.startPos+=k,e=e.nextSibling;e=this.GetDataBody();this._adjustCanvasHeight(k,e);0==b&&(this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(e));
null!=f&&this._doDisclosureAnimation(f,l,d);return!0}return!1};
AdfDhtmlTableBasePeer.prototype._doDisclosureAnimation=function(a,b,d){var e=a.ownerDocument,e=d?e.createElement("div"):a.firstChild,f=e.style,g=0;if(d){f.overflow="hidden";f.height="1px";f.position="relative";g=AdfAgent.AGENT.getComputedStyle(a);f=AdfAgent.getCSSLengthAsInt;g=a.clientHeight-f(g.paddingTop)-f(g.paddingBottom);for(f=a.firstChild;f;)e.appendChild(f),f=a.firstChild;a.appendChild(e)}else a.parentNode.style.display="";AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,b,
[{element:e,properties:{height:g}}],null,!d?AdfDhtmlTableBasePeer.CollapseAnimationComplete:null,!d?{wrapper:a.parentNode,peer:this}:null)};AdfDhtmlTableBasePeer.CollapseAnimationComplete=function(a){var b=a.wrapper;a=a.peer;b.parentNode.removeChild(b);a._insertDeleteAnimationInEffect=!1;a&&(a.SetAnimating(!1),a.delayedResizeNotify&&(a.delayedResizeNotify(),a.delayedResizeNotify=null),a.AdjustAutoHeight())};AdfDhtmlTableBasePeer.prototype.SetAnimating=function(a){this._animating=a};
AdfDhtmlTableBasePeer.prototype.BusyAnimating=function(){return this._animating};
AdfDhtmlTableBasePeer.prototype.HandleClickToEditActiveRow=function(a,b,d){delete this._oldActiveRowKey;if(0<b){b=this._columnStretching;null!=b&&"none"!=b&&(this._sizeBlockForFrozenColumns(a,this.GetDataBody().offsetWidth),this._stretchLastBlockColumn(a));b=a.rows;a=b[0];b=1<b.length&&this._hasDetailStamp?b[1]:null;var e=AdfAgent.AGENT.getAttribute(a,AdfDhtmlTableBasePeer._ROW_KEY);this._replaceRowByKey(e,a,b);0==d&&this._handleClickToEditActiveRowAfter();return!0}0==d&&this._handleClickToEditActiveRowAfter();
return!1};
AdfDhtmlTableBasePeer.prototype._copyCellWidths=function(a,b){AdfAssert.assert(null!=a,"Unable to copy cell widths if the given source row is invalid!");AdfAssert.assert(null!=b,"Unable to copy cell widths if the target row is invalid!");for(var d=null,e=null,f=a.cells,g=b.cells,h=f.length,k=0;k<h;k++)d=f[k],e=g[k],e.style.width=d.style.width;if(0<=this._lastFrozen){var l=this._getNestedScrolledTable(a),m=this._getNestedScrolledTable(b);if(this._processColGroup()&&(f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(l,"COLGROUP"),
d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(m,"COLGROUP"),f&&d)){f=f.childNodes;g=d.childNodes;h=f.length;for(k=0;k<h;k++)d=f[k],e=g[k],"COL"==d.tagName&&"COL"==e.tagName&&(e.style.width=d.style.width)}f=l.rows[0].cells;g=m.rows[0].cells;h=f.length;for(k=0;k<h;k++)d=f[k],e=g[k],e.style.width=d.style.width}};
AdfDhtmlTableBasePeer.prototype._replaceRowByKey=function(a,b,d){var e=AdfAgent.AGENT;if(a=this.FindRowByKey(a)){var f=a.tr;a=a.block;var g=a.cachedHeight;this._copyCellWidths(f,b);this._unregisterNode(f);f.parentNode.replaceChild(b,f);e.elementsAdded(b);d&&(f=b.nextSibling,e.getAttribute(f,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)&&(this._unregisterNode(f),f.parentNode.replaceChild(d,f),e.elementsAdded(d),d.cells[0].colSpan=b.cells.length));d=a.offsetHeight;a.cachedHeight=d;d-=g;for(e=a.nextSibling;e;)e.startPos+=
d,e=e.nextSibling;this._hasFrozenColumn()&&(cells=b.cells,b=this._freezeColumnsToEnd()?cells[0]:cells[cells.length-1],AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").onscroll=this._innerTableScrollCallback);this._adjustCanvasHeight(d,this.GetDataBody(),!0)}};
AdfDhtmlTableBasePeer.prototype._handleClickToEditActiveRowAfter=function(){this._stretchTheColumns();var a=this._currentScrollLeft;0!=a&&this._handleHorizontalScroll(a);this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!0,10)};AdfDhtmlTableBasePeer.prototype.SetFirst=function(a){this.getComponent().setProperty("first",a,!1,AdfUIComponent.PROPAGATE_ALWAYS)};AdfDhtmlTableBasePeer.prototype.SetRows=function(a){this.getComponent().setRows(a)};
AdfDhtmlTableBasePeer.prototype.UpdateRange=function(a){var b=this.getComponent();AdfPage.PAGE.unmapDescendantComponentAbsoluteLocators(b);if(!this._isPaged){var d=this.GetDataBody().childNodes;if(0!=d.length){var e=d[0].startRow,d=d[d.length-1],d=d.startRow+d.numRows-e;this.SetFirst(e);this.SetRows(d);e=this.GetFirstVisibleRowKeyAndRow();null!=e.rowKey&&!a&&b.setProperty("scrollTopRowKey",e.rowKey,!0,AdfUIComponent.PROPAGATE_ALWAYS)}}};
AdfDhtmlTableBasePeer.prototype._checkStart=function(a){a=a.childNodes;if(!(1>a.length)){var b=a[0],d=b.startPos;if(0>d){this._setScrollTop(this._currentScrollTop-b.startPos);for(b=0;b<a.length;b++)a[b].startPos-=d}}};
AdfDhtmlTableBasePeer.prototype._checkEnd=function(a){var b=a.childNodes;if(!(1>b.length)){var d=b[b.length-1],d=d.startPos+d.cachedHeight-this._canvasHeight;if(-1==this.GetRowCount()||this._canvasHeightLimited&&0>d)d+=AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,this._canvasHeightLimited&&0>d&&(d=0);if(0<d){this._setScrollTop(this._currentScrollTop-d);for(var e=0;e<b.length;e++)b[e].startPos-=d}-1==this.GetRowCount()&&(a=this._canvasHeight-a.offsetHeight-AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,
this._currentScrollTop>a&&this._setScrollTop(a))}};
AdfDhtmlTableBasePeer.prototype._processSelectionRequest=function(){var a=this._selectionRequest,b=null;if(null!=a){if(a==AdfDhtmlTableBasePeer._SELECT_PAGE_UP)b=this.GetFirstVisibleRowKeyAndRow();else if(a==AdfDhtmlTableBasePeer._SELECT_PAGE_DOWN)b=this._getLastVisibleRowKeyAndRow();else if(a==AdfDhtmlTableBasePeer._SELECT_ARROW_DOWN||a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN||a==AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN)b=this._getNextRowKeyAndRow(this._lastRowKeyInView);else if(a==AdfDhtmlTableBasePeer._SELECT_ARROW_UP||
a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP||a==AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP)b=this._getPreviousRowKeyAndRow(this._lastRowKeyInView);var d=b.rowKey,b=b.row;null!=d&&(a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP||a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN?(a=this.GetRowHeaderCellFromRow(b),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,d,a)):(a!=AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP&&a!=AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN&&this._selSelectRow(d,b),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
d,b)),this._unclipRow(b));delete this._selectionRequest}};
AdfDhtmlTableBasePeer.prototype.DisplayStatus=function(a,b){var d=this._getStatusMessage();if(d){d.innerHTML=a;var e=d.style;if("none"==e.display){e.zIndex=5E3;var f=this.GetDataBody();e.visibility="hidden";e.display="block";var g;g=this._virtInitialized?f.offsetHeight:this.getDomElement().clientHeight-this._cachedCHHeight;e.top=this._cachedCHHeight+Math.floor((g-d.offsetHeight)/2)+"px";g="25px";b&&(g=Math.floor(f.offsetWidth/2-d.offsetWidth/2)+"px");AdfDhtmlTableBasePeer._isRTL()?e.left=g:e.right=
g;e.visibility="visible"}}};AdfDhtmlTableBasePeer.prototype._hideStatus=function(){var a=this._getStatusMessage();a&&this._hideElement(a)};
AdfDhtmlTableBasePeer.prototype._hideElement=function(a){var b=AdfAgent.AGENT,d=this.GetScroller(),e=this._hasScroller(d)&&b.getPlatform()==AdfAgent.IE_PLATFORM&&8<=b.getVersion(),f;if(e)if(AdfCollections.isArray(d)){f=[];for(var g=0;g<d.length;g++)f[g]={x:b.getScrollLeft(d[g]),y:d[g].scrollTop}}else f={x:b.getScrollLeft(d),y:d.scrollTop};a.style.display="none";if(e)if(AdfCollections.isArray(d))for(g=0;g<d.length;g++)b.setScrollLeft(d[g],f[g].x),d[g].scrollTop=f[g].y;else b.setScrollLeft(d,f.x),d.scrollTop=
f.y};AdfDhtmlTableBasePeer.prototype._hasScroller=function(a){if(AdfCollections.isArray(a)){for(var b=0;b<a.length;b++)if(null!=a[b])return!0;return!1}return null!=a};AdfDhtmlTableBasePeer.prototype.GetDataBody=function(a){if(this._dataBodyWrapped){a=this.__getElemBySubId(AdfDhtmlTableBasePeer._DATAWRAPPER,a).childNodes;for(var b=0;b<a.length;b++)if(null!=a[b].id&&0<a[b].id.indexOf("db"))return a[b];return null}return this.__getElemBySubId("db",a)};
AdfDhtmlTableBasePeer.prototype._getStatusMessage=function(){return this.__getElemBySubId("sm")};AdfDhtmlTableBasePeer.prototype._getColumnResizeIndicator=function(){return this.__getElemBySubId("ri")};AdfDhtmlTableBasePeer.prototype.__getColumnHeader=function(){return this.__getElemBySubId("ch")};AdfDhtmlTableBasePeer.prototype._getColumnFooter=function(){return this.__getElemBySubId("cf")};AdfDhtmlTableBasePeer.prototype._getNavigationBar=function(){return this.__getElemBySubId("nbar")};
AdfDhtmlTableBasePeer.prototype._getLoadMore=function(a){var b=this.getDomElement();if(this._dataBodyWrapped){var d=this.getDomElement();(d=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(d.id,AdfDhtmlTableBasePeer._DATAWRAPPER)))&&1<d.childNodes.length&&(b=d)}b=b.childNodes;for(d=0;d<b.length;d++)if(null!=b[d].id&&0<b[d].id.indexOf(a?AdfDhtmlTableBasePeer._LOAD_MORE_TOP_DIV:AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_DIV))return b[d];return null};
AdfDhtmlTableBasePeer.prototype._setFakeCanvasWidth=function(a){var b=this.GetScroller();if(this._hasSingleScroller()&&!this._isPaged)AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").style.width=a+"px";else{var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[0],"DIV");AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[1],"DIV").style.width=d.style.width=a+"px"}};
AdfDhtmlTableBasePeer.prototype._setFakeCanvasHeight=function(a){var b=this.GetScroller();a>AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT?(a=AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT,this._canvasHeightLimited=!0):this._canvasHeightLimited=!1;if(this._hasSingleScroller()&&!this._isPaged){var d=b.scrollTop;AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").style.height=a+"px";b.scrollTop=d}else d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[0],"DIV"),AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[1],
"DIV").style.height=d.style.height=a+"px"};AdfDhtmlTableBasePeer.prototype.GetScroller=function(){if(this._hasSingleScroller()&&!this._isPaged)return this.__getElemBySubId("scroller");var a=[];a[AdfDhtmlTableBasePeer._HSCROLLER]=this.__getElemBySubId("hscroller");a[AdfDhtmlTableBasePeer._VSCROLLER]=this.__getElemBySubId("vscroller");return a};
AdfDhtmlTableBasePeer.prototype._scrollerScrollToPos=function(a,b){var d=AdfAgent.getAgent(),e=null!=a&&AdfDhtmlTableBasePeer._isRTL()&&d.getPlatform()==AdfAgent.IE_PLATFORM&&7<d.getVersion();if(this._hasSingleScroller()&&!this._isPaged){var f=this.GetScroller();e&&(a=f.scrollWidth-f.clientWidth-a);d.scrollToPos(f,a,b)}else{var f=this.GetScroller(),g=f[AdfDhtmlTableBasePeer._HSCROLLER];e&&(a=g.scrollWidth-g.clientWidth-a);d.scrollToPos(f[AdfDhtmlTableBasePeer._HSCROLLER],a,b);d.scrollToPos(f[AdfDhtmlTableBasePeer._VSCROLLER],
a,b)}};AdfDhtmlTableBasePeer.prototype.__getScrollerDimensions=function(){return{offsetWidth:this._getScrollerOffsetWidth(),offsetHeight:this._getScrollerOffsetHeight(),clientWidth:this._getScrollerClientWidth(),clientHeight:this._getScrollerClientHeight()}};AdfDhtmlTableBasePeer.prototype._getScrollerOffsetWidth=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().offsetWidth:this.GetScroller()[0].offsetWidth};
AdfDhtmlTableBasePeer.prototype._getScrollerOffsetHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().offsetHeight:this.GetScroller()[1].offsetHeight};AdfDhtmlTableBasePeer.prototype._getScrollerClientWidth=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().clientWidth:this.GetScroller()[0].clientWidth};
AdfDhtmlTableBasePeer.prototype._getScrollerClientHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().clientHeight:this.GetScroller()[1].clientHeight};AdfDhtmlTableBasePeer.prototype._getVerticalScrollBarWidth=function(){var a=this.GetScroller();return this._footerless&&!this._isPaged?a.offsetWidth-a.clientWidth:a[1].offsetWidth-a[1].clientWidth};
AdfDhtmlTableBasePeer.prototype._setScrollerTop=function(a){if(this._hasSingleScroller()&&!this._isPaged)this.GetScroller().style.top=a+"px";else{var b=this.GetScroller();b[0].style.top=b[1].style.top=a+"px"}};
AdfDhtmlTableBasePeer.prototype._setScrollerHeight=function(a,b,d,e){if(this._hasSingleScroller()&&!this._isPaged){var f=Math.max(0,a-b-e);this.GetScroller().style.height=f+"px"}else{var g=this.GetScroller(),f=Math.max(0,a-b);g[0].style.height=f+"px";var h=g[0].offsetHeight-g[0].clientHeight,f=Math.max(0,a-b-d-e-h);this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(f+=h);g[1].style.height=f+"px"}};
AdfDhtmlTableBasePeer.prototype._setScrollerWidth=function(a,b){if(this._hasSingleScroller()&&!this._isPaged){var d=Math.max(a-b,0),e=this.GetScroller().style;e.overflowX="auto";e.width=d+"px"}else{var f=this.GetScroller(),d=Math.max(a-b,0);f[1].style.overflowX="hidden";f[1].style.width=d+"px";e=0;0<f[1].clientWidth&&(e=f[1].offsetWidth-f[1].clientWidth);d=Math.max(a-b-e,0);f=f[0].style;f.overflowX="auto";f.width=d+"px";this._freezeColumnsToEnd()||(AdfDhtmlTableBasePeer._isRTL()?f.left=e+"px":f.right=
e+"px")}};AdfDhtmlTableBasePeer.prototype._setScrollLeft=function(a){var b=AdfAgent.AGENT;this._currentScrollLeft=a;if(this._hasSingleScroller()&&!this._isPaged){var d=this.GetScroller();b.getScrollLeft(d)!=a&&b.setScrollLeft(d,a)}else d=this.GetScroller(),b.getScrollLeft(d[0])!=a&&b.setScrollLeft(d[0],a)};
AdfDhtmlTableBasePeer.prototype.__getScrollLeft=function(){var a=AdfAgent.AGENT;if(this._hasSingleScroller()&&!this._isPaged)a=a.getScrollLeft(this.GetScroller());else var b=this.GetScroller(),a=a.getScrollLeft(b[0]);return a};AdfDhtmlTableBasePeer.prototype.__getCurrentScrollLeft=function(){return this._currentScrollLeft};
AdfDhtmlTableBasePeer.prototype._setScrollTop=function(a){this._currentScrollTop=a;if(this._hasSingleScroller()&&!this._isPaged){var b=this.GetScroller();b.scrollTop!=a&&(b.scrollTop=a)}else b=this.GetScroller(),b[1].scrollTop!=a&&(b[1].scrollTop=a);if((!this._isTouch||"Windows"==AdfAgent.guessOS())&&AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM)this._scrollTopUpdating=!0,setTimeout(AdfDhtmlTableBasePeer._resetScrollTopUpdating,100,this)};
AdfDhtmlTableBasePeer.prototype.__getScrollDimensions=function(){return{scrollLeft:this.__getScrollLeft(),scrollTop:this._getScrollTop(),scrollHeight:this._getScrollHeight(),scrollWidth:this._getScrollWidth()}};AdfDhtmlTableBasePeer.prototype._getScrollTop=function(){var a;if(this._hasSingleScroller()&&!this._isPaged)a=this.GetScroller().scrollTop;else{a=this.GetScroller();var b=AdfAgent.AGENT;a=this._isTouch&&b.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&b.getOS()==AdfAgent.MAC_OS?a[0].scrollTop:a[1].scrollTop}return a};
AdfDhtmlTableBasePeer.prototype._getScrollHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().scrollHeight:this.GetScroller()[1].scrollHeight};AdfDhtmlTableBasePeer.prototype._getScrollWidth=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().scrollWidth:this.GetScroller()[0].scrollWidth};AdfDhtmlTableBasePeer.prototype.__getLastFrozen=function(){return this._lastFrozen};AdfDhtmlTableBasePeer.prototype.__getFirstFrozen=function(){return this._firstFrozen};
AdfDhtmlTableBasePeer.prototype.__getElemBySubId=function(a,b){var d=this.getDomElement();null==d&&(d=b);return AdfDhtmlTableBasePeer.__getChildBySubId(d,a)};AdfDhtmlTableBasePeer.__getChildBySubId=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot get a child by sub ID if the parent is null!");for(var d=a.id+"::"+b,e=a.childNodes,f=0;f<e.length;f++)if(d==e[f].id)return e[f];return null};AdfDhtmlTableBasePeer.prototype.GetRowCount=function(){return this._rowCount};
AdfDhtmlTableBasePeer.prototype.GetKnownRowCount=function(){return this._knownRowCount};AdfDhtmlTableBasePeer.prototype.getClientStartRowIndex=function(){var a=this.GetDataBody();return a&&a.childNodes&&0<a.childNodes.length?a.childNodes[0].startRow:-1};AdfDhtmlTableBasePeer.prototype.getClientRowCount=function(){var a=0,b=this.GetDataBody();if(b&&b.childNodes)for(var d=0;d<b.childNodes.length;d++)a+=b.childNodes[d].numRows;return a};
AdfDhtmlTableBasePeer.prototype.simulateSelectRows=function(a,b){for(var d,e,f,g="toggle"==b,h=a.split(","),k=0;k<h.length;k++)if(e=h[k],d=this.FindRowByKey(e))if(f=this.FindCellByIndex(d.tr,0))this._handleRowMouseDown(null,f,!0,g,!1,e,d.tr),this._handleRowClick(f,!0,g,!1,e,d.tr),g=!0};
AdfDhtmlTableBasePeer.prototype._synchronizeRowHeights=function(a){if(this._hasFrozenColumn()){var b=a.startPos,d=a._lastSyncRow,e=this._dataBodyHeight,f=a.rows,g=f.length,h=this._currentScrollTop;if(!(null!=d&&d==g-1)&&!(b>h+e)&&!this._areAllColumnsFrozen(f[0].cells.length)){for(var k=0;k<g;k++)if(!(null!=d&&d>=k)){var l=f[k],m=this._getNestedScrolledTable(l),n=l.offsetHeight;if(m.offsetHeight!=n){var p=AdfAgent.AGENT,q=p.getPlatform()==AdfAgent.IE_PLATFORM,p=p.getPlatform()==AdfAgent.WEBKIT_PLATFORM;
q||p?m.style.height="auto":m.rows[0].style.height="auto";q||p?m.style.height=n+"px":m.rows[0].style.height=n+"px"}if(b+l.offsetTop+n>h+e){a._lastSyncRow=k;return}}a._lastSyncRow=g-1}}};
AdfDhtmlTableBasePeer.prototype._showColumnResizeIndicator=function(a,b){var d=this._getColumnResizeIndicator();if(d){var e=!AdfDhtmlTableBasePeer._isRTL(),d=d.style;d.display="block";d.zIndex=20;d.top="0px";if(e){if(e=a.offsetLeft+a.offsetWidth,this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?e+=this._frozenWidth:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(e+=this._getUnfrozenColumnsWidth()),!this._hasFrozenColumn()||!this._isColumnFrozen(b))e-=this._currentScrollLeft}else if(e=a.offsetLeft,
this._freezeColumnsToStart()&&this._isColumnFrozen(b))e+=this.getDomElement().offsetWidth-a.parentNode.parentNode.offsetWidth;else if(this._freezeColumnsToEnd()&&!this._isColumnFrozen(b))e+=this._frozenWidth;else{for(var f=a.parentNode;f&&"TABLE"!=f.tagName;)f=f.parentNode;if(f&&"TABLE"==f.tagName){for(var g=f.offsetWidth,h=f.offsetLeft;f&&"DIV"!=f.tagName;)f=f.parentNode;f&&"DIV"==f.tagName&&f.offsetWidth>g&&(e+=h)}e-=this._getRTLScrollAdjustment();this._getScrollHeight()>this._getScrollerOffsetHeight()&&
(e+=this._getVerticalScrollBarWidth())}d.left=e+"px";d.height=this._cachedCHHeight+this._cachedCFHeight+this._cachedNBHeight+this._cachedFMHeight+this.GetDataBody().offsetHeight+"px"}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderFooterSizingCell=function(a,b,d,e,f){if(!this._hasFrozenColumn()||this._isColumnFrozen(a))return f=AdfDhtmlTableBasePeer.__getChildBySubId(b,d),this._freezeColumnsToEnd()?f.rows[0].cells[a-this._firstFrozen]:f.rows[0].cells[a];b=AdfDhtmlTableBasePeer.__getChildBySubId(b,e);f=AdfDhtmlTableBasePeer.__getChildBySubId(b,f);return this._freezeColumnsToStart()?f.rows[0].cells[a-this._lastFrozen-1]:f.rows[0].cells[a]};
AdfDhtmlTableBasePeer.prototype._getResizedCellInfo=function(a){var b=AdfAgent.AGENT,d=a.cell;AdfDhtmlTableBasePeer._isRTL();var e=b.getIntAttribute(d,"_d_index",-1);"start"==a.data?e--:e+=b.getIntAttribute(d,"colspan",1)-1;a=this._getColumnHeaderFooterSizingCell(e,this.__getColumnHeader(),"t","d2","t2");return b.getAttribute(a,AdfDhtmlTableBasePeer.NO_RESIZE_MARKER,!1)?null:{cell:a,displayIndex:e}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderLeafCell=function(a){var b=this.__getColumnHeader();if(!b)return null;var d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"),e=Array(d);this._hasFrozenColumn()&&(b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t2"),e.push(b));for(var b=AdfAgent.AGENT,f=AdfDhtmlTableBasePeer._LEAF_COLUMN,g=null,d=d.rows.length-1;0<=d&&!g;d--)for(var h=0;h<e.length;h++)for(var k=e[h].rows[d].cells,l=0;l<k.length&&!g;l++){var m=
k[l];if(m.getAttribute(f)&&b.getIntAttribute(m,"_d_index",-1)==a){g=m;break}}return g};
AdfDhtmlTableBasePeer.prototype._synchronizeColumnRowHeights=function(a,b,d,e){if(this._hasFrozenColumn()){var f=AdfAgent.AGENT,g=f.getPlatform()==AdfAgent.WEBKIT_PLATFORM,h=f.getPlatform()==AdfAgent.IE_PLATFORM&&8==f.getVersion();b=AdfDhtmlTableBasePeer.__getChildBySubId(a,b);a=AdfDhtmlTableBasePeer.__getChildBySubId(a,d);e=AdfDhtmlTableBasePeer.__getChildBySubId(a,e);a=b.rows;d=e.rows;b.style.height=e.style.height="auto";for(var k=0;k<a.length;k++)a[k].style.height=d[k].style.height="auto";for(k=
0;k<a.length;k++)if(h){for(var l=-1,m=0;m<a[k].cells.length;m++)if(a[k].cells[m].rowSpan&&1==a[k].cells[m].rowSpan){l=m;break}for(var m=-1,n=0;n<d[k].cells.length;n++)if(d[k].cells[n].rowSpan&&1==d[k].cells[n].rowSpan){m=n;break}var p=n=0;-1<l&&(n=a[k].cells[l].offsetHeight);-1<m&&(p=d[k].cells[m].offsetHeight);n>p?f.setTableRowHeight(d[k],n):p>n&&f.setTableRowHeight(a[k],p)}else l=a[k].offsetHeight,m=d[k].offsetHeight,l>m?f.setTableRowHeight(d[k],l):m>l&&f.setTableRowHeight(a[k],m);f=Math.max(b.offsetHeight,
e.offsetHeight);e.style.height=b.style.height=f+"px";if(g&&2==d.length){for(k=0;k<d[0].cells.length;k++)d[1].cells[k].rowSpan="10";for(k=0;k<a[0].cells.length;k++)a[1].cells[k].rowSpan="10"}}};AdfDhtmlTableBasePeer.prototype._getInnerTableCell=function(a,b){var d=this._getNestedScrolledTable(a).rows[0];return this._freezeColumnsToStart()?d.cells[b-this._lastFrozen-1]:d.cells[b]};
AdfDhtmlTableBasePeer._handleMouseWheel=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfDhtmlTableBasePeer.__getChildBySubId(this.parentNode,"scroller");b||(b=AdfDhtmlTableBasePeer.__getChildBySubId(this.parentNode,"vscroller"));if(b){var d=AdfAgent.AGENT,e=null,f=null,g=a.deltaX,h=a.deltaY,k=a.wheelDeltaX,l=a.wheelDeltaY,m=a.deltaMode;null!=g||null!=h?(d=d.getPlatform()==AdfAgent.IE_PLATFORM?40:1,null!=g&&(e=g/d),null!=h&&(f=h*(1==m?33:1))):(null!=k&&(e=-k/4),null!=l&&(f=-l/4),null==
k&&null==l&&(f=null==a.wheelDelta?4*a.detail:-a.wheelDelta/4));null!=f&&0!=f&&(b.scrollTop+=Math.round(f),g=b.offsetHeight,h=b.scrollHeight,m=b.scrollTop,(0<f&&h-m>g||0>f&&0<m)&&AdfAgent.AGENT.eatEvent(a));null!=e&&0!=e&&(b.scrollLeft+=Math.round(e),AdfAgent.AGENT.eatEvent(a))}};
AdfDhtmlTableBasePeer.prototype._positionInnerTable=function(a,b){var d=AdfAgent.AGENT,e=a.rows;AdfDhtmlTableBasePeer._isRTL();for(var f=this._freezeColumnsToEnd(),g=0;g<e.length;g++){var h=e[g].cells;(h=AdfDhtmlTableBasePeer.FindFirstChildByTagName(f?h[0]:h[h.length-1],"DIV"))&&d.setScrollLeft(h,b)}};AdfDhtmlTableBasePeer._scrollColumnHeader=function(a,b){var d=AdfDhtmlTableBasePeer.__getChildBySubId(a,"d2");AdfAgent.AGENT.setScrollLeft(d,b)};
AdfDhtmlTableBasePeer._scrollColumnFooter=function(a,b){var d=AdfDhtmlTableBasePeer.__getChildBySubId(a,"fd2");AdfAgent.AGENT.setScrollLeft(d,b)};AdfDhtmlTableBasePeer.FindFirstChildByTagName=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot find first child by tag name if the parent is null!");for(var d=a.childNodes,e=0;e<d.length;e++)if(b==d[e].tagName)return d[e];return null};
AdfDhtmlTableBasePeer._findFirstLevelChildrenByTagName=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot find first level children by tag name if the parent is null!");for(var d=[],e=a.childNodes,f=0;f<e.length;f++)b==e[f].tagName&&d.push(e[f]);return d};
AdfDhtmlTableBasePeer.prototype.GetRowKeyAndRow=function(a,b){AdfAssert.assertDomElement(a);var d=a,e=AdfAgent.AGENT;if(null==d||1!=d.nodeType)return null;for(var f=e.getAttribute(d,AdfDhtmlTableBasePeer._ROW_KEY);null==f;){if(null==d||d==b)return null;d=d.parentNode;if(!this._isClickToEdit()&&(this._hasDetailStamp&&"TR"==e.getNodeName(d)&&e.getAttribute(d,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))&&(f=e.getAttribute(d.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY),null!=f))break;if(null==d||
1!=d.nodeType)return null;f=e.getAttribute(d,AdfDhtmlTableBasePeer._ROW_KEY)}return[f,d]};
AdfDhtmlTableBasePeer.prototype._hideDragColumnFooter=function(a,b){var d=this._lastFrozen,e=this._firstFrozen,f=this._reorderColWidth,g=this._reorderHiddenCells,h=this._getColumnFooter(),k=null;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(k=AdfDhtmlTableBasePeer.__getChildBySubId(h,"fd2"),h=AdfDhtmlTableBasePeer.__getChildBySubId(k,"ft2")):h=AdfDhtmlTableBasePeer.__getChildBySubId(h,"ft");for(var l=0;2>l;l++){var m=h.rows[l].cells,n;n=this._freezeColumnsToStart()&&!this._isColumnFrozen(a)?
a-d-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(a)?a-e:a;for(var p=0;p<b;p++){var q=m[n++];g.push(q);q._afrIsFooter=!0;q.style.display="none"}}this._processColGroup()&&this._hideReorderColGroupCols(h,a,b);this._adjustReorderColumnHeaderWidths(h,k,a,f)};
AdfDhtmlTableBasePeer.prototype._adjustReorderColumnHeaderWidths=function(a,b,d,e){var f=a.style;f.width=parseInt(f.width)-e+"px";this._hasFrozenColumn()&&(this._freezeColumnsToStart()?this._isColumnFrozen(d)?(f=a.nextSibling.style,AdfDhtmlTableBasePeer._isRTL()?f.right=parseInt(f.right)-e+"px":f.left=parseInt(f.left)-e+"px"):(f=b.style,f.width=parseInt(f.width)-e+"px"):(f=a.nextSibling?a.nextSibling.style:a.parentNode.nextSibling.style,this._isColumnFrozen(d)||(AdfDhtmlTableBasePeer._isRTL()?f.right=
parseInt(f.right)-e+"px":f.left=parseInt(f.left)-e+"px",f=b.style),f.width=parseInt(f.width)-e+"px"))};AdfDhtmlTableBasePeer.prototype._adjustReorderColumnFooterWidths=function(a,b){var d=this._getColumnFooter(),e=null;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(e=AdfDhtmlTableBasePeer.__getChildBySubId(d,"fd2"),d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"ft2")):d=AdfDhtmlTableBasePeer.__getChildBySubId(d,"ft");this._adjustReorderColumnHeaderWidths(d,e,a,b)};
AdfDhtmlTableBasePeer.prototype._adjustReorderInnerTableWidth=function(a,b){var d=a.style,e=parseInt(d.width)-b;0<e&&(d.width=e+"px");d=a.parentNode.parentNode.style;e=d.width;""!=e&&(e=parseInt(e)-b,0<e&&(d.width=e+"px"))};
AdfDhtmlTableBasePeer.prototype._hideReorderColGroupCols=function(a,b,d,e){var f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"),g=this._firstFrozen,h=this._lastFrozen;if(f){a=this._reorderHiddenCells;var f=f.getElementsByTagName("col"),k=b;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?k=b-h-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(k=e?b-g+1:b-g);for(i=k;i<k+d;i++)i<f.length&&(b=f[i],b._afrOriginalWidth=b.style.width,b.style.width="0px",b.style.display="none",a.push(b))}};
AdfDhtmlTableBasePeer.prototype._adjustReorderNonFrozenCol=function(a,b){var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP");if(d){var d=d.getElementsByTagName("col"),e=null,e=this._freezeColumnsToEnd()?d[0]:d[d.length-1];e.style.width=parseInt(e.style.width)-b+"px"}};AdfDhtmlTableBasePeer.prototype._adjustReorderDataBodyNonFrozenCol=function(a){var b=this.GetDataBody().childNodes,d=b.length;for(i=0;i<d;i++)this._adjustReorderNonFrozenCol(b[i],a)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColGroupCol=function(a,b,d,e,f,g,h){a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP");var k=this._firstFrozen,l=this._lastFrozen;if(a){var m=a.getElementsByTagName("col"),n=b;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?n=b-l-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(n=h?b-k+1:b-k);e&&(n+=d-1);b=m[n];d=a.ownerDocument.createElement("col");e?b.nextSibling?a.insertBefore(d,b.nextSibling):a.appendChild(d):a.insertBefore(d,
b);d.style.width=f+"px";g.push(d);a.span++}};AdfDhtmlTableBasePeer.prototype._forceRelayoutDataBody=function(){var a=this.GetDataBody().childNodes,b=a.length,d=this._currentScrollLeft;for(i=0;i<b;i++){var e=a[i].rows[0],f=e.style;f.display="block";f.display="";this._hasFrozenColumn()&&(innerTable=this._getNestedScrolledTable(e),AdfAgent.AGENT.setScrollLeft(innerTable.parentNode,d))}};
AdfDhtmlTableBasePeer.prototype._processColumnReorderAction=function(a){var b=AdfAgent.AGENT,d=this._reorderTH;d&&(this._columnReorderTracker=this._createReorderTracker(),this._positionColumnReorderTracker(a),this._insertEmptyDropColumn(a),this._colReorderDragCallback||(this._colReorderDragCallback=this.createCallback(this._handleColReorderDrag),this._colReorderDropCallback=this.createCallback(this._handleColReorderDrop),this._colReorderAbortCallback=this.createCallback(this._handleColReorderAbort)),
b.disableUserSelect(this.__getColumnHeader()),AdfPage.PAGE.startDrag(a,this._colReorderDragCallback,this._colReorderDropCallback,this._colReorderAbortCallback),b.setCursor(d,"move",!0),b.setCursor(this.getDomElement(),"move",!0),b.eatEvent(a))};
AdfDhtmlTableBasePeer.prototype._positionColumnReorderTracker=function(a){var b=this._columnReorderTracker,d=b.style,e=this.getDomElement(),f=AdfAgent.AGENT;a=f.getMousePosition(a);e=f.getElementPosition(e);b=Math.max(a.x-e.x+(AdfDhtmlTableBasePeer._isRTL()?-b.offsetWidth+8:-8),0);a=Math.max(a.y-e.y-8,0);d.left=b+"px";d.top=a+"px"};
AdfDhtmlTableBasePeer.prototype._autoScrollColumnsIfNecessary=function(a){var b=this.getDomElement();if(!(this._getScrollWidth()<=this._getScrollerOffsetWidth())){var d=AdfAgent.getAgent();a=d.getMousePosition(a);var b=d.getElementPosition(b),b=Math.max(a.x-b.x,0),d=this.__getColumnHeader(),e,f=AdfDhtmlTableBasePeer.__getChildBySubId(d,"t");this._hasFrozenColumn()?(e=AdfDhtmlTableBasePeer.__getChildBySubId(d,"d2"),d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2")):d=f;a=0;var g=AdfDhtmlTableBasePeer._isRTL()?
this._getRTLScrollAdjustment():this._currentScrollLeft,h=!1,k=!1;if(!e||b>f.offsetWidth)e&&(a=f.offsetWidth),b-a<AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN&&0<g?h=!0:b-a>this._getScrollerClientWidth()-AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN&&(k=!0);if(h||k){a-=g;e=AdfDhtmlTableBasePeer._ROOT_COLUMN;k=AdfDhtmlTableBasePeer._ROW_HEADER;for(f=f.rows.length-1;0<=f;f--)for(var l=d.rows[f].cells,m=l.length,n=0;n<m;n++){var p=l[n];if(p.getAttribute(e)&&null==p.getAttribute(k)){var q=p.offsetLeft+a,r=q+p.offsetWidth;
if(b>=q&&b<=r){g=h?Math.max(g-p.offsetWidth,0):Math.min(g+p.offsetWidth,this._getScrollWidth()-this._getScrollerClientWidth());this._scrollerScrollToPos(g,null);break}}}}}};AdfDhtmlTableBasePeer.prototype._handleColReorderDrag=function(a,b,d){this._autoScrollColumnsIfNecessary(a);this._positionColumnReorderTracker(a);this._insertEmptyDropColumn(a)};
AdfDhtmlTableBasePeer.prototype._handleColReorderDrop=function(a,b,d){a=null;null!=this._targetReorderTH&&(a=this._getColReorderAnimationDuration(),this._reorderId=this._reorderTH.id,0<a?this._reorderColumnComponentsWithAnimation(a):this._reorderColumnComponentsWithoutAnimation());0==a&&(null!=this._columnReorderTracker&&(this.getDomElement().removeChild(this._columnReorderTracker),this._columnReorderTracker=null),this._cleanUpAfterColumnReorder());AdfAgent.AGENT.enableUserSelect(this.__getColumnHeader())};
AdfDhtmlTableBasePeer.prototype._getColReorderAnimationDuration=function(){var a=this._colReorderAnimationDuration;void 0==a&&(a=AdfPage.PAGE,this._colScrollAnimationDuration=a=a.isAnimationEnabled()?parseInt(a.getLookAndFeel().getSkinProperty("af|table-tr-column-reorder-animation-duration"),10):0);return a};
AdfDhtmlTableBasePeer.prototype._reorderColumnComponentsWithoutAnimation=function(){if(this._queueColumnReorderEvent().isCanceled())this._handleColReorderAbort();else{var a=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_REORDERING_COLUMN");this.DisplayStatus(a,!0)}};
AdfDhtmlTableBasePeer.prototype._queueColumnReorderEvent=function(){var a=this.getComponent(),a=new AdfTableShowColumnsEvent(a,this._reorderId,"reorderColumn");a.setTargetColumnId(this._targetReorderTH.id);a.setAfterTarget(this._insertColumnAfter);a.queue();return a};
AdfDhtmlTableBasePeer.prototype._cleanUpAfterColumnReorder=function(){AdfAgent.AGENT.setCursor(this.getDomElement(),"");this._targetReorderTH=this._reorderTH=null;delete this._reorderId;delete this._reorderHiddenCells;delete this._insertColumnAfter;delete this._previousInsertColIndex;delete this._emptyDropCells;delete this._reorderEmptyCellWidth};
AdfDhtmlTableBasePeer.prototype._reorderColumnComponentsWithAnimation=function(a){var b=this._emptyDropCells[0].offsetLeft,b=b+this._reorderDropColumnExtraX;AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,a,[{element:this._columnReorderTracker,properties:{top:0,left:b}}],null,AdfDhtmlTableBasePeer._columnReorderAnimationComplete,this)};
AdfDhtmlTableBasePeer.prototype._createReorderTracker=function(){var a=AdfAgent.AGENT,b=this._reorderTH,d=a.getIntAttribute(b,"_d_index",-1),b=b.colSpan,e=this.getDomElement(),f=e.ownerDocument.createElement("div"),g=f.style;e.appendChild(f);g.overflow="hidden";g.position="absolute";g.zIndex=1E3;a.setOpacity(f,85);this._reorderHiddenCells=[];a=this._createReorderColumnLayerHeader(f,d,b);this._createReorderColumnLayerBody(f,a,d,b);this._footerless||this._hideDragColumnFooter(d,b);return f};
AdfDhtmlTableBasePeer.prototype._createReorderColumnLayerHeader=function(a,b,d){var e=AdfAgent.AGENT,f=this._lastFrozen,g=this._firstFrozen,h=this.__getColumnHeader(),k=null;this._hasFrozenColumn()&&!this._isColumnFrozen(b)?(k=AdfDhtmlTableBasePeer.__getChildBySubId(h,"d2"),h=AdfDhtmlTableBasePeer.__getChildBySubId(k,"t2")):h=AdfDhtmlTableBasePeer.__getChildBySubId(h,"t");var l=a.ownerDocument.createElement("table");l.className=h.className;l.cellSpacing=0;colTableStyle=l.style;colTableStyle.tableLayout=
"fixed";colTableStyle.position="relative";a.appendChild(l);for(var m=h.rows.length,n=0,p=this._reorderHiddenCells,q=0;q<m;q++)for(var r=h.rows[q].cells,s=r.length,u=null,t=0,v,w=0;w<s;w++){var z=r[w],y=!1;if(0<q){y=e.getIntAttribute(z,"_d_index",-1);if(y>b)break;y=y==b}else y=this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?w==b-f-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)?w==b-g:w==b;if(y){do null==u?(u=z,v=l.insertRow(q),0==q&&(e.getPlatform()==AdfAgent.IE_PLATFORM&&8>e.getVersion())&&
(v.style.position="absolute")):u=r[++w],t+=u.colSpan,s=this._cloneWithSelectedOption(u,!0),e.removeIdsFromDomSubTree(s),v.appendChild(s),v.style.height="auto",0!=q?(s.rowSpan=1,e.setOuterHeight(s,u.offsetHeight)):n+=u.offsetWidth,p.push(u);while(t<d);break}}for(q=p.length-1;0<=q;q--)p[q].style.display="none";this._processColGroup()&&this._hideReorderColGroupCols(h,b,d);this._reorderColWidth=n;a.style.width=colTableStyle.width=n+"px";this._adjustReorderColumnHeaderWidths(h,k,b,n);e.setOuterHeight(l,
h.offsetHeight);return l};
AdfDhtmlTableBasePeer.prototype._createReorderColumnLayerBody=function(a,b,d,e){var f=AdfAgent.AGENT,g=f.getPlatform()==AdfAgent.GECKO_PLATFORM,h=this._lastFrozen,k=this._firstFrozen,l=this._reorderColWidth;b=this._cloneWithSelectedOption(b,!1);a.appendChild(b);a=this._reorderHiddenCells;for(var m=this.GetDataBody(),n=m.childNodes,p=n.length,q=this._currentScrollTop,r,s=0;s<p;s++){var u=n[s],t=u.rows,v=t.length,w=0;0==s&&(b.className=u.className,r=u.startPos);for(var z=0;z<v;z++){var y=t[z];if(y.offsetTop-
(q-r)>m.offsetHeight)break;var A,B,C=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(d)?(C=this._getNestedScrolledTable(y),A=C.rows[0].cells,B=d-h-1):this._freezeColumnsToEnd()?this._isColumnFrozen(d)?(B=d-k+1,A=y.cells):(C=this._getNestedScrolledTable(y),A=C.rows[0].cells,B=d):(B=d,A=y.cells);if(!this._hasDetailStamp||!f.getAttribute(y,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){var D=b.insertRow(w);w++;for(var G=0;G<e;G++){var E=A[B++];cellClone=this._cloneWithSelectedOption(E,!0);f.removeIdsFromDomSubTree(cellClone);
D.appendChild(cellClone);a.push(E);E.style.display="none";g?cellClone.style.height=y.offsetHeight+"px":f.setOuterHeight(cellClone,y.offsetHeight);null!=C&&(this._adjustReorderInnerTableWidth(C,l),this._processColGroup()&&this._hideReorderColGroupCols(C,d,e))}}}r+=u.offsetHeight;this._processColGroup()&&((!this._hasFrozenColumn()||this._isColumnFrozen(d))&&this._hideReorderColGroupCols(u,d,e,!0),this._hasFrozenColumn()&&!this._isColumnFrozen(d)&&this._adjustReorderNonFrozenCol(u,l))}};
AdfDhtmlTableBasePeer.prototype._cloneWithSelectedOption=function(a,b){if(null==a)return null;var d=a.cloneNode(b);if(1==a.nodeType){if(b){var e=a.getElementsByTagName("SELECT"),f=d.getElementsByTagName("SELECT"),g=e.length;AdfAssert.assert(g==f.length,"Unexpected clone--different amounts of selects!");for(var h=0;h<g;h++)f[h].selectedIndex=e[h].selectedIndex}"SELECT"==a.tagName&&(d.selectedIndex=a.selectedIndex)}return d};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumn=function(a){var b=AdfDhtmlTableBasePeer._isRTL(),d=this.getDomElement(),e=AdfAgent.AGENT;a=e.getMousePosition(a);var f=e.getElementPosition(d),f=Math.max(a.x-f.x,0);a=this.__getColumnHeader();var g,h=AdfDhtmlTableBasePeer.__getChildBySubId(a,"t"),k;this._hasFrozenColumn()&&(g=AdfDhtmlTableBasePeer.__getChildBySubId(a,"d2"),k=AdfDhtmlTableBasePeer.__getChildBySubId(g,"t2"));a=0;if(b){var l=d.offsetWidth,m=h.offsetWidth,n=l-m;g&&f<=n?(d=k,l>m+k.offsetWidth?
a=l-(m+k.offsetWidth):(a=-this._getRTLScrollAdjustment(),this._getScrollHeight()>this._getScrollerOffsetHeight()&&(a+=this._getScrollerOffsetWidth()-this._getScrollerClientWidth()))):(d.offsetWidth>h.offsetWidth&&(a=n),d=h)}else this._freezeColumnsToEnd()?f>=k.offsetWidth?(a=k.offsetWidth,a-=this._currentScrollLeft,d=h):d=k:f<=h.offsetWidth?d=h:g?(a=h.offsetWidth,a-=this._currentScrollLeft,d=k):d=h;var p,l=null;if(d){this._hasFrozenColumn()||(a-=b?this._getRTLScrollAdjustment():this._currentScrollLeft);
for(var h=h.rows.length,m=AdfDhtmlTableBasePeer._ROOT_COLUMN,n=AdfDhtmlTableBasePeer._ROW_HEADER,q=h-1;0<=q;q--)for(var r=d.rows[q].cells,s=r.length,u=0;u<s;u++){var t=r[u];if(t.getAttribute(m)&&null==t.getAttribute(n)&&"none"!=t.style.display){var v=t.offsetLeft+a,w=v+t.offsetWidth;if(b)if(f>=v&&f<=w-t.offsetWidth/2){l=t;p=-1==t.id.indexOf("_afrBlankColumn");break}else{if(f>=v&&f<=w){l=t;p=!1;break}}else if(f>=v&&f<=w-t.offsetWidth/2){l=t;p=!1;break}else if(f>=v&&f<=w){l=t;p=-1==t.id.indexOf("_afrBlankColumn");
break}}}if(null==l&&null==this._previousInsertColIndex)for(q=h-1;0<=q;q--){var r=d.rows[q].cells,s=r.length,z;0<s&&(z=r[s-1]);if(z&&z.getAttribute(m)&&null==z.getAttribute(n)){l=z==this._reorderTH&&z.previousSibling?z.previousSibling:z;p=!0;break}}null!=l&&(z=e.getIntAttribute(l,"_d_index",-1),f=l.colSpan,h=p?z+f:z,h!=this._previousInsertColIndex&&(this._removeEmptyDropColumn(k,g),this._targetReorderTH=l,this._insertColumnAfter=p,this._previousInsertColIndex=h,this._reorderDropColumnExtraX=a,this._targetHeaderTable=
d,this._insertEmptyDropColumnHeader(l,z,f,k,g),null!=g&&b&&e.setScrollLeft(g,this._currentScrollLeft),this._insertEmptyDropColumnBody(z,f),this._footerless||this._insertEmptyDropColumnFooter(z,f),this._processColGroup()&&this._forceRelayoutDataBody()))}};
AdfDhtmlTableBasePeer.prototype._removeEmptyDropColumn=function(a,b){var d=this._emptyDropCells;if(d){for(var e=AdfAgent.AGENT,f=e.getPlatform()==AdfAgent.WEBKIT_PLATFORM,e=e.getIntAttribute(this._targetReorderTH,"_d_index",-1),g=this._reorderColWidth,h=d.length-1;0<=h;h--){var k=d[h],l=k.tagName;f&&"COL"==l?k.parentNode.span--:"TD"==l&&(this._hasFrozenColumn()&&!this._isColumnFrozen(e)&&!k._afrIsFooter)&&this._adjustReorderInnerTableWidth(k.parentNode.parentNode.parentNode,g);k.parentNode.removeChild(k)}this._adjustReorderColumnHeaderWidths(this._targetHeaderTable,
b,e,g);this._processColGroup()&&(this._hasFrozenColumn()&&!this._isColumnFrozen(e))&&this._adjustReorderDataBodyNonFrozenCol(g);this._footerless||this._adjustReorderColumnFooterWidths(e,g)}this._emptyDropCells=[]};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnHeader=function(a,b,d,e,f){e=AdfAgent.AGENT;for(var g=this._insertColumnAfter,h=this._reorderColWidth,k=this._emptyDropCells,l=this._lastFrozen,m=this._firstFrozen,n=this._targetHeaderTable,p=this._reorderEmptyCellWidth,q=a.ownerDocument,r=this._isFilterable(),s=r?3:2,u=0;u<s;u++){var t=n.rows[u],v=t.cells;if(u<s-1){var w=b;this._hasFrozenColumn()&&(this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?w=b-l-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&
(w=b-m));g&&(w+=d-1);headerCell=v[w]}else headerCell=a;v=q.createElement("th");g?headerCell.nextSibling?t.insertBefore(v,headerCell.nextSibling):t.appendChild(v):t.insertBefore(v,headerCell);0==u?v.style.cssText=headerCell.style.cssText:(v.className=AdfDhtmlTableBasePeer._DROP_TARGET_CLASS+" "+headerCell.className,u==s-1&&(v.rowSpan=n.rows.length-(r?2:1)),v.innerHTML="\x26nbsp;");p?v.style.width=p:(e.setOuterWidth(v,h),p=this._reorderEmptyCellWidth=parseInt(v.style.width)+"px");k.push(v)}this._adjustReorderColumnHeaderWidths(n,
f,b,-h);this._processColGroup()&&this._insertEmptyDropColGroupCol(n,b,d,g,h,k)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnBody=function(a,b){for(var d=AdfAgent.AGENT,e=d.getPlatform()==AdfAgent.IE_PLATFORM,f=AdfDhtmlTableBasePeer._isRTL(),g=this._lastFrozen,h=this._firstFrozen,k=this._insertColumnAfter,l=this._reorderColWidth,m=this._emptyDropCells,n=this._reorderEmptyCellWidth,p=this._currentScrollLeft,q=this.GetDataBody(),r=q.childNodes,s=r.length,u=q.ownerDocument,t=AdfDhtmlTableBasePeer._DROP_TARGET_CLASS,v=this._currentScrollTop,w=k?a+b-1:a,z,y=0;y<s;y++){var A=
r[y],B=A.rows,C=B.length;0==y&&(z=A.startPos);for(var D=v-z,G=0;G<C;G++){var E=B[G];if(E.offsetTop-D>q.offsetHeight)break;if(!this._hasDetailStamp||!d.getAttribute(E,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){var H,I=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(a)?(I=this._getNestedScrolledTable(E),E=I.rows[0],H=E.cells[w-g-1]):this._freezeColumnsToEnd()?this._isColumnFrozen(a)?H=E.cells[w-h+1]:(I=this._getNestedScrolledTable(E),E=I.rows[0],H=E.cells[w]):H=E.cells[w];var J=u.createElement("td");
J.className=t+" "+H.className;k?H.nextSibling?E.insertBefore(J,H.nextSibling):E.appendChild(J):E.insertBefore(J,H);J.style.width=n;J.noWrap=!0;J.innerHTML="\x26nbsp;";m.push(J);null!=I&&(this._adjustReorderInnerTableWidth(I,-l),this._processColGroup()?this._insertEmptyDropColGroupCol(I,a,b,k,l,m):e&&(E=I.parentNode,(f||d.getScrollLeft(E)!=p)&&d.setScrollLeft(E,p)))}}z+=A.offsetHeight;this._processColGroup()&&((!this._hasFrozenColumn()||this._isColumnFrozen(a))&&this._insertEmptyDropColGroupCol(A,
a,b,k,l,m,!0),this._hasFrozenColumn()&&!this._isColumnFrozen(a)&&this._adjustReorderNonFrozenCol(A,-l))}f&&!this._hasFrozenColumn()&&d.setScrollLeft(q,p)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnFooter=function(a,b){var d=AdfAgent.AGENT,e=d.getPlatform()==AdfAgent.WEBKIT_PLATFORM,f=this._lastFrozen,g=this._firstFrozen,h=this._insertColumnAfter,k=this._reorderColWidth,l=this._emptyDropCells,m=this._reorderEmptyCellWidth,n=this._getColumnFooter(),p,q=null,r=h?a+b-1:a;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(q=AdfDhtmlTableBasePeer.__getChildBySubId(n,"fd2"),p=AdfDhtmlTableBasePeer.__getChildBySubId(q,"ft2"),this._freezeColumnsToStart()&&
(r-=f+1),d.getScrollLeft(q)!=this._currentScrollLeft&&d.setScrollLeft(q,this._currentScrollLeft)):(p=AdfDhtmlTableBasePeer.__getChildBySubId(n,"ft"),this._freezeColumnsToEnd()&&this._isColumnFrozen(a)&&(r-=g));d=n.ownerDocument;for(g=0;2>g;g++)n=p.rows[g],f=d.createElement(0==g?"th":"td"),cell=n.cells[r],h?cell.nextSibling?n.insertBefore(f,cell.nextSibling):n.appendChild(f):n.insertBefore(f,cell),f.style.width=m,0==g?f.style.cssText=cell.style.cssText:(f.className=cell.className,f.innerHTML="\x26nbsp;",
f._afrIsFooter=!0,e&&(f.rowSpan="10")),l.push(f);this._adjustReorderColumnHeaderWidths(p,q,a,-k);this._processColGroup()&&this._insertEmptyDropColGroupCol(p,a,b,h,k,l)};AdfDhtmlTableBasePeer._columnReorderAnimationComplete=function(a){a._reorderColumnComponentsWithoutAnimation();a._cleanUpAfterColumnReorder()};
AdfDhtmlTableBasePeer.prototype._handleColReorderAbort=function(){var a=AdfAgent.AGENT;AdfAgent.AGENT.getPlatform();var b=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"),e,f;this._hasFrozenColumn()&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"));this._removeEmptyDropColumn(f,e);for(var b=a.getIntAttribute(this._reorderTH,"_d_index",-1),g=this._reorderHiddenCells,h=this._reorderColWidth,k=g.length,l,m,n=0;n<k;n++)l=g[n],
l.style.display="",l._afrOriginalWidth&&(l.style.width=l._afrOriginalWidth),"TD"==l.tagName&&!l._afrIsFooter&&(l=l.parentNode,this._hasFrozenColumn()&&!this._isColumnFrozen(b)&&l!=m&&this._adjustReorderInnerTableWidth(l.parentNode.parentNode,-h),m=l);this._processColGroup()&&(this._hasFrozenColumn()&&!this._isColumnFrozen(b))&&this._adjustReorderDataBodyNonFrozenCol(-h);this._adjustReorderColumnHeaderWidths((this._hasFrozenColumn()&&!this._isColumnFrozen(b)?f:d,e,b,-h));this._footerless||this._adjustReorderColumnFooterWidths(b,
-h);null!=this._columnReorderTracker&&(this.getDomElement().removeChild(this._columnReorderTracker),this._columnReorderTracker=null);this._cleanUpAfterColumnReorder();a.enableUserSelect(this.__getColumnHeader())};AdfDhtmlTableBasePeer.prototype.GetFocusManager=function(){return this._focusManager};AdfDhtmlTableBasePeer.prototype.GetFocusedRowKey=function(){return this._focusManager.currency};
AdfDhtmlTableBasePeer.prototype.GetLastRowKey=function(){var a=this._focusManager.currency;if(null==a&&this._isRowSelectionEnabled()){var b=this.getComponent().getSelectedRowKeys(),d;for(d in b)b[d]!=AdfUITable._SELECT_ALL&&b[d]&&(a=d)}return a};AdfDhtmlTableBasePeer.prototype.suppressSelectionEventDelivery=function(a){this._suppressSelectionEventDelivery=a};AdfDhtmlTableBasePeer.prototype.canDeliverSelectionEvent=function(){return!this._suppressSelectionEventDelivery};
AdfDhtmlTableBasePeer.prototype._getTargetRowHeader=function(a){for(var b=null,d=this.getDomElement();a&&a!=d;){if("TD"==AdfAgent.getAgent().getNodeName(a)){null!=a.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)&&(b=a);break}a=a.parentNode}return b};AdfDhtmlTableBasePeer.prototype.__getSelectedColumns=function(){for(var a=this.__getVisibleLeafColumns(),b=[],d=a.length,e=0;e<d;e++){var f=a[e];f&&f.getSelected()&&b.push(f)}return b};
AdfDhtmlTableBasePeer.prototype.GetRowHeaderCellFromRow=function(a){AdfAssert.assert(null!=a,"Unable to get row header cell from a non-valid row!");AdfAgent.getAgent();for(var b=null,d=a.cells,e=d.length,f=0;f<e;f++)if(a=d[f],null!=a.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)){b=a;break}return b};
AdfDhtmlTableBasePeer.prototype._isTargetCellEditable=function(a,b){for(var d=AdfAgent.getAgent(),e,f=this.getDomElement(),g=AdfDhtmlTableBasePeer._INPUT_REGEXP;null!=a&&a!=f&&"TD"!=(e=d.getNodeName(a))&&"TH"!=e&&"TR"!=e;){if(3!=a.nodeType){var h=a.getAttribute("tabIndex",2);if(null!=h&&0<=h&&32768!=h&&65535!=h||e.match(g)&&(b||-1!=h))return!0}a=a.parentNode}return!1};
AdfDhtmlTableBasePeer.prototype._isTargetTextOnlyNode=function(a){return"SPAN"==a.tagName&&"on"==a.getAttribute(AdfDhtmlTableBasePeer._CELL_TEXT_KEY)?!0:!1};AdfDhtmlTableBasePeer.prototype._isTargetNavigable=function(a){return a&&"A"==a.tagName&&a.href&&0<a.href.length&&"#"!=a.getAttribute("href")};
AdfDhtmlTableBasePeer.prototype._handleRowMouseDown=function(a,b,d,e,f,g,h){(!this._isClickToEdit()&&this._editableTableReadOnlyMode||this._isClickToEdit()&&g&&this._getActiveRowKey()==g)&&this._setReadOnlyMode(!1,b,!1);if(!this._getExpandAction(b)){var k=AdfAgent.AGENT,l=this._getTargetRowHeader(b),m=null!=l,n=this._isTargetCellEditable(b),p=this._getCellAndIndexForNode(b,h),q=p.cellIndex;!n&&(!this._isClickToEdit()&&!this._contextMenuSelect)&&this._grabFocus();m?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
g,l):(d||this._contextMenuSelect)&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,g,h,p.cell);this._isClickToEdit()&&(this._getActiveRowKey()!=g||this.getComponent().getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY))?(this._ctePatternStart=void 0,this._setActiveRowKey(g),this._saveClickToEditRequest(b,h),g&&this._setReadOnlyMode(!1,b,!1)):n&&this._ctePatternStart!=q&&(this._ctePatternStart=void 0);if(this._isRowSelectionEnabled()&&(l=this._selIsSelected(g),d||this._contextMenuSelect&&
!d))if(l||(this._doRowSelection(b,e,f,g,h),this._ignoreRowClick=!0,!n&&null!=a&&k.eatEvent(a)),!n&&d||this._contextMenuSelect&&!d){b=p.cell;if((!k.getDomWindow().AdfSafariMobileAgent||!(k instanceof AdfSafariMobileAgent&&k.getOS()!=AdfAgent.ANDROID_OS))&&!this._disableRowMouseDownCellFocus&&!this._setFocusOnEditableElementInNode(k,b))(k.getPlatform()!=AdfAgent.IE_PLATFORM||this._isClickToEdit())&&this._setFocusOnNode(b);m&&(this._isMultipleRowSelect()&&null!=a)&&(k.disableUserSelect(this.GetDataBody()),
this._doRowHeaderDrag(a,g),k.eatEvent(a))}}};AdfDhtmlTableBasePeer.prototype._setFocusOnNode=function(a,b){var d=a.tabIndex;a.tabIndex=0;b?AdfFocusUtils.focusElementDelayed(a,1):AdfFocusUtils.focusElement(a);a.tabIndex=d};AdfDhtmlTableBasePeer.prototype._handleDataBodySelectStart=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfAgent.AGENT,d=b.getEventTarget(a);this._isRowSelectionEnabled()&&!this._isTargetCellEditable(d)&&b.preventDefault(a)};
AdfDhtmlTableBasePeer.prototype._doRowHeaderDrag=function(a,b){this._startDragRowHeaderKey=b;null==this._handleRowHeaderDragCallback&&(this._handleRowHeaderDragCallback=this.createCallback(this._handleRowHeaderDrag),this._endRowHeaderDragCallback=this.createCallback(this._endRowHeaderDrag));AdfPage.PAGE.startDrag(a,this._handleRowHeaderDragCallback,this._endRowHeaderDragCallback)};
AdfDhtmlTableBasePeer.prototype._handleRowHeaderDrag=function(a,b,d){b=AdfAgent.getAgent();var e=b.getEventTarget(a);if(null!=this._getTargetRowHeader(e)){for(e=e.parentNode;e&&"TR"!=b.getNodeName(e);)e=e.parentNode;e&&(b=e.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),null!=b&&(this._selectRowRange(this._startDragRowHeaderKey,b),this._startDragRowHeaderKey=b,this._autoScrollRows(a)))}else{d=this.getDomElement();for(e=e.parentNode;e&&e!=d;){if("TR"==b.getNodeName(e)&&b.getAttribute(e,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,
!1)){this._autoScrollRows(a);break}e=e.parentNode}}};
AdfDhtmlTableBasePeer.prototype._autoScrollRows=function(a){var b=AdfAgent.AGENT,d=this.GetDataBody();if(!(this._getScrollHeight()<=this._getScrollerOffsetHeight())&&(a=b.getMousePosition(a),b=b.getElementPosition(d),b=Math.max(a.y-b.y,0),d=b>d.offsetHeight-AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN,b<AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN||d))d=this._currentScrollTop+(d?this._averageRowHeight:-this._averageRowHeight),0<=d&&d<this._getScrollHeight()&&this._scrollerScrollToPos(null,d)};
AdfDhtmlTableBasePeer.prototype._endRowHeaderDrag=function(a,b,d){this._startDragRowHeaderKey=null;AdfAgent.AGENT.enableUserSelect(this.GetDataBody())};
AdfDhtmlTableBasePeer.prototype._handleRowClick=function(a,b,d,e,f,g){AdfAgent.getAgent();var h=this._getTargetRowHeader(a),k=null!=h;this._ignoreRowClick?this._ignoreRowClick=!1:this._isRowSelectionEnabled()&&(k?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,f,h):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,f,g),(b||this._contextMenuSelect&&!b)&&this._doRowSelection(a,d,e,f,g))};
AdfDhtmlTableBasePeer.prototype._doRowSelection=function(a,b,d,e,f){var g=this._isMultipleRowSelect(),h=AdfAgent.AGENT;if(g&&b)this._unSelectAllColumns(),this._anchorRowKey=e,this._selIsSelected(e)?(!h.disableSelectionToggleOnEditableCell()||!this._isTargetCellEditable(a))&&this._selUnselectRow(e,f):this._selSelectRow(e,f);else if(g&&d){if(a=this._anchorRowKey){if(!this.FindRowByKey(a)){b=this.getComponent();b=new AdfSelectionEvent(b,b.getSelectedRowKeys(),null);b.setSelectionRange(a,e);b.queue();
return}}else a=this._anchorRowKey=e;this.suppressSelectionEventDelivery(!0);this._selUnselectAll();this._queueColumnSelectionEvent();this.suppressSelectionEventDelivery(!1);this._selectRowRange(a,e)}else this._anchorRowKey=e,this._selIsOnlySelection(e)||(this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selSelectRow(e,f),this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._selUnselectAll=function(){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);this._unSelectAllColumns();this._updateTableSelectionState({})};
AdfDhtmlTableBasePeer.prototype._selSelectRow=function(a,b,d){this._selHighlightRow(b);d||(b={},(d=this.getComponent().getSelectedRowKeys())&&d[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(AdfCollections.copyInto(b,d),d=b[a],delete b[a],this._adjustSelectedRowKeyIndex(b,d)):(b[a]=1,this._mergeSelectedRowKeys(d,b,b)),this._updateTableSelectionState(b))};
AdfDhtmlTableBasePeer.prototype._selUnselectRow=function(a,b){this._selUnhighlightRow(b);var d={},e=this.getComponent().getSelectedRowKeys();e[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(d[a]=1,this._mergeSelectedRowKeys(e,d,d)):(AdfCollections.copyInto(d,e),e=d[a],delete d[a],this._adjustSelectedRowKeyIndex(d,e));this._updateTableSelectionState(d)};
AdfDhtmlTableBasePeer.prototype._mergeSelectedRowKeys=function(a,b,d,e){if(!a||!b)(a=a?a:b)&&AdfCollections.copyInto(d,a);else{if(!e){e=0;for(var f in a)e++}for(var g in b)d[g]=b[g]+e;AdfCollections.copyInto(d,a)}return d};AdfDhtmlTableBasePeer.prototype._adjustSelectedRowKeyIndex=function(a,b){if(a&&b)for(var d in a)a[d]>b&&(a[d]-=1)};
AdfDhtmlTableBasePeer.prototype._selectRowRange=function(a,b){var d=this.GetDataBody();if(null!=d){var e=AdfAgent.getAgent(),f=this.getComponent(),g={},h=1,k=f.getSelectedRowKeys(),l=k[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],m=!1,n=!1,d=d.childNodes,p=d.length,q=!0;f.getRowIndex(a)>f.getRowIndex(b)&&(q=!1);for(f=0;f<p&&!n;++f)for(var r=d[q?f:p-f-1].rows,s=r.length,u=0;u<s;++u){var t=r[q?u:s-u-1],v=e.getAttribute(t,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=v){if(v==a||v==b){if(m||a==b)n=!0;m=
!0}m&&(this._selSelectRow(v,t,!0),l?(t=g[v],delete g[v],this._adjustSelectedRowKeyIndex(g,t)):(g[v+""]=h,h++));if(n)break}}this._mergeSelectedRowKeys(k,g,g);this._updateTableSelectionState(g)}};AdfDhtmlTableBasePeer.prototype._selIsSelected=function(a){var b=this.getComponent().getSelectedRowKeys();return b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?!b[a]:b[a]};
AdfDhtmlTableBasePeer.prototype._selIsOnlySelection=function(a){var b=this.getComponent().getSelectedRowKeys();if(null!=b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY])return!1;var d=b[a];if(d)for(var e in b)if(e!=a){d=!1;break}return d};
AdfDhtmlTableBasePeer.prototype._selHighlightRow=function(a){AdfAssert.assertDomNode(a);AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);"row"==a.getAttribute("role")&&a.setAttribute("aria-selected","true");AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._HIGHLIGHTED_CLASS);this.isInActiveHeirarchy()?AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS):AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS)};
AdfDhtmlTableBasePeer.prototype._selUnhighlightRow=function(a){AdfAssert.assertDomNode(a);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);"row"==a.getAttribute("role")&&a.removeAttribute("aria-selected")};AdfDhtmlTableBasePeer.prototype._isColumnSelectionEnabled=function(){var a=this.getComponent().getColumnSelection?this.getComponent().getColumnSelection():null;return a&&a!=AdfDhtmlTableBasePeer._SELECTION_NONE};
AdfDhtmlTableBasePeer.prototype._isMultipleColumnSelect=function(){var a=this.getComponent().getColumnSelection?this.getComponent().getColumnSelection():null;return a&&a==AdfDhtmlTableBasePeer._SELECTION_MULTIPLE};AdfDhtmlTableBasePeer.prototype._isRowSelectionEnabled=function(a){a||(a=this.getComponent());return(a=a.getRowSelection())&&a.toLowerCase()!=AdfDhtmlTableBasePeer._SELECTION_NONE};
AdfDhtmlTableBasePeer.prototype._isMultipleRowSelect=function(){var a=this.getComponent().getRowSelection();return a&&-1!=a.toLowerCase().indexOf(AdfDhtmlTableBasePeer._SELECTION_MULTIPLE)};AdfDhtmlTableBasePeer.prototype._isMultipleRowSelectNoSelectAll=function(){var a=this.getComponent().getRowSelection();return a&&-1!=a.indexOf(AdfDhtmlTableBasePeer._SELECTION_MULTIPLE_NOSELECTALL)};
AdfDhtmlTableBasePeer.prototype._selUpdateAll=function(a,b,d){null==d&&(d=this.getComponent().getSelectedRowKeys());var e=!1;null!=d&&(e=d[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?!0:!1);e?this._selectAllSelectionUpdate(a,b,d):this._normalSelectionUpdate(a,b,d)};
AdfDhtmlTableBasePeer.prototype._normalSelectionUpdate=function(a,b,d){var e=this.GetDataBody();if(null!=e&&(!0==b&&(this._highlightedRowKey=null),d&&!AdfCollections.isEmpty(d))){for(var e=e.childNodes,f=e.length,g=AdfAgent.getAgent(),h=0;h<f;++h){var k=e[h].rows;if(k)for(var l=k.length,m=0;m<l;++m){var n=k[m],p=g.getAttribute(n,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=p&&!(!1==b&&this._highlightedRowKey==p))switch(a){case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_SELECT:this._selHighlightRow(n);break;
case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT:this._selUnhighlightRow(n);break;case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE:d[p]?this._selHighlightRow(n):this._selUnhighlightRow(n)}}}this._updateColumnSelection(1!=a)}};
AdfDhtmlTableBasePeer.prototype._selectAllSelectionUpdate=function(a,b,d){var e=this.GetDataBody();if(null!=e&&(!0==b&&(this._highlightedRowKey=null),d&&!AdfCollections.isEmpty(d)))for(var e=e.childNodes,f=e.length,g=AdfAgent.getAgent(),h=0;h<f;++h){var k=e[h].rows;if(k)for(var l=k.length,m=0;m<l;++m){var n=k[m],p=g.getAttribute(n,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=p&&!(!1==b&&this._highlightedRowKey==p))switch(a){case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_SELECT:this._selHighlightRow(n);break;
case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT:this._selUnhighlightRow(n);break;case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE:d[p]?this._selUnhighlightRow(n):this._selHighlightRow(n)}}}};
AdfDhtmlTableBasePeer.prototype._selSelectAll=function(){var a=this.GetDataBody();if(null!=a&&this._isMultipleRowSelect()){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);var b={};b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]=!0;this._updateTableSelectionState(b);for(var a=a.childNodes,b=a.length,d=AdfAgent.getAgent(),e=0;e<b;++e)for(var f=a[e].rows,g=f.length,h=0;h<g;++h){var k=f[h];null!=d.getAttribute(k,AdfDhtmlTableBasePeer._ROW_KEY)&&this._selHighlightRow(k)}}};
AdfDhtmlTableBasePeer.prototype._unhiglightAnyExistingHighlightedRow=function(){var a=this._highlightedRowKey;a&&(this._highlightedRowKey=null,this._selIsSelected(a)||(this._selUnhighlightRow(this._highlightedRow),this._highlightedRow=null))};AdfDhtmlTableBasePeer.prototype._updateTableSelectionState=function(a){this._ignoreSelSet=!0;AdfLogger.LOGGER.finer("Update Table selection state to:",a);this.getComponent().setSelectedRowKeys(a);this._ignoreSelSet=!1};
AdfDhtmlTableBasePeer.prototype.ComponentSelectedRowKeysChanged=function(a,b,d,e){this._ignoreSelSet?(a=this.GetAssociatedComponent(),null!=a&&a.setSelectedRowKeys(d)):(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0,e),this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!0,d));this._pcPeer&&this._pcPeer.updateRowSelectionContext()};
AdfDhtmlTableBasePeer.prototype._resolveColumns=function(a,b,d){var e=AdfAgent.AGENT.getIntAttribute(d,"_d_index",-1);if(0<=e){var f=d.colSpan;if(null!=f&&1<(f=parseInt(f)))for(d=e+f;e<d;)b.push(this._getColumnHeaderLeafCell(e).id),a.push(e++);else a.push(e),b.push(d.id)}};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderDrag=function(a,b,d){b=this.__getColumnHeaderMouseAction(a);null!=b&&"select"==b.type&&(d=b.colIndices,0<d.length&&(this._selectColumnRange(this._activeColIndices,this._activeColIds,d,b.colIds),this._queueColumnSelectionEvent()));this._autoScrollColumnsIfNecessary(a);this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderDrop=function(a,b,d){a=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(a);this._queueColumnSelectionEvent()};
AdfDhtmlTableBasePeer.prototype._doColumnSelections=function(a,b,d){var e=AdfPage.PAGE;if(this._isMultipleColumnSelect()&&AdfAgent.AGENT.isSelectionToggle(a)){a=this.getComponent().getSelectedRowKeys();AdfCollections.isEmpty(a)||(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0),this._updateTableSelectionState({}));this._activeColIndices=b;this._activeColIds=d;for(a=0;a<b.length;a++){var f=e.findComponent(d[a]);f.getSelected()?this._unSelectColumn(b[a],f,!1):this._selectColumn(b[a],
f,!1)}this._queueColumnSelectionEvent()}else if(a.shiftKey&&this._isMultipleColumnSelect())this._activeColIndices&&0<=this._activeColIndices.length&&(this._clearColumnSelectionEventChangedSets(),this._selUnselectAll(),this._selectColumnRange(this._activeColIndices,this._activeColIds,b,d),this._queueColumnSelectionEvent());else{this._activeColIndices=b;this._activeColIds=d;this._clearColumnSelectionEventChangedSets();this._selUnselectAll();for(a=0;a<b.length;a++)f=e.findComponent(d[a]),this._selectColumn(b[a],
f,!1);this._queueColumnSelectionEvent()}this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};AdfDhtmlTableBasePeer.prototype._selectColumn=function(a,b,d){b.getSelected()||(b.setProperty(AdfRichColumn.SELECTED,!0,!0,AdfUIComponent.PROPAGATE_NEVER),this._highlightColumn(a),this._isClickToEdit()&&this._getActiveRowKey()&&this._setActiveRowKey(null),this._colSelEventSelectedColIds[b.getClientId()]=!0,d&&this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._unSelectColumn=function(a,b,d){b.getSelected()&&(b.setProperty(AdfRichColumn.SELECTED,!1,!0,AdfUIComponent.PROPAGATE_NEVER),this._unHighlightColumn(a),this._colSelEventUnselectedColIds[b.getClientId()]=!0,d&&this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._unSelectAllColumns=function(){if(this._isColumnSelectionEnabled()){var a=AdfPage.PAGE,b=this._colCount,d;this._clearColumnSelectionEventRemovedSet();for(var e=0;e<b;e++)(d=this._getColumnHeaderLeafCell(e))&&this._unSelectColumn(e,a.findComponent(d.id),!1)}this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};
AdfDhtmlTableBasePeer.prototype._updateColumnSelection=function(a){if(!this._headerless)for(var b=AdfPage.PAGE,d=this._colCount,e=0;e<d;e++){var f=this._getColumnHeaderLeafCell(e);f&&b.findComponent(f.id).getSelected()&&(a?this._highlightColumn(e):this._unHighlightColumn(e))}};
AdfDhtmlTableBasePeer.prototype._selectColumnRange=function(a,b,d,e){for(var f=AdfPage.PAGE,g=0;g<a.length;g++)this._selectColumn(a[g],f.findComponent(b[g]));g=d[0]>a[0]?1:-1;a=a[0];for(b=b[0];a!=d[0];)this._selectColumn(a,f.findComponent(b)),a+=g,b=this._getColumnHeaderLeafCell(a).id;for(g=0;g<d.length;g++)this._selectColumn(d[g],f.findComponent(e[g]))};
AdfDhtmlTableBasePeer.prototype._highlightColumn=function(a){var b=this._getColumnHeaderLeafCell(a);this._highlightCell(b,!0);for(var b=this.GetDataBody().childNodes,d=b.length,e=null,f=AdfAgent.getAgent(),g=0;g<d;++g)for(var h=b[g].rows,k=h.length,l=0;l<k;++l)f.getAttribute(h[l],AdfDhtmlTableBasePeer._ROW_KEY,null)&&(null==e&&(e=this.isInActiveHeirarchy()),this._hasFrozenColumn()&&!this._isColumnFrozen(a)?this._highlightCell(this._getInnerTableCell(h[l],a),e):!this._hasFrozenColumn()||this._freezeColumnsToStart()?
this._highlightCell(h[l].cells[a],e):this._highlightCell(h[l].cells[a-this._firstFrozen+1],e))};
AdfDhtmlTableBasePeer.prototype._unHighlightColumn=function(a){var b=this._getColumnHeaderLeafCell(a);this._unHighlightCell(b,!0);for(var b=this.GetDataBody().childNodes,d=b.length,e=AdfAgent.getAgent(),f=0;f<d;++f)for(var g=b[f].rows,h=g.length,k=0;k<h;++k)e.getAttribute(g[k],AdfDhtmlTableBasePeer._ROW_KEY,null)&&(this._hasFrozenColumn()&&!this._isColumnFrozen(a)?this._unHighlightCell(this._getInnerTableCell(g[k],a)):!this._hasFrozenColumn()||this._freezeColumnsToStart()?this._unHighlightCell(g[k].cells[a]):
this._unHighlightCell(g[k].cells[a-this._firstFrozen+1]))};AdfDhtmlTableBasePeer.prototype._highlightCell=function(a,b){AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS)};AdfDhtmlTableBasePeer.prototype._unHighlightCell=function(a){AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS)};
AdfDhtmlTableBasePeer.prototype._getParentTH=function(a){a=AdfAgent.AGENT.getEventTarget(a);for(var b=null,d=this.getDomElement();!b&&a&&a!=d&&1==a.nodeType;)a.getAttribute("_d_index")?b=a:a=a.parentNode;return b};AdfDhtmlTableBasePeer.prototype._getColumnHeaderCellForEvent=function(a){var b=null,d=this.__getColumnHeader(),e=AdfAgent.AGENT,d=e.getElementPosition(d);e.getMousePosition(a).y-d.y<=this._cachedCHHeight&&(b=this._getParentTH(a));return b};
AdfDhtmlTableBasePeer.prototype.__getColumnHeaderMouseAction=function(a){var b=null;if(!this._headerless){var d=AdfAgent.AGENT,e=null,f=this.__getColumnHeader(),f=d.getElementPosition(f),g=d.getMousePosition(a);g.y-f.y<=this._cachedCHHeight&&(e=this._getParentTH(a));if(e){b={};b.cell=e;if(null!=e.getAttribute("_afrFH"))return b.type="clearAllFilter",b;if(!this._virtInitialized)return null;var f=null,h=d.getIntAttribute(e,"_d_index",-1),k=AdfDhtmlTableBasePeer._isRTL();if(-1!=h&&"enabled"==this.getComponent().getColumnResizing()){var d=
d.getElementPosition(e),d=g.x-d.x,g=e.offsetWidth,l=!(-1!=this._lastColWidthOverride&&h==this._colCount-1);d<=this.__getColumnResizeMargin()?k?l&&(f="end"):0<h&&(f="start"):g-d<=this.__getColumnResizeMargin()&&(k?0<h&&(f="start"):l&&(f="end"))}f?(b.type="resize",b.data=f):this._getColHeaderMouseSelAction(a,b,e)}}return b};
AdfDhtmlTableBasePeer.prototype._getColHeaderMouseSelAction=function(a,b,d){var e=AdfAgent.AGENT,f=e.getEventTarget(a),g=this._isColumnSelectionEnabled(),h=f.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_ASCENDING);h||(h=f.parentNode.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_ASCENDING));var k=f.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_DESCENDING);k||(k=f.parentNode.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_DESCENDING));if(h||k){if("click"==a.type){e=e.getElementById(AdfRichUIPeer.CreateSubId(d.id,
AdfDhtmlTableBasePeer.__SORT_INDICATOR));a=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE);if(h){if(a==AdfDhtmlTableBasePeer._SORTED_ASCENDING)return;b.sortOrder=!0}else if(k){if(a==AdfDhtmlTableBasePeer._SORTED_DESCENDING)return;b.sortOrder=!1}b.type="sort";b.sortProperty=AdfPage.PAGE.findComponent(d.id).getSortProperty()}}else null!=d.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL)?b.type="selectAll":-1==d.id.indexOf("_afrBlankColumn")&&(!g&&this.getComponent().getDisableColumnReordering()&&
null==d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?b.type="default":!g&&null==d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)&&null!=d.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN)?(e=e.getElementById(AdfRichUIPeer.CreateSubId(d.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR)),null!=e?"click"==a.type?(a=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),b.sortOrder=a==AdfDhtmlTableBasePeer._SORTED_ASCENDING?!1:!0,b.type="sort",b.sortProperty=AdfPage.PAGE.findComponent(d.id).getSortProperty()):
b.type="mousemove"==a.type?"default":"move":b.type="move"):null==d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?(!g||!e.isSelectionToggle(a))&&this._shouldEnableColumnReorder(a,d)?this.getComponent().getDisableColumnReordering()||(b.type="move"):d.id&&g?(b.type="select",this._resolveColumns(b.colIndices=[],b.colIds=[],d)):b.type="default":b.type="default")};
AdfDhtmlTableBasePeer.prototype._shouldEnableColumnReorder=function(a,b){var d=AdfPage.PAGE,e=!1,f=null,g=this._flattenedColumns,g=null!=b.getAttribute(AdfDhtmlTableBasePeer._LEAF_COLUMN),h=null!=b.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN);if(g&&h)b.id&&(0<b.id.length&&d.findComponent(b.id).getSelected())&&(f=[b.id]);else if(h)if(this._resolveColumns([],f=[],b),0==f.length)f=null;else for(i=f.length-1;0<=i;--i)if(!d.findComponent(f[i]).getSelected()){f=null;break}if(f){e=!0;g=this.__getVisibleLeafColumns();
for(i=g.length-1;0<=i;--i)if((d=g[i])&&d.getSelected()){h=!1;for(j=f.length-1;0<=j;--j)if(d.getClientId()==f[j]){h=!0;break}if(!h){e=!1;break}}}return e};AdfDhtmlTableBasePeer.prototype._handleColResizeDrag=function(a,b,d){a=this._getColumnResizeIndicator().style;d=parseInt(a.left);var e=parseInt(this._resizedTH.style.width),f=this._resizeColDelta+(AdfDhtmlTableBasePeer._isRTL()?-b:b),g=this._getLargestMinimumWidth();this._resizeColDelta=f;e+f>=g&&(a.left=d+b+"px")};
AdfDhtmlTableBasePeer.prototype._getLargestMinimumWidth=function(){var a=this._resizedIndex,b=this.__getVisibleLeafColumns()[a],a=this._largestMinimumWidth;if(null==a){var a=0,d=this.__getSelectedColumns();if(-1==AdfCollections.indexOf(d,b))a=b.getMinimumWidth();else for(var b=d.length,e=0;e<b;e++)var f=d[e].getMinimumWidth(),a=Math.max(a,f);this._largestMinimumWidth=a}return this._largestMinimumWidth};
AdfDhtmlTableBasePeer.prototype._handleColResizeDrop=function(a,b,d){a=this._getColumnResizeIndicator();this._hideElement(a);this.isHeightAutoSized()&&2>=this._autoHeightRows&&this._restoreHorizontalScrollBarForIE8(17);a=this._resizeColDelta;b=this._resizedTH;d=parseInt(a)+parseInt(b.style.width);var e=this._getLargestMinimumWidth();d=Math.max(d,e);this._hasFrozenColumn()&&this._isColumnFrozen(this._resizedIndex)&&(e=Math.max(this.GetDataBody().clientWidth-10,e),b.offsetLeft+d>=e&&(d=e-b.offsetLeft));
AdfAssert.assert(!isNaN(d),"Illegal width for column resize drop.  delta \x3d "+a+", th.style.width \x3d "+b.style.width);this._doColResizesFromUser(d,null)};
AdfDhtmlTableBasePeer.prototype._restoreHorizontalScrollBarForIE8=function(a){var b=this.GetScroller(),d=AdfAgent.getAgent(),e=d.getPlatform()==AdfAgent.IE_PLATFORM;if(null!=b&&e&&2>this.GetRowCount()){var e=this.getDomElement(),f=this._getScrollbarHeight(),g=this.GetDataBody(),g=!this.IsEmpty?this._computeAutoHeight():g.offsetHeight,h=null,k=0,d=d.getVersion();if(7<d&&9>d){h=b;if(!this._hasSingleScroller()||this._isPaged)h=b[AdfDhtmlTableBasePeer._HSCROLLER];null!=this._averageRowHeight&&(k=this._averageRowHeight,
h.style.minHeight=(a?a:8)+k+"px");null!=h&&(a=this._getScrollbarHeight(),f!=a&&(newHeight=g+this._cachedCHHeight+this._cachedCFHeight+a,this._sizeOuterContainer(e,newHeight),this._setScrollerHeight(newHeight,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight)),h.style.minHeight=k+"px")}}};
AdfDhtmlTableBasePeer.prototype._doColResizesFromUser=function(a,b){this._resizedTH=this._largestMinimumWidth=null;var d=this._resizedIndex,e=this.__getVisibleLeafColumns(),f=e.length,g=e[d],h=this.GetDataBody(),k=this.__getSelectedColumns(),l=!1;null==b&&(l=-1!=AdfCollections.indexOf(k,g));var m;this.IsEmpty||(m=h.childNodes[0].rows[0],AdfAssert.assert(null!=m,"this.IsEmpty was "+this.IsEmpty+" but there were no rows!"));var n=[],g=[],p,q=0,r=0,s,u=this._columnStretching;for(s=0;s<f;s++){p=e[s];
var t=this._getColumnFlex(p,null,u,f,s),h=this._getColumnActualWidth(s,m);l&&-1!=AdfCollections.indexOf(k,p)||!l&&s==d?(null!=b&&(t=this._getColumnFlex(null,b,u,f,s)),q++,r+=h,g.push({component:p,displayIndex:s,flex:t,minimumWidth:p.getMinimumWidth(),actualWidth:h})):null!=t&&p.getMinimumWidth()}if("none"!=u&&"blank"!=u)return this._userDragStretchedColumns(a,b,m,g,e,u);d=q*a-r;h=Math.abs(d);s=n.length;p=Math.floor(h/s);k=h-s*p;l=0;do{for(m=0;m<s;m++)f=n[m],!0!=f.atMinimum&&(e=f.minimumWidth,h=f.actualWidth,
q=p,0<k&&(q+=k,k=0),0>d&&(q*=-1),q=h-q,r=f.desiredWidth,null!=r&&(q+=r-h),e=Math.max(e,q),e!=q&&(f.atMinimum=!0,l++),k+=e-q,f.desiredWidth=e);p=0}while(0!=k&&l<s);n=[].concat(n);h=g.length;for(s=0;s<h;s++)p=g[s],null==p.flex?(delta=a-p.actualWidth,this._doResizeColumn(p.displayIndex,null,a,delta,!0)):(p.desiredWidth=a,n.push(p));g=n.length;for(s=f=0;s<g;s++)p=n[s],e=p.desiredWidth,h=p.actualWidth,null==e&&(e=h,p.desiredWidth=e),p.delta=e-h,f+=e;h=[];for(s=0;s<g;s++)p=n[s],e=p.desiredWidth,delta=p.delta,
d=p.displayIndex,this._doResizeColumn(d,null,e,delta,!1),k=Math.round(1E4*e/f)+"%",p=p.component,this._ignoreSetColWidth=!0,p.setProperty(AdfRichColumn.WIDTH,k,!0),delete this._ignoreSetColWidth,h.push({displayIndex:d,width:e});this._currentColumnStretchDetails=h;this._stretchTheColumns();g=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(g)};
AdfDhtmlTableBasePeer.prototype._userDragStretchedColumns=function(a,b,d,e,f,g){var h=[],k=e.length,l=0,m=0,n,p,q=!1;null==b&&(b=0,q=!0);for(p=0;p<k;p++)n=e[p],n.desiredWidth=n.minimumWidth,h[n.displayIndex]=n,l+=n.minimumWidth,m=Math.max(m,n.actualWidth),q&&(b+=n.actualWidth);var r=n=0,s,u=!1;p=[];if(a>m){var u=!0,q=e[k-1].displayIndex+1,t=q==f.length;for(t&&q--;q<f.length;q++)p.push(this._createStrechColumnData(q,f[q],d)),s=p.length-1,n+=p[s].minimumWidth,r+=p[s].actualWidth}else for(q=e[0].displayIndex-
1;0<=q;q--)p.push(this._createStrechColumnData(q,f[q],d)),s=p.length-1,n+=p[s].minimumWidth,r+=p[s].actualWidth;q=r-n;if(this._nothingFlexible&&(n=this.GetDataBody(),(r=n.childNodes)&&r[0]))n=n.offsetWidth-r[0].offsetWidth,0<n&&(q+=n);m=a-m;if(0<=m&&m>q&&(a=q+l,m=q,0>=a))return;e.sort(AdfDhtmlTableBasePeer.__columnSortComparator);for(b=b-l+m;0!=b;){r=[];s=e[0].desiredWidth;for(q=0;q<k;q++){var v=0;n=e[q];e[q+1]?v=n.desiredWidth:(s=Math.abs(b),v=Math.abs(b));if(v<=s)r.push(n);else break}n=Math.floor(b/
r.length);n>s&&r.length<k&&(n=e[r.length].desiredWidth-r[r.length-1].desiredWidth);for(q=0;q<r.length;q++)r[q].desiredWidth+=n,b-=n;1>b/r.length&&(e[k-1].desiredWidth+=b,b=0)}for(q=0;q<k;q++)n=e[q],n.flex=Math.abs(n.desiredWidth),this._doResizeColumn(n.displayIndex,null,n.flex,n.flex-n.actualWidth,!0);u||(e=e[k-1].displayIndex+1,f[e]||e++,e<f.length&&(k=Math.abs(m),p[e]={component:f[e],displayIndex:q,minimumWidth:f[e].getMinimumWidth(),actualWidth:this._getColumnActualWidth(e,d)},p[e].actualWidth+=
k,this._doResizeColumn(e,null,p[e].actualWidth,k,!0),a>=l&&(m=0)));if(u&&!t){t=m;for(q=0;q<p.length;q++)if(a=p[q],a.component)if(l=a.actualWidth-a.minimumWidth,t>=l)a.newWidth=a.minimumWidth,a.flex=a.newWidth,h[a.displayIndex]=a,this._doResizeColumn(a.displayIndex,null,a.newWidth,-l,!0),t-=l;else{a.newWidth=a.actualWidth-t;a.flex=a.newWidth;h[a.displayIndex]=a;this._doResizeColumn(a.displayIndex,null,a.newWidth,t,!0);break}}p=[];for(q=0;q<f.length;q++)h[q]||(a=this._getColumnFlex(f[q],null,g,f.length,
q))&&p.push({displayIndex:q,width:this._getColumnActualWidth(q,d)});this._currentColumnStretchDetails=p;this._stretchTheColumns();d=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(d)};AdfDhtmlTableBasePeer.prototype._createStrechColumnData=function(a,b,d){var e=null;b?e={component:b,displayIndex:a,minimumWidth:b.getMinimumWidth(),actualWidth:this._getColumnActualWidth(a,d)}:(b=this._getColumnActualWidth(a,d),e={component:null,displayIndex:a,minimumWidth:b,actualWidth:b});return e};
AdfDhtmlTableBasePeer.__columnSortComparator=function(a,b){return a.minimumWidth-b.minimumWidth};AdfDhtmlTableBasePeer.prototype.__getPixelWidthFromPercent=function(a){a=parseInt(a);return!isNaN(a)?(a=this.GetDataBody().offsetWidth*a/100,a.toFixed(0)):null};
AdfDhtmlTableBasePeer.prototype.resizeColumn=function(a,b,d){if(!this._ignoreSetColWidth){for(var e=0<b.toString().indexOf("%"),f=a.getClientId(),g=this.__getColumnHeader(),h=AdfAgent.AGENT,g=g.getElementsByTagName("th"),k=g.length,l,m=0;m<k;++m)if(g[m].id==f){l=g[m];this._resizedIndex=f=h.getIntAttribute(l,"_d_index",0);break}if(l){l=100;null!=b&&(l=b,e&&(l=this.__getPixelWidthFromPercent(b)));if(isNaN(l)||0>=l||3200<l)l=100;b=this.__getSelectedColumns();if(-1!=AdfCollections.indexOf(b,a)){a=b.length;
for(e=0;e<a;e++)l=Math.max(l,b[e].getMinimumWidth())}else l=Math.max(l,a.getMinimumWidth());this._doColResizesFromUser(l,d)}}};
AdfDhtmlTableBasePeer.prototype._doResizeColumn=function(a,b,d,e,f){var g=!1,h=!1,k=!1,l=!1;this._hasFrozenColumn()&&(this._totalWidth=void 0!==this._totalWidth?this._totalWidth+e:e,this._isColumnFrozen(a)?(this._frozenWidth+=e,k=!0):(this._unfrozenWidth+=e,l=!0));var m=this.GetDataBody();(k||l)&&!this.IsEmpty&&this._sizeRegionsForFrozenColumns(m,m.offsetWidth);this._headerless||(l=this.__getColumnHeader(),b||(b=this._getColumnHeaderFooterSizingCell(a,l,"t","d2","t2")),this._resizeColumnHeaderFooterColumn(b,
e,l,a,"t","d2","t2"),this.IsEmpty?("multiple"!=this._columnStretching&&this._incrementWidth(l,e),this._synchronizeColumnRowHeights(l,"t","d2","t2")):(this._synchronizeColumnRowHeights(l,"t","d2","t2"),b=l.offsetHeight,b!=this._cachedCHHeight&&(this._cachedCHHeight=b,g=!0)));this._footerless||(l=this._getColumnFooter(),b=this._getColumnHeaderFooterSizingCell(a,l,"ft","fd2","ft2"),this._resizeColumnHeaderFooterColumn(b,e,l,a,"ft","fd2","ft2"),this.IsEmpty?(this._incrementWidth(l,e),this._synchronizeColumnRowHeights(l,
"ft","fd2","ft2")):(this._synchronizeColumnRowHeights(l,"ft","fd2","ft2"),b=l.offsetHeight,b!=this._cachedCFHeight&&(this._cachedCFHeight=b,h=!0)));if(!this.IsEmpty){e=this._resizeDataBodyColumn(m,a,e);if(g||h||k)g=this.getDomElement(),this._setScrollerTop(this._cachedCHHeight),this._setScrollerHeight(g.clientHeight,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight),this._setScrollerWidth(g.clientWidth,this._frozenWidth);g=m.firstChild;g=this._hasFrozenColumn()?!this._areAllColumnsFrozen()?
parseInt(this._getNestedScrolledTable(g.rows[0]).style.width):0:parseInt(g.style.width);this._setFakeCanvasWidth(g);g=e.relFactor;h=e.delta;g=void 0!=h?h:Math.round((g-1)*this._averageRowHeight*this.GetKnownRowCount());this._adjustCanvasHeight(g,m,!0,!0);f&&(a=this.__getVisibleLeafColumns()[a],this._ignoreSetColWidth=!0,a.setProperty(AdfRichColumn.WIDTH,d,!0),delete this._ignoreSetColWidth);d=this.__getScrollLeft();this._currentScrollLeft!=d&&(this._currentScrollLeft=d,this._handleHorizontalScroll(d));
this._virtInitialized||this._fillViewPort(m,m.offsetHeight,!1)}};
AdfDhtmlTableBasePeer.prototype._resizeColumnHeaderFooterColumn=function(a,b,d,e,f,g,h){a=this._incrementWidth(a,b);f=AdfDhtmlTableBasePeer.__getChildBySubId(d,f);this._hasFrozenColumn()?(d=AdfDhtmlTableBasePeer.__getChildBySubId(d,g),h=AdfDhtmlTableBasePeer.__getChildBySubId(d,h),this._freezeColumnsToStart()?this._isColumnFrozen(e)?(this._incrementWidth(f,b),b=f.style.width,e=d.style,AdfDhtmlTableBasePeer._isRTL()?e.right=b:e.left=b):this._incrementWidth(h,b):this._isColumnFrozen(e)?this._incrementWidth(f,
b):(this._incrementWidth(h,b),b=h.style.width,AdfDhtmlTableBasePeer._isRTL()?f.style.right=b:f.style.left=b)):this._incrementWidth(f,b);return a};
AdfDhtmlTableBasePeer.prototype._resizeDataBodyColumn=function(a,b,d){var e=0,f=0;a=a.childNodes;for(var g=a.length-1;0<=g;g--){var h=a[g],e=e+h.cachedHeight;this._resizeBlockColumn(h,b,d);h._lastSyncRow=null;this._synchronizeRowHeights(h);var k=h.offsetHeight,f=f+k;if(k!=h.cachedHeight)for(var l=k-h.cachedHeight,m=g+1;m<a.length;m++)a[m].startPos+=l;h.cachedHeight=k}b=1==a.length&&0==a[0].startRow&&a[0].numRows==this.GetKnownRowCount()?f-e:void 0;return{relFactor:f/e,delta:b}};
AdfDhtmlTableBasePeer.prototype._resizeBlockColumn=function(a,b,d){if(!this._hasFrozenColumn()||this._isColumnFrozen(b))a.rows&&(this._freezeColumnsToEnd()?this._incrementWidth(a.rows[0].cells[b-this._firstFrozen+1],d):this._incrementWidth(a.rows[0].cells[b],d));else for(var e=a.rows,f=0;f<e.length;f++){var g;g=this._getNestedScrolledTable(e[f]);this._incrementWidth(g,d);g=this._freezeColumnsToStart()?g.rows[0].cells[b-this._lastFrozen-1]:g.rows[0].cells[b];this._incrementWidth(g,d)}this._hasFrozenColumn()||
this._incrementWidth(a,d)};AdfDhtmlTableBasePeer.prototype._incrementWidth=function(a,b){AdfAssert.assertDomNode(a);var d=parseInt(a.style.width)+b;isNaN(d)||(a.style.width=d+"px");if(this._processColGroup()&&("TH"==a.tagName||"TD"==a.tagName)){var e=this._findColGroupColumn(a);e&&(d=parseInt(e.style.width)+b,e.style.width=d+"px")}return d};
AdfDhtmlTableBasePeer.prototype._findColGroupColumn=function(a,b){AdfAssert.assertDomNode(a);AdfAssert.assert("TH"==a.tagName||"TD"==a.tagName,"Invalid COLGROUP tag name");for(var d=a.parentNode;d&&"TR"!=d.tagName;)d=d.parentNode;if(d){for(var e=d.cells,f=e.length,g=0;g<f&&e[g]!=a;g++);if(g<f){for(d=d.parentNode;d&&"TABLE"!=d.tagName;)d=d.parentNode;if(d&&(d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(d,"COLGROUP"))){d=d.childNodes;++g;for(e=0;e<d.length;e++)if("COL"==d[e].tagName&&--g,0==g)return d[e]}}}return null};
AdfDhtmlTableBasePeer.SetCursor=function(a,b){a&&a.style.cursor!=b&&(a.style.cursor=b)};
AdfDhtmlTableBasePeer.prototype._handleColumnContextMenu=function(a,b){if(this._pcPeer){var d=b?b:this._getParentTH(a);if(d&&null!=d.getAttribute(AdfDhtmlTableBasePeer._LEAF_COLUMN)){var e=AdfPage.PAGE.findComponent(d.id);!e.getSelected()&&this._isColumnSelectionEnabled()&&(this._selUnselectAll(),d=AdfAgent.AGENT.getIntAttribute(d,"_d_index",-1),this._selectColumn(d,e,!0));this._pcPeer.showColumnContextMenu(a,b)}}};
AdfDhtmlTableBasePeer.prototype._handleBodyContextMenu=function(a){var b=this.getComponent(),d=b.getBodyContextMenuId?b.getBodyContextMenuId():null;if(d){b.setSelectedRowKeys({});var e=b.findComponent(d);null==e&&(AdfPage.PAGE.findComponent(d),b=null);this.showContextMenu(a,d,b);AdfAgent.AGENT.eatEvent(a)}};AdfDhtmlTableBasePeer.prototype.GetRowContextMenuId=function(a){return this.getComponent().getContextMenuId()};
AdfDhtmlTableBasePeer.prototype._getRowContextMenuAndContainer=function(a){a=this.GetRowContextMenuId(a);var b,d;if(a){var e=this.getComponent();b=AdfPage.PAGE.findComponent(a);d=null;null==b&&(b=e.findComponent(a),d=e);null==b&&AdfLogger.LOGGER.severe("Could not find context menu ",a," from component ",e)}return{popup:b,menuId:a,menuFindContainer:d}};
AdfDhtmlTableBasePeer.prototype.HandleRowContextMenu=function(a,b,d,e,f){var g=this._getRowContextMenuAndContainer(b),h=g.popup,k=g.menuFindContainer,l=g.menuId;h&&(this._contextMenuSelect?AdfAgent.AGENT.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]!=AdfAgent.CAP_TOUCH_SCREEN_NONE&&!this._selIsSelected(b)&&(this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selSelectRow(b,d)):(this._isMultipleRowSelect()||this._unhiglightAnyExistingHighlightedRow(),
this._selHighlightRow(d),this._highlightedRowKey=b,this._highlightedRow=d),d=this.getComponent().getClientId(),AdfObject.ensureClassInitialization(AdfDhtmlCommandMenuItemPeer),h[AdfMenuUtils.AFR_TARGETROWCURRENCY]=b,h[AdfMenuUtils.AFR_TARGETCOMPONENTID]=d,g={component:this.getComponent(),rowKey:b},AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._setHighlightedRowKey,g,10),AdfDhtmlTableBasePeer._setHighlightedRowKey(g),this._contextMenuClosedCallback||(this._contextMenuClosedCallback=this.createCallback(this._contextMenuClosed)),
this._contextMenuOpenedCallback||(this._contextMenuOpenedCallback=this.createCallback(this._contextMenuOpened)),h._afrTableListenerSet||(h.addEventListener(AdfPopupOpenedEvent.POPUP_OPENED_EVENT_TYPE,this._contextMenuOpenedCallback),h.addEventListener(AdfPopupClosedEvent.POPUP_CLOSED_EVENT_TYPE,this._contextMenuClosedCallback),h._afrTableListenerSet=!0),h.isPopupVisible()&&(h.hide(),this._ignoreContextMenuClose=!0),this.showContextMenu(a,l,k,e,f,d),AdfAgent.AGENT.eatEvent(a))};
AdfDhtmlTableBasePeer.prototype.ContextMenuOpened=function(a,b){};AdfDhtmlTableBasePeer.prototype.ContextMenuClosed=function(a,b){};
AdfDhtmlTableBasePeer.prototype._contextMenuOpened=function(a){this._rowContextMenuVisible=!0;var b=a.getSource();if(!this._contextMenuSelect){var d=this._getRowContextMenuAndContainer(this._highlightedRowKey).popup;null!=d&&b.getClientId()==d.getClientId()&&(this._isMultipleRowSelect()||this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!1))}this.ContextMenuOpened(a,b)};
AdfDhtmlTableBasePeer.prototype._contextMenuClosed=function(a){if(this._ignoreContextMenuClose)delete this._ignoreContextMenuClose;else{delete this._rowContextMenuVisible;var b=a.getSource();if(!this._contextMenuSelect){var d=this._getRowContextMenuAndContainer(this._highlightedRowKey).popup;null!=d&&b.getClientId()==d.getClientId()&&(this._grabFocus(),this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1),this._unhiglightAnyExistingHighlightedRow())}delete b[AdfMenuUtils.AFR_TARGETROWCURRENCY];
delete b[AdfMenuUtils.AFR_TARGETCOMPONENTID];AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._clearHighlightedRowKey,this.getComponent(),10);this.ContextMenuClosed(a,b)}};AdfDhtmlTableBasePeer._clearHighlightedRowKey=function(a){a.setProperty("_highlightedRowKey",null,!1,AdfUIComponent.PROPAGATE_ALWAYS)};AdfDhtmlTableBasePeer._setHighlightedRowKey=function(a){a.component.setProperty("_highlightedRowKey",a.rowKey,!1,AdfUIComponent.PROPAGATE_ALWAYS)};
AdfDhtmlTableBasePeer.prototype.ProcessPushData=function(a,b){if(this._virtInitialized||this.IsEmpty)if(this._activeDataCount>=b)AdfPage.PAGE.addPartialTargets(this.getComponent());else{this._activeDataCount=b;this._payloadEvaluator||(this._payloadEvaluator=new Function("payload","return payload;"));for(var d=this._payloadEvaluator(a),e=0;e<d.length;e++){var f=d[e];this.IsFetchPending()?(f.id=b,this._getActiveMessageBuffer().push(f)):this._processActiveMessage(f)}d=this.GetDataBody();this._fillViewPort(d,
d.offsetHeight,!1);return!0}};AdfDhtmlTableBasePeer.prototype._processActiveMessage=function(a){var b,d,e=a.type;switch(e){case "update":d=this.UpdateActiveRow(a);break;case "remove":d=this.RemoveActiveRow(a);break;case "insertBefore":case "insertAfter":case "insertInside":d=this.InsertActiveRow(a,e);break;default:AdfAssert.assert(!1,"Unknown ADS type:"+e),b=AdfDhtmlTableBasePeer.RERENDER_CONTAINER}d&&(b=d.rerender,this._announceActiveDataUpdate(e,d.updates));b&&AdfPage.PAGE.addPartialTargets(this.getComponent())};
AdfDhtmlTableBasePeer.prototype.IsValidAnnouncement=function(a,b,d){var e=b.getAttribute(a,"aria-live")||"",e=e.toLowerCase();if(""!==e)return!1;a=b.getAttribute(a,"aria-relevant")||"";a=a.toLowerCase().trim();b=a.split(" ");if(-1<b.indexOf("all"))return!0;e=!1;switch(d){case "update":if(""===a||-1<b.indexOf("text"))e=!0;break;case "remove":-1<b.indexOf("removals")&&(e=!0);break;case "insertBefore":case "insertAfter":case "insertInside":if(""===a||-1<b.indexOf("additions"))e=!0}return e};
AdfDhtmlTableBasePeer.prototype._announceActiveDataUpdate=function(a,b){if(b&&""!==b){var d=this.getDomElement(),e=AdfAgent.AGENT;if(d&&this.IsValidAnnouncement(d,e,a)){var e=AdfPage.PAGE.getLookAndFeel(),f=this.getComponent(),d=f.getAccessibleName();null==d&&(d="",AdfLogger.LOGGER.fine("No shortDesc exists for the component with clientId: ",f.getClientId()));f=this.GetActiveDataAnnouncementKey(a);e=e.getTranslatedString(f);e=TrFastMessageFormatUtils.format(e,d,b);this._twinkledCellAnnouncements=
this._twinkledCellAnnouncements+" "+e}}};AdfDhtmlTableBasePeer.prototype.GetActiveDataAnnouncementKey=function(a){return AdfDhtmlTableBasePeer.msgMap[a]||"AFActiveDataTableRowInsert"};AdfDhtmlTableBasePeer.prototype.RegisterADSAccessibility=function(){};AdfDhtmlTableBasePeer.prototype._getActiveMessageBuffer=function(){this._activeMessageBuffer||(this._activeMessageBuffer=[]);return this._activeMessageBuffer};
AdfDhtmlTableBasePeer.prototype._resetActiveMessageBuffer=function(){this._activeMessageBuffer=null};AdfDhtmlTableBasePeer.prototype._applyBufferedADSEvents=function(a,b){if(-1!=a){var d=this._activeMessageBuffer;if(d)for(var e=0;e<d.length;e++){var f=d[e],g=f.id;(b?g<=a:g>a)&&this._processActiveMessage(f)}}};
AdfDhtmlTableBasePeer.prototype.IsInsertAllowed=function(a){var b=!0,d=this.GetDataBody().childNodes,e=d[0],d=d[d.length-1];if(this._pendingFetch==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE)a==d.startRow+d.numRows&&(b=!1);else if(this._pendingFetch==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE)a==e.startRow&&(b=!1);else if(void 0==this._pendingFetch&&a!=d.startRow+d.numRows&&(a<e.startRow||a>=d.startRow+d.numRows))b=!1;return b};
AdfDhtmlTableBasePeer.prototype._findADSInsertLocation=function(a,b,d){var e=-1;if("insertBefore"==b)if(a){if(a=this.FindRowByKey(a))e=a.index}else a=d[d.length-1],b=this.GetRowCount(),-1!=b&&a.startRow+a.numRows==b&&(e=b);else a?(a=this.FindRowByKey(a))&&(e=a.index+1):0==d[0].startRow&&(e=0);return e};
AdfDhtmlTableBasePeer.prototype.InsertClonedRow=function(a,b,d){var e=a.cloneNode(!0);this._cleanClonedRow(e,d);e.setAttribute(AdfDhtmlTableBasePeer._ROW_KEY,d);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._SELECTED_CLASS);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._HIGHLIGHTED_CLASS);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._FOCUSED_CLASS);a=a.parentNode.parentNode.cloneNode(!1);d=this.getDomDocument().createElement("TBODY");d.appendChild(e);a.appendChild(d);this.InsertBlock(a,
b,1,1,0);return e};AdfDhtmlTableBasePeer.prototype.InsertClonedComponents=function(a,b){var d=AdfAgent.AGENT.getDescendantComponentsForNode(a);if(d)for(var e=d.length,f=0;f<e;f++){var g=d[f],h=g.getClientId(),h=this._fixClonedClientId(h,b);g.clone(h).AddNotify()}};
AdfDhtmlTableBasePeer.prototype.InsertActiveRow=function(a,b){var d,e=null;this.IsEmpty||(e=this.GetDataBody().childNodes);if(e&&0<e.length){var f=this._findADSInsertLocation(a.iKey,b,e);if(-1!=f&&this.IsInsertAllowed(f)){var g=a.rKey,e=this.GetTemplateRow(e);this.InsertClonedRow(e,f,g);this.InsertClonedComponents(e,g);renderer=this.UpdateActiveRow(a).rerender}else d=AdfDhtmlTableBasePeer.RERENDER_CONTAINER_CHILDREN}else d=AdfDhtmlTableBasePeer.RERENDER_CONTAINER_CHILDREN;f=this.GetActiveRowText(a.rKey,
b);return{rerender:d,updates:f}};AdfDhtmlTableBasePeer.prototype.GetTemplateRow=function(a){a=a[0].rows;AdfAssert.assert(a&&a[0],"Unable to insert active row when the block contains no rows to clone!");return a[0]};
AdfDhtmlTableBasePeer.prototype.RemoveActiveRow=function(a){var b="";if(!this.IsEmpty){var d=this.FindRowByKey(a.rKey);if(d){var e=d.tr,b=this.GetActiveRowText(a.rKey,"remove");AdfAgent.AGENT.elementsRemoved(e);this.DeleteBlock(d.index,1,1,0,null);AdfPage.PAGE.removeComponentsInSubtree(e)}}return{rerender:"",updates:b}};AdfDhtmlTableBasePeer.prototype.MaxOfRerender=function(a,b){if(a===b)return a;var d=AdfDhtmlTableBasePeer._RERENDER_PRIORITY,e=d[a],d=d[b];return!e?b:!d?a:e>=d?a:b};
AdfDhtmlTableBasePeer.prototype.UpdateActiveRow=function(a){var b="",d=a.type;if(!this.IsEmpty){a=a.updates;for(var e="",f=0;f<a.length;f++)var g=a[f],g=this._applyActiveDataUpdate(g.cliId,g.callback,g.properties,g.formattedProperties,d),b=this.MaxOfRerender(b,g.result),e=e+" "+g.update,e=e.trim()}return{rerender:b,updates:e}};AdfDhtmlTableBasePeer.prototype._cleanClonedRow=function(a,b){for(var d=0;d<this._colCount;d++){var e=this.FindCellByIndex(a,d);this._fixElementIds(e,b)}AdfAgent.AGENT.elementsAdded(a)};
AdfDhtmlTableBasePeer.prototype._fixElementIds=function(a,b){a.id=this._fixClonedClientId(a.id,b);for(var d=a.firstChild;d;)1==d.nodeType&&this._fixElementIds(d,b),d=d.nextSibling};AdfDhtmlTableBasePeer.prototype._fixClonedClientId=function(a,b){var d="";if(a){for(var e=a.split(":"),f=0;f<e.length-2;f++)d+=e[f],d+=":";d=d+(b+":")+e[e.length-1]}return d};AdfDhtmlTableBasePeer.prototype.IsNodeStampCell=function(a){return!1};
AdfDhtmlTableBasePeer.prototype._applyActiveDataUpdate=function(a,b,d,e,f){var g=AdfAgent.AGENT.getElementById(a);if(!g)return{result:!1,update:""};g=this._findCellContainingChild(g);if(!g)return{result:!1,update:""};var h=g.textContent;this._markAsActive(g,a);a=(new Function("clientId","properties","formattedProperties",b))(a,d,e);f=this.GetUpdatedActiveValues(g,f,h);return{result:a,update:f}};
AdfDhtmlTableBasePeer.prototype.GetUpdatedActiveValues=function(a,b,d){d="";if("update"!==b)return d;var e=this.getDomElement();if(!e||!this.IsValidAnnouncement(e,AdfAgent.AGENT,b))return d;d=this.GetRowHeaderText(a,e);d.trim();if(""===d)return d;b=this.GetColHeaderText(a);a=a.textContent;e=AdfPage.PAGE.getLookAndFeel().getTranslatedString("AFActiveDataTableRowUpdateInfo");return e=TrFastMessageFormatUtils.format(e,d,b,a)};
AdfDhtmlTableBasePeer.prototype.GetActiveRowText=function(a,b){var d="",e=this.getDomElement(),f=AdfAgent.AGENT;return!e||!this.IsValidAnnouncement(e,f,b)?d:d=this.GetRowText(a,e,f)};
AdfDhtmlTableBasePeer.prototype.GetRowText=function(a,b,d){var e="";try{var f=this.FindRowByKey(a).tr.cells;if(this.IsWholeRowRead(b,d)){var g=f.length;for(a=0;a<g;a++)e=e+f[a].textContent+" "}else e=f[0].textContent;return e=e.trim()}catch(h){return AdfLogger.LOGGER.fine("Exception while trying to get the announcement text for the active data row insert/delete"+h),e}};
AdfDhtmlTableBasePeer.prototype.IsWholeRowRead=function(a,b){var d=b.getAttribute(a,"data-aria-read-whole-row")||"",d=d.toLowerCase().trim();return"true"===d?!0:!1};AdfDhtmlTableBasePeer.prototype.GetRowHeaderText=function(a,b){try{return(cells=this.GetRowKeyAndRow(a,b)[1].cells[0]).textContent}catch(d){return AdfLogger.LOGGER.fine("Exception while trying to get the header text of active row:"+d),""}};
AdfDhtmlTableBasePeer.prototype.GetColHeaderText=function(a){try{if(this._headerless)return"";var b=this._getCellIndex(a);return this._getColumnHeaderLeafCell(b).textContent}catch(d){return AdfLogger.LOGGER.fine("Exception while trying to get the column header text of active row:"+d),""}};
AdfDhtmlTableBasePeer.prototype._markAsActive=function(a,b){a&&(AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_ON_STYLE_CLASS),AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_OFF_STYLE_CLASS),this._twinkledCells.push(b))};AdfDhtmlTableBasePeer.prototype._resetTwinkledCellStyling=function(){AdfPage.PAGE.announceToAssistiveTechnology(this._twinkledCellAnnouncements);window.setTimeout(AdfDhtmlTableBasePeer._cleanUpAdsNodes,1E3,this)};
AdfDhtmlTableBasePeer.prototype._cleanUpAdsNode=function(a){if(this.getDomElement()){if(a=AdfAgent.AGENT.getElementById(a))for(var b=self._twinkledCells.length,d=0;d<b;d++)if(a=self._twinkledCells[d],a=AdfAgent.AGENT.getElementById(a))if(a=self._findCellContainingChild(a))AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_ON_STYLE_CLASS),AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_OFF_STYLE_CLASS);delete self._twinkledCells;delete self._twinkledCellAnnouncements;self._twinkledCells=
[];self._twinkledCellAnnouncements=""}};AdfDhtmlTableBasePeer.prototype.FindRowByKey=function(a){for(var b=null,d=this.GetDataBody().childNodes,e=0;e<d.length&&!b;e++){var f=d[e],g=f.rows;if(g)for(var h=0;h<g.length&&!b;h++){var k=g[h];if(a==k.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY)){b={tr:k,index:f.startRow+h,block:f};break}}}return b};
AdfDhtmlTableBasePeer.prototype.FindCellByIndex=function(a,b){AdfAssert.assert(null!=a,"Unable to find cell by index if the given row is invalid!");var d=null,d=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?(d=this._getNestedScrolledTable(a),d=d.rows[0].cells[b-this._lastFrozen-1]):this._freezeColumnsToEnd()?this._isColumnFrozen(b)?d=0<this._firstFrozen?a.cells[b-this._firstFrozen+1]:a.cells[b]:(d=this._getNestedScrolledTable(a),d=d.rows[0].cells[b]):d=a.cells[b];return d};
AdfDhtmlTableBasePeer.prototype._findCellContainingChild=function(a){for(var b=AdfAgent.AGENT;a&&"TD"!==b.getNodeName(a);)a=a.parentNode;return a};
AdfDhtmlTableBasePeer.prototype._getColumnFlex=function(a,b,d,e,f){if(!a)return null;if("multiple"==d)return e=b,null==e&&(e=""+a.getWidth()),a=e.length-1,"%"!=(""+e).charAt(a)?null:Math.abs(parseInt(e.substring(0,a)));if("last"==d){if(b=a.getDisplayIndex(),-1==b&&(b=f),b==e-1&&!a.getRowHeader())return 1}else if(b=this._stretchedColumnId,null!=b&&(d=a.getClientId(),d.substring(1+d.lastIndexOf(":"))==b&&(b=a.getDisplayIndex(),-1==b&&(b=f),!a.getRowHeader()&&(!this._isColumnFrozen(b)||this._freezeColumnsToEnd()&&
b==e-1))))return 1;return null};AdfDhtmlTableBasePeer.prototype._getColumnActualWidth=function(a,b){var d=100,e=!1,f;f=this.IsEmpty?this._getColumnHeaderFooterSizingCell(a,this.__getColumnHeader(),"t","d2","t2"):this.FindCellByIndex(b,a);try{var g=AdfAgent.AGENT.getComputedStyle(f).width,d=parseInt(g);if(isNaN(d)||0>d)if(d=parseInt(f.style.width),isNaN(d)||0>d)d=100,e=!0}catch(h){d=100,e=!0}e&&AdfLogger.LOGGER.warning("INVALID COLUMN WIDTH FOR COLUMN DISPLAY INDEX: "+a);return d};
AdfDhtmlTableBasePeer.prototype._stretchTheColumns=function(){var a=this._columnStretching;if(!(null==a||"none"==a))if(!(this._nothingFlexible||this.IsEmpty&&this._headerless)){this._stretchingTheColumns=!0;try{this._doColumnStretching(a)}finally{delete this._stretchingTheColumns}}};
AdfDhtmlTableBasePeer.prototype._doColumnStretching=function(a,b){var d,e,f,g,h,k=0,l=this.__getVisibleLeafColumns();e=l.length;f=Array(e);g=Array(e);h=Array(e);for(var m=!0,n=0;n<e;n++){var p=l[n];d=this._getColumnFlex(p,null,a,e,n);null!=d&&(m=!1,f[n]=d,d=""+p.getWidth(),d.lastIndexOf("%")==d.length-1&&(h[n]=d.substring(0,d.length-1),k+=Math.abs(parseInt(h[n]))),g[n]=isNaN(d)?p.getMinimumWidth():d)}if(m)this._nothingFlexible=!0;else{if("multiple"==a)for(x=0;x<h.length;x++)h[x]/=k;k=this._colCount;
m=this.GetDataBody();d=m.childNodes[0];h=!1;var q;this.IsEmpty||(q=d.rows[0],AdfAssert.assert(null!=q,"this.IsEmpty was "+this.IsEmpty+" but there were no rows!"));l=0;!this._hasFrozenColumn()||this._areAllColumnsFrozen(k)?(k=m.offsetWidth,d=this.IsEmpty?this.__getColumnHeader().firstChild.offsetWidth:d.offsetWidth,l=k-d):this.IsEmpty?(k=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(k,"t"),l=AdfDhtmlTableBasePeer.__getChildBySubId(k,"d2"),l=AdfDhtmlTableBasePeer.__getChildBySubId(l,
"t2"),k=k.parentNode.offsetWidth,l=k-d.offsetWidth-l.offsetWidth-2):(d=this._getNestedScrolledTable(q),this._freezeColumnsToEnd()?(k=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(k,"t"),l=AdfDhtmlTableBasePeer.__getChildBySubId(k,"d2"),l=AdfDhtmlTableBasePeer.__getChildBySubId(l,"t2"),k=k.parentNode.offsetWidth,m=this._getScrollbarWidth(),l=k-d.offsetWidth-l.offsetWidth-m-2,this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY&&(l+=m)):(k=d.parentNode.offsetWidth,
l=k-d.offsetWidth));if(0!=l||!this._virtInitializedComplete){k=[];for(n=m=0;n<e;n++)d=f[n],null!=d&&(p=this._getColumnActualWidth(n,q),m+=p,k.push({displayIndex:n,flex:d,minimumWidth:g[n],width:p}));q=m+l;e=k.length;var r;d=!1;for(l=0;!d&&l<e;){m=q;for(f=n=0;f<e;f++)r=k[f],r.atMinimum?(g=r.minimumWidth,m-=g):n+=r.flex;var p=m,s=0;for(f=0;f<e;f++)if(r=k[f],!r.atMinimum){var u=r.flex/n*p;g=Math.floor(u);minimumWidth=r.minimumWidth;g<minimumWidth?(g=minimumWidth,r.atMinimum=!0,l++):s+=u-g;r.calculatedWidth=
g;m-=g}s=Math.round(s);m==s&&(0<s&&(r.calculatedWidth+=s),d=!0)}q=[];for(f=0;f<e;f++)if(r=k[f],d=r.displayIndex,g=r.calculatedWidth,q.push({displayIndex:d,width:g}),r=g-r.width,0!=r||!this._virtInitializedComplete)h=!0,this._doResizeColumn(d,null,g,r,!1);this._currentColumnStretchDetails=q}h&&(b||(b=0),5>b&&this._doColumnStretching(a,++b))}};
AdfDhtmlTableBasePeer.prototype._stretchLastBlockColumn=function(a){var b;if(-1!=this._lastColWidthOverride){var d=this._colCount-1;AdfAssert.assert(null!=a.rows,"Unable to stretch the columns in the last fetched block because it contains no rows!");b=this.FindCellByIndex(a.rows[0],d);b=parseInt(b.style.width);this._resizeBlockColumn(a,d,this._lastColWidthOverride-b)}else if(null!=this._currentColumnStretchDetails){AdfAssert.assert(null!=a.rows,"Unable to stretch the columns in the last fetched block because it contains no rows!");
for(var d=this._currentColumnStretchDetails,e=d.length,f=0;f<e;f++){var g=d[f],h=g.displayIndex;b=this.FindCellByIndex(a.rows[0],h);b=parseInt(b.style.width);this._resizeBlockColumn(a,h,g.width-b)}}};
AdfDhtmlTableBasePeer.prototype._collectClientTokens=function(a){for(var b="",d=this.GetDataBody().childNodes,e=0;e<d.length;e++)for(var f=d[e].rows,g=0;g<f.length;g++){var h=f[g].getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);if("flat"==a)b+=h,b+="_";else for(var h=h.split(","),k=h.length,b=b+h[k-1],b=b+"_",l=0;l<k-1;l++){var m=h[l];b.match(RegExp("(^|_)"+m+"(_|$)"))||(b+=m,b+="_")}}return b};
AdfDhtmlTableBasePeer.prototype._grabFocus=function(){if(this.isInActiveHeirarchy()){var a=AdfPage.PAGE.getActiveDomElement();a&&(this.getDomElement()!=a&&a.blur)&&(a.blur(),AdfFocusUtils.focusElement(this.getDomElement()))}else AdfFocusUtils.focusElement(this.getDomElement())};
AdfDhtmlTableBasePeer.prototype.HandleComponentFocus=function(a){if(this._virtInitialized){if(void 0!=a.getNativeEventTarget){var b=a.getNativeEventTarget();b&&(this._getNavigationBar()&&this._getNavigationBar().contains(b)||this.__getElemBySubId("hscroller")&&this.__getElemBySubId("hscroller").contains(b))?this._avoidSettingFocusOnColumnHeader=!0:this._avoidSettingFocusOnColumnHeader=!1;if(b!=this.getDomElement()&&this._isTargetCellEditable(b)){var d=this.getComponent().getClientId(),e=a.getSource();
if(e&&e.getClientId()!=d&&e.getParent()&&e.getParent().getClientId()!=d)return;this._unclipInputElem(b);if(void 0!=b.value&&("TEXTAREA"==b.nodeName||"text"==b.type||"select-one"==b.type))b._afrOldValue=b.value;"INPUT"==b.nodeName&&"text"==b.type&&AdfPage.PAGE.scheduleTimer(this,this._selectInputOnMouseUp,b,0)}}null!=this._blurTimeout&&(clearTimeout(this._blurTimeout),delete this._blurTimeout);a.getEventPhase()!=AdfBaseEvent.BUBBLING_PHASE&&null==this._focusTimeout&&(null==this._focusTimeoutCallback&&
(this._focusTimeoutCallback=this.createCallback(this._doFocusTimeout)),this._focusTimeout=setTimeout(this._focusTimeoutCallback,10))}};AdfDhtmlTableBasePeer.prototype.HandleComponentBlur=function(a){null==this._blurTimeoutCallback&&(this._blurTimeoutCallback=this.createCallback(this._doBlurTimeout));this._blurTimeout=setTimeout(this._blurTimeoutCallback,10)};
AdfDhtmlTableBasePeer.prototype.HandleHeaderlessFocus=function(){var a=null,b=null,d=null;if(a=this.GetLastRowKey()){var e=this.FindRowByKey(a);e?b=e.tr:a=null}if(null==a&&(e=this.GetFirstVisibleRowKeyAndRow()))a=e.rowKey,b=e.row,this._isRowSelectionEnabled()&&null!=a&&(this._selSelectRow(a,b),this._unclipRow(b));b&&(d=this.FindCellByIndex(b,0));this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b,d)};
AdfDhtmlTableBasePeer.prototype._doFocusTimeout=function(){if(this.getComponent()&&!this._rowContextMenuVisible){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1,null);var a=this._focusManager;a.domElement?this._updateFocusCellStyle(!0):a.objectType!=AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE&&a.objectType!=AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE&&(!this._avoidSettingFocusOnColumnHeader&&!this._setFirstColumnHeaderFocus(!1,!0,!0)&&this.HandleHeaderlessFocus(),this._avoidSettingFocusOnColumnHeader=
!1)}delete this._focusTimeout};AdfDhtmlTableBasePeer.prototype._doBlurTimeout=function(){this.getComponent()&&!this._rowContextMenuVisible&&(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1,null),this.isInActiveHeirarchy()||this._focusManager.domElement&&this._updateFocusCellStyle(!1));delete this._blurTimeout};
AdfDhtmlTableBasePeer.prototype._handleKeyboardSort=function(a){var b=this._focusManager;if(b.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE){var b=b.domElement,d=b.id,e=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(d,AdfDhtmlTableBasePeer.__SORT_INDICATOR));if(e){var e=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),f=AdfPage.PAGE.findComponent(d).getSortProperty(),d=AdfDhtmlTableBasePeer.__getSortOrderForColumn(d);e!=a&&(d=a==AdfDhtmlTableBasePeer._SORTED_DESCENDING?!1:
!0,this.getComponent().setProperty("currentlySelectedHeaderId",b.id),AdfTableUtils.queueSortEvent(this.getComponent(),f,d))}}};AdfDhtmlTableBasePeer.prototype.HandleComponentKeyUp=function(a){a.isCanceled()||(a=AdfAgent.AGENT,a.enableUserSelect(a.getDomDocument().body))};AdfDhtmlTableBasePeer.prototype._disableTabStop=function(a){AdfDomUtils.disableTabStop(this.GetDataBody(),a);var b=this.__getColumnHeader();b&&AdfDomUtils.disableTabStop(b,a)};
AdfDhtmlTableBasePeer.prototype._enterReadOnlyMode=function(a,b){var d=a.getNativeEvent(),e=AdfAgent.AGENT,f=e.getEventTarget(d),g=!1;if(this._reorderTH||this._resizedTH)g=!0;else if(!this._rowContextMenuVisible){this._isTargetCellEditable(f)&&(void 0!=f._afrOldValue&&f.value!=f._afrOldValue&&b)&&(f.value=f._afrOldValue);var h=this.GetFocusedRowKey();h&&h==this._getActiveRowKey()&&this._isClickToEdit()?(h=this.GetRowKeyAndRow(f,this.getDomElement()),null!=h&&null!=h[0]&&(f=this._getCellAndIndexForNode(f,
h[1]),this._lastCTEIndex=f.cellIndex,f.cell&&this._setActiveDescendant(f.cell,!1)),this._setActiveRowKey(null),this._disableTabStop(!0),this._editableTableReadOnlyMode=!0,this._grabFocus(),e.eatEvent(d)):this._isClickToEdit()?this._isTargetCellEditable(f)||(this._selUnselectAll(),this._queueColumnSelectionEvent()):(this._setReadOnlyMode(!0,f,!0),e.eatEvent(d))}return g};
AdfDhtmlTableBasePeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()&&this.__isOwnComponentEvent(a)){var b=a.getNativeEvent(),d=AdfAgent.AGENT,e=d.getEventTarget(b),f=b.keyCode,g=!1,h=this._virtInitialized;switch(f){default:g=!0;break;case AdfKeyStroke.ESC_KEY:g=this._enterReadOnlyMode(a,!0);break;case AdfKeyStroke.M_KEY:b.ctrlKey&&b.altKey&&h?this._handleKeyboardContextMenu(b,!0):g=!0;break;case AdfKeyStroke.A_KEY:b.ctrlKey&&!b.altKey&&h?(this._grabFocus(),e=this._isMultipleRowSelect(),
f=this._isMultipleRowSelectNoSelectAll(),e&&(!f&&!this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY])&&this._selSelectAll()):g=!0;break;case AdfKeyStroke.END_KEY:!(g=this._isTargetCellEditable(e))&&(b.ctrlKey&&b.shiftKey&&h)&&this._handleCtrlShiftEnd(b);break;case AdfKeyStroke.PAGEUP_KEY:(g=this._isTargetCellEditable(e))||this._handlePageUp(b.altKey,b.ctrlKey,b.shiftKey);break;case AdfKeyStroke.PAGEDOWN_KEY:(g=this._isTargetCellEditable(e))||this._handlePageDown(b.altKey,
b.ctrlKey,b.shiftKey);break;case AdfKeyStroke.SPACE_KEY:case 192:h=d.getOS()==AdfAgent.MAC_OS&&192==f&&b.ctrlKey;(g=this._isTargetCellEditable(e))||(h||f==AdfKeyStroke.SPACE_KEY)&&this._handleSpaceKey(f,b);break;case AdfKeyStroke.ENTER_KEY:if(!(g="TEXTAREA"==e.tagName||"A"==e.tagName))g=this._handleEnterKey(e,b);break;case AdfKeyStroke.HOME_KEY:!(g=this._isTargetCellEditable(e))&&(b.ctrlKey&&h)&&this._scrollerScrollToPos(null,0);break;case AdfKeyStroke.F2_KEY:this._editableTableReadOnlyMode?this._exitReadOnlyMode(b):
this._enterReadOnlyMode(a,!1);break;case AdfKeyStroke.TAB_KEY:this._isTargetCellEditable(e)?g=this._handleTabKey(e,b):AdfPage.PAGE.getActiveDomElement()==this.getDomElement()&&!b.shiftKey?(e=this._getActiveRowKey(),null!=e?(f=this.FindRowByKey(e),null!=f&&(null==this._setFocusOnEditableElementInNode(d,f.tr)?g=!0:null==this.GetFocusedRowKey()&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,e,f.tr))):g=!0):g=!0}g||(a.stopBubbling(),d.eatEvent(b))}};
AdfDhtmlTableBasePeer.prototype._handleKeyboardContextMenu=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager;if(e.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE)this._handleColumnContextMenu(a,e.domElement);else if(d=d.getEventTarget(a),b||!this._isTargetCellEditable(d)){var d=this.ResolveContextMenuAlignElement(e.domElement),f=this.GetKeyboardContextMenuAlignHint();this.HandleRowContextMenu(a,e.currency,e.domElement,d,f)}};
AdfDhtmlTableBasePeer.prototype.GetKeyboardContextMenuAlignHint=function(){return null};AdfDhtmlTableBasePeer.prototype.ResolveContextMenuAlignElement=function(a){return a};
AdfDhtmlTableBasePeer.prototype._handleCtrlShiftEnd=function(a){var b=this._focusManager;a=b.objectType;b=b.currency;if(a==AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE||a==AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE)if((a=this.GetDataBody())&&0<a.childNodes.length&&a.childNodes[0].rows[0].getAttribute(AdfDhtmlTableBasePeer._ROW_KEY)==b)this._grabFocus(),this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]||this._selSelectAll()};
AdfDhtmlTableBasePeer.prototype._exitReadOnlyMode=function(a){var b=AdfAgent.AGENT;a=b.getEventTarget(a);if(this._isClickToEdit()){var d=this.GetFocusedRowKey(),e=this._getActiveRowKey();if(!e||d&&(e!=d||this.getComponent().getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY))){if(b=d?d:this._getFirstRowKey())this._setActiveRowKey(b),this._editableTableReadOnlyMode&&(b=this._lastCTEIndex,this._setReadOnlyMode(!1,a,!1),void 0!=b&&(this._clickEditRequest={cellIndex:b}));return}}else!this._isClickToEdit()&&
this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,a,!0);this._isTargetCellEditable(a)&&(d=this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&(a=this._getCellAndIndexForNode(a,d[1]).cell,this._setInputElementCursorAtEndInNode(b,a)))};AdfDhtmlTableBasePeer._restoreSelectedItemOnArrowNav=function(a){a.elem.selectedIndex=a.index};
AdfDhtmlTableBasePeer.prototype._handleArrowKeyNavLeftRight=function(a,b,d,e){var f=null,g=AdfAgent.AGENT;if(a==AdfKeyStroke.ARROWRIGHT_KEY){a=this.__getVisibleLeafColumns().length;for(e+=1;e<a;){f=this.FindCellByIndex(b,e);f=this._setFocusOnEditableElementInNode(g,f);if(null!=f){this._dismissTargetPopupsOnArrowNav(d);break}e++}}else for(e-=1;0<=e;){f=this.FindCellByIndex(b,e);f=this._setFocusOnEditableElementInNode(g,f);if(null!=f){this._dismissTargetPopupsOnArrowNav(d);break}e--}null!=f&&(g.getPlatform()==
AdfAgent.GECKO_PLATFORM&&"SELECT"==f.nodeName&&"select-one"==f.type)&&AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._restoreSelectedItemOnArrowNav,{index:f.selectedIndex,elem:f},0)};
AdfDhtmlTableBasePeer.prototype._handleArrowKeyNav=function(a,b,d){var e=this.GetRowKeyAndRow(b,this.getDomElement());if(null!=e){d=e[0];if(null!=d){var e=e[1],f=this._getCellAndIndexForNode(b,e).cellIndex;this._ctePatternStart=void 0;a==AdfKeyStroke.ARROWUP_KEY||a==AdfKeyStroke.ARROWDOWN_KEY?this._isClickToEdit()?this._clickToEditActivateRow(d,a==AdfKeyStroke.ARROWDOWN_KEY,f):this._setFocusOnEditableRowCell(d,a==AdfKeyStroke.ARROWDOWN_KEY,f):this._handleArrowKeyNavLeftRight(a,e,b,f)}return!1}return!0};
AdfDhtmlTableBasePeer.prototype._dismissTargetPopupsOnArrowNav=function(a){a=AdfRichUIPeer.getFirstAncestorComponent(a);a!=this.getComponent()&&a.getPeer().cancelAllPopups(a)};
AdfDhtmlTableBasePeer.prototype._handleArrow=function(a,b){switch(this._focusManager.objectType){case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:this._handleRowHeaderArrow(a,b);break;case AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:this._handleFilterCellArrow(a,b);break;case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:this._handleColumnHeaderArrow(a,b);break;case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:a==AdfKeyStroke.ARROWUP_KEY||a==AdfKeyStroke.ARROWDOWN_KEY?this._handleTableBodyArrowUpDown(a==
AdfKeyStroke.ARROWUP_KEY,b.ctrlKey,b.shiftKey):(a==AdfKeyStroke.ARROWLEFT_KEY||a==AdfKeyStroke.ARROWRIGHT_KEY)&&this.HandleTableBodyArrowLeftRight(a==AdfKeyStroke.ARROWLEFT_KEY,b.ctrlKey,b.shiftKey);break;case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:this._handleSelectAllArrow(a,b)}};
AdfDhtmlTableBasePeer.prototype._handleRowHeaderArrow=function(a,b){if(a==AdfKeyStroke.ARROWDOWN_KEY||a==AdfKeyStroke.ARROWUP_KEY){var d=a==AdfKeyStroke.ARROWUP_KEY,e=this._focusManager,f=e.currency;delete this._lastRowKeyInView;e=d?this._getPreviousRowKeyAndRow(f):this._getNextRowKeyAndRow(f);if(e.isAtTop)this._setFirstColumnHeaderFocus(!1);else{var g=e.lastRowKeyInView,f=e.rowKey;null!=f?(d=e.row,g=this.GetRowHeaderCellFromRow(d),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
f,g),this._unclipRow(d)):null!=g?(this.GetScroller(),f=this._currentScrollTop+(d?-this._averageRowHeight:this._averageRowHeight),0<f&&f<this._getScrollHeight()&&(this._lastRowKeyInView=g,this._selectionRequest=d?AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP:AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN,this._scrollerScrollToPos(null,f))):(e=d?this._getLastVisibleRowKeyAndRow():this.GetFirstVisibleRowKeyAndRow(),null!=e.rowKey&&(g=this.GetRowHeaderCellFromRow(e.row),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
e.rowKey,g),this._unclipRow(e.row)))}}else a==AdfKeyStroke.ARROWRIGHT_KEY?null!=this._focusManager.currency&&(e=this._focusManager,f=e.currency,d=e.domElement.parentNode,this._isRowSelectionEnabled()&&(this._selUnselectAll(),this._selSelectRow(f,d)),e=this._findNextCell(this._getActiveCellNode(),!1),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,f,d,e)):a==AdfKeyStroke.ARROWLEFT_KEY&&null!=this._focusManager.currency&&this._changeActiveCell(!0)};
AdfDhtmlTableBasePeer.prototype._handleFilterCellArrow=function(a,b){switch(a){case AdfKeyStroke.ARROWRIGHT_KEY:var d=this._getNextColumnHeaderFocusElement(this._focusManager.domElement);d&&(this._unclipColumnElement(d),this._setHeaderCellFocus(d));break;case AdfKeyStroke.ARROWLEFT_KEY:if(d=this._getPrevColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(d),this._setHeaderCellFocus(d);break;case AdfKeyStroke.ARROWDOWN_KEY:if(d=this._focusManager.domElement)d=this._getCellIndex(d),
0<=d&&this._setIndexedColumnHeaderFocus(!1,!1,d)}};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderArrow=function(a,b){var d=b.ctrlKey,e=b.shiftKey,f=this._virtInitialized;switch(a){case AdfKeyStroke.ARROWRIGHT_KEY:if(f=this._getNextColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(f),!this.getComponent().getDisableColumnReordering()&&d&&e?this._reorderColumnThroughKeyboard(!1):(this._setHeaderCellFocus(f),e&&this._isMultipleColumnSelect()&&this._shiftSelectColumnsThroughKeyboard(f));break;case AdfKeyStroke.ARROWLEFT_KEY:if(f=
this._getPrevColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(f),!this.getComponent().getDisableColumnReordering()&&d&&e?this._reorderColumnThroughKeyboard(!0):this._setHeaderCellFocus(f)!=AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE&&e&&this._isMultipleColumnSelect()&&this._shiftSelectColumnsThroughKeyboard(f);break;case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:var g=this._focusManager.domElement;if(g)if(d&&e)f&&this._handleKeyboardSort(AdfKeyStroke.ARROWUP_KEY==
a?AdfDhtmlTableBasePeer._SORTED_ASCENDING:AdfDhtmlTableBasePeer._SORTED_DESCENDING);else if(1<g.colSpan){if(f=AdfKeyStroke.ARROWUP_KEY==a?this._resolveImmediateParentColumn(g):this._resolveImmediateChildColumn(g))this._unclipColumnElement(f),this._setHeaderCellFocus(f)}else AdfKeyStroke.ARROWDOWN_KEY==a?(attrs=this.GetFirstVisibleRowKeyAndRow(),rowKey=attrs.rowKey,d=attrs.row,this._isRowSelectionEnabled()&&null!=rowKey&&(this._selSelectRow(rowKey,d),this._unclipRow(d)),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
rowKey,d)):this._setIndexedFilterCellFocus(this._getCellIndex(g))}};AdfDhtmlTableBasePeer.prototype._shiftSelectColumnsThroughKeyboard=function(a){if(this._anchorColumnHeader){var b=[],d=[],e=[],f=[];this._resolveColumns(b,d,this._anchorColumnHeader);this._resolveColumns(e,f,a);this._selUnselectAll();this._selectColumnRange(b,d,e,f)}};
AdfDhtmlTableBasePeer.prototype._reorderColumnThroughKeyboard=function(a){var b=this._focusManager.domElement;if(b&&null!=b.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN)){var d=null;if(a){d=this._getSiblingDomNode(b,!1);if(null==d){var e=AdfAgent.AGENT.getIntAttribute(b,"_d_index",-1);if(this._hasFrozenColumn()&&!this._isColumnFrozen(e)){var e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t"),f=this._isFilterable()?2:1;e&&(e.rows&&0<e.rows[f].cells.length)&&(d=e.rows[f].cells,
d=d[d.length-1])}}null!=d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)&&(d=null)}else d=this._getSiblingDomNode(b,!0),null==d&&(e=AdfAgent.AGENT.getIntAttribute(b,"_d_index",-1),this._isColumnFrozen(e)&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"d2"),e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"),f=this._isFilterable()?2:1,e&&(e.rows&&0<e.rows[f].cells.length)&&(d=e.rows[f].cells[0])));d&&(this._reorderTH=b,this._targetReorderTH=d,this._insertColumnAfter=a?AdfDhtmlTableBasePeer._isRTL()?
!0:!1:AdfDhtmlTableBasePeer._isRTL()?!1:!0,this._reorderId=this._reorderTH.id,this._reorderColumnComponentsWithoutAnimation(),this._reorderTH=this._targetReorderTH=null,delete this._insertColumnAfter)}};AdfDhtmlTableBasePeer.prototype._isFilterCell=function(a){return null!=a.getAttribute(AdfDhtmlTableBasePeer._FILTER_COLUMN)};
AdfDhtmlTableBasePeer.prototype._getNextColumnHeaderFocusElement=function(a){var b=AdfAgent.AGENT;if(a){if(1<a.colSpan)return this._resolveImmediateChildColumn(a);for(var d=this._getSiblingDomNode(a,!0),e=this._resolveImmediateParentColumn(a),f=e;!d&&f;)f=null!=(d=this._getSiblingDomNode(e,!0))?this._resolveImmediateParentColumn(d):null;if(d){if((d?this._resolveImmediateParentColumn(d):null)!=e)if((e=this._resolveImmediateParentColumn(d))&&!this._isTargetCellFilter(e))return e;return d}b=b.getIntAttribute(a,
"_d_index",-1);if(this._hasFrozenColumn()&&this._isColumnFrozen(b)&&(b=this.__getColumnHeader(),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t2"),a=this._isFilterCell(a)?1:this._isFilterable()?2:1,b&&b.rows&&0<b.rows[a].cells.length))return b.rows[a].cells[0]}return null};
AdfDhtmlTableBasePeer.prototype._getPrevColumnHeaderFocusElement=function(a){var b=AdfAgent.AGENT;if(a&&null==a.getAttribute("_afrFH")){for(var d=this._isFilterCell(a),e=this._getSiblingDomNode(a,!1),f=this._resolveImmediateParentColumn(a),g=e?this._resolveImmediateParentColumn(e):null,h=f;!e&&h;)h=null!=(e=this._getSiblingDomNode(f,!1))?this._resolveImmediateParentColumn(e):null;if(null!=f&&f!=g&&!this._isTargetCellFilter(f))return f;if(null!=e)return this._resolveBotttomMostChildColumn(e);a=b.getIntAttribute(a,
"_d_index",-1);if(this._hasFrozenColumn()&&!this._isColumnFrozen(a)){if(a=this.__getColumnHeader(),(a=AdfDhtmlTableBasePeer.__getChildBySubId(a,"t"))&&a.rows)if(d=d?1:this._isFilterable()?2:1,d=a.rows[d].cells,a=d.length,0<a)return this._resolveBotttomMostChildColumn(d[a-1])}else this._hasFrozenColumn()&&this._setFirstColumnHeaderFocus(!0,!1,d)}return null};
AdfDhtmlTableBasePeer.prototype._getSiblingDomNode=function(a,b){for(var d=b?a.nextSibling:a.previousSibling;d&&1!=d.nodeType;)d=b?d.nextSibling:d.previousSibling;return d};
AdfDhtmlTableBasePeer.prototype._resolveBotttomMostChildColumn=function(a){var b=a;if(1<a.colSpan){var d=a;AdfAssert.assert(null!=d,"Table peer cannot resolve the bottom-most child column if the parent is null!");b=this._resolveImmediateChildColumn(a);for(a=b=this._resolveRightMostSiblingInGroup(d,b);null!=a;)if(d=a,null!=(a=this._resolveImmediateChildColumn(a)))b=a=this._resolveRightMostSiblingInGroup(d,a)}return b};
AdfDhtmlTableBasePeer.prototype._resolveRightMostSiblingInGroup=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot resolve the right-most sibling in a group if the parent is null!");if(1<a.colSpan)for(var d=b,e=a.colSpan;d&&e>d.colSpan;)if(e-=d.colSpan,null!=(d=this._getSiblingDomNode(d,!0)))b=d;return b};
AdfDhtmlTableBasePeer.prototype.__getParentColumn=function(a){AdfAssert.assertPrototype(a,AdfRichColumn);return!this._headerless&&(a=this._resolveImmediateParentColumn(a.getPeer().getDomElement()))?AdfPage.PAGE.findComponent(a.id):null};
AdfDhtmlTableBasePeer.prototype._resolveImmediateParentColumn=function(a){var b=a.parentNode,d,e=null,f=b.parentNode.parentNode.rows,g=f.length,h=AdfAgent.AGENT;a=h.getIntAttribute(a,"_d_index",-1);for(var k=0;k<g;k++)if(f[k]==b){d=k-1;break}if(0<=d){k=d;for(b=!1;0<=k&&!b;k--){d=f[k].cells;for(g=d.length-1;0<=g;g--){var l=d[g],m=h.getIntAttribute(l,"_d_index",-1);if(1<=l.colSpan&&m<=a&&m+l.colSpan>=a){e=l;b=!0;break}}}}return e};
AdfDhtmlTableBasePeer.prototype._resolveImmediateChildColumn=function(a){var b=AdfAgent.AGENT,d=b.getIntAttribute(a,"_d_index",-1),e=a.parentNode,f;a=null;for(var g=e.parentNode.parentNode.rows,h=g.length,k=h-1;0<=k;k--)if(g[k]==e){f=k+1;break}if(f<h){k=f;for(f=!1;k<h&&!f;k++)for(var e=g[k].cells,l=e.length,m=0;m<l;m++){var n=e[m];if(d==b.getIntAttribute(n,"_d_index",-1)){a=n;f=!0;break}}}return a};
AdfDhtmlTableBasePeer.prototype._unclipColumnElement=function(a){var b=AdfAgent.AGENT;if(this.IsEmpty){var d=this.getDomElement(),e=0;this._hasFrozenColumn()&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t").offsetWidth);a.offsetLeft+a.offsetWidth+e>d.clientWidth+d.offsetLeft&&b.setScrollLeft(d,a.offsetWidth+a.offsetLeft+e-d.clientWidth);d.offsetLeft>a.offsetLeft+e&&b.setScrollLeft(d,a.offsetLeft+e)}else b=this.GetDataBody(),a.offsetLeft+a.offsetWidth>b.clientWidth+this.__getScrollLeft()-
this._frozenWidth?this._scrollerScrollToPos(a.offsetWidth+a.offsetLeft-b.clientWidth+this._frozenWidth,null):this.__getScrollLeft()>a.offsetLeft&&this._scrollerScrollToPos(a.offsetLeft,null)};
AdfDhtmlTableBasePeer.prototype._handleSelectAllArrow=function(a,b){switch(a){case AdfKeyStroke.ARROWUP_KEY:this._isFilterable()&&this._setFirstColumnHeaderFocus(!1,!0,!0);break;case AdfKeyStroke.ARROWDOWN_KEY:var d=this.GetDataBody().childNodes;if(0<d.length&&(d=d[0].rows[0])){var e=d.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),f=this.GetRowHeaderCellFromRow(d);this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,e,f);this._unclipRow(d)}break;case AdfKeyStroke.ARROWRIGHT_KEY:e=this.__getColumnHeader(),
f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t"),AdfAssert.assertDomNode(f),d=this._isFilterable()?2:1,f.rows&&1<f.rows[d].cells.length?this._setHeaderCellFocus(f.rows[d].cells[1]):(e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"d2"),f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"),f.rows&&1<f.rows[d].cells.length&&this._setHeaderCellFocus(f.rows[d].cells[0]))}};
AdfDhtmlTableBasePeer.prototype._setFirstColumnHeaderFocus=function(a,b,d){if(!this._headerless){var e=this.__getColumnHeader();if(null==e)return!1;e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t");d=d?1:this._isFilterable()?2:1;d=e.rows[d].cells[0];if((e=null!=d.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL))||!a)return this._setHeaderCellFocus(d),!b&&!e&&this._unclipColumnElement(d),!0}return!1};
AdfDhtmlTableBasePeer.prototype._setIndexedFilterCellFocus=function(a){if(0<=a&&this._isFilterable()){var b=this.__getColumnHeader();if(!this._headerless&&b){for(var b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t").rows[1].cells[0],d=0;d<a&&b;d++)b=this._getNextColumnHeaderFocusElement(b);b&&this._setHeaderCellFocus(b)}}};
AdfDhtmlTableBasePeer.prototype._setIndexedColumnHeaderFocus=function(a,b,d){return 0==d?this._setFirstColumnHeaderFocus(a,b):!this._headerless&&(a=this._getColumnHeaderId(d))&&(a=AdfAgent.AGENT.getElementById(a))?(this.UpdateFocusManager(AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE,null,a),b||this._unclipColumnElement(a),!0):!1};
AdfDhtmlTableBasePeer.prototype._handleTableBodyArrowUpDown=function(a,b,d){var e=this._isRowSelectionEnabled(),f=this._supportsFocusRowNavigation,g=this._currentScrollTop+(a?-this._averageRowHeight:this._averageRowHeight);if(!e&&!f)0<=g&&g<this._getScrollHeight()&&this._scrollerScrollToPos(null,g);else{var h=this.GetLastRowKey();delete this._lastRowKeyInView;var k=a?this._getPreviousRowKeyAndRow(h):this._getNextRowKeyAndRow(h);if(k.isAtTop)g=this._getActiveCellIndex(),this._setIndexedColumnHeaderFocus(!1,
!1,-1==g?0:g);else{var l=this._isMultipleRowSelect(),m=k.lastRowKeyInView,n=k.rowKey;if(null!=n){g=k.row;if(e)if(d&&l)null!=this._selIsSelected(n)&&null!=this._selIsSelected(m)?(a=a?this._getNextRowKeyAndRow(n):this._getPreviousRowKeyAndRow(n),this._selUnselectRow(m,a.row)):this._selIsSelected(n)?this._selUnselectRow(n,g):this._selSelectRow(n,g);else if(!b||!l||!f)"enabled"==this.getComponent().getSelectionEventDelay()?(a=AdfPage.PAGE,(h=this.FindRowByKey(h))&&h.tr&&this._selUnhighlightRow(h.tr),
this._selHighlightRow(g),this._selectRowTimer&&(a.cancelTimer(this._selectRowTimer),delete this._selectRowTimer),this._selectRowTimer=a.scheduleTimer(this,this._selectRowForTimer,[n,g],300)):(this._selUnselectAll(),this._selSelectRow(n,g));this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,n,g);this._unclipRow(g);delete this._selectionRequest}else if(null!=m){if(0<g&&g<this._getScrollHeight()){this._lastRowKeyInView=m;this._selectionRequest=b&&l&&f||!e&&f?a?AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP:
AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN:a?AdfDhtmlTableBasePeer._SELECT_ARROW_UP:AdfDhtmlTableBasePeer._SELECT_ARROW_DOWN;if(!d&&!b||!l)h=!1,a||(n=this.GetRowCount(),0<=n&&(a=this.GetDataBody().childNodes,a=a[a.length-1],h=a.startRow+a.numRows==n)),h||this._selUnselectAll();this._scrollerScrollToPos(null,g)}}else k=a?this._getLastVisibleRowKeyAndRow():this.GetFirstVisibleRowKeyAndRow(),n=k.rowKey,null!=n&&(g=k.row,e&&this._selSelectRow(n,g),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
n,g),this._unclipRow(g))}}};AdfDhtmlTableBasePeer.prototype._selectRowForTimer=function(a){var b=a[0];a=a[1];this._selUnselectAll();this._selSelectRow(b,a)};
AdfDhtmlTableBasePeer.prototype.HandleTableBodyArrowLeftRight=function(a,b,d){var e=this.__getScrollLeft()+(a?-20:20);d=!0;if(b)this._hasDetailStamp||(e=Math.max(0,e),e<this._getScrollWidth()&&this._scrollerScrollToPos(e,null)),d=!1;else if(a&&(e=this._focusManager.currency)){var f=this.FindRowByKey(e);if(f&&(f=this.GetRowHeaderCellFromRow(f.tr))){var g=this._findNextCell(this._getActiveCellNode(),!0);if(null==g||g==f)this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,e,f),d=!1}}this._hasDetailStamp&&
b&&(b=this.GetFocusedRowKey(),null!=b&&this.getComponent().setDisclosedRowKey(b,!a));d&&this._changeActiveCell(a)};
AdfDhtmlTableBasePeer.prototype._handleHomeEndKey=function(a,b){if(!b.ctrlKey)switch(this._focusManager.objectType){case AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:var d=null,e;if(!b.ctrlKey&&!b.shiftKey){for(e=a==AdfKeyStroke.HOME_KEY?this._getPrevColumnHeaderFocusElement(this._focusManager.domElement):this._getNextColumnHeaderFocusElement(this._focusManager.domElement);e;)d=e,e=a==AdfKeyStroke.HOME_KEY?
this._getPrevColumnHeaderFocusElement(d):this._getNextColumnHeaderFocusElement(d);d&&(this._unclipColumnElement(d),this._setHeaderCellFocus(d))}break;case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:if(d=this._focusManager.currency)if((e=this.FindRowByKey(d))&&e.tr.cells.length){var f=a==AdfKeyStroke.HOME_KEY?e.tr.cells[0]:this._findLastCell(e.tr);f&&(null!=f.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
d,f):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,d,e.tr,f))}}};AdfDhtmlTableBasePeer.prototype._hScrollPage=function(a){var b=this.IsEmpty?this.getDomElement():this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER];if(b&&b.scrollWidth>b.offsetWidth){var d=AdfAgent.AGENT.getScrollLeft(b)-(a?-1:1)*(b.clientWidth-b.clientWidth/10),d=a?Math.max(d,0):Math.min(d,b.scrollWidth);AdfAgent.AGENT.scrollToPos(b,d)}};
AdfDhtmlTableBasePeer.prototype._handlePageUp=function(a,b,d){if(a)this._hScrollPage(!0);else if(this._virtInitialized){a=this.GetDataBody();var e=this._currentScrollTop-a.offsetHeight;d=e>0-a.offsetHeight;var e=0>e?0:e,f=this.getComponent().getSelectedRowKeys(),g=!1,h;for(h in f){g=!0;break}if(!g||b)d&&this._scrollerScrollToPos(null,e);else if(h=this.GetFirstVisibleRowKeyAndRow(),null!=(b=h.rowKey))h=h.row,f=null!=f[b]&&null==f[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],this._selUnselectAll(),
d&&f?(this._selectionRequest=AdfDhtmlTableBasePeer._SELECT_PAGE_UP,e=h.offsetTop+h.parentNode.parentNode.startPos-a.offsetHeight,this._scrollerScrollToPos(null,e)):(this._selSelectRow(b,h),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,b,h),this._unclipRow(h))}};
AdfDhtmlTableBasePeer.prototype._handlePageDown=function(a,b,d){if(a)this._hScrollPage(!1);else if(this._virtInitialized){d=this.GetDataBody();a=this.getComponent().getSelectedRowKeys();var e=!1,f;for(f in a){e=!0;break}if(!e||b)a=this._currentScrollTop+d.offsetHeight,a<this._getScrollHeight()&&this._scrollerScrollToPos(null,a);else if(f=this._getLastVisibleRowKeyAndRow(),null!=(b=f.rowKey))f=f.row,a=null!=a[b]&&null==a[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],this._selUnselectAll(),a?(this._selectionRequest=
AdfDhtmlTableBasePeer._SELECT_PAGE_DOWN,this._scrollerScrollToPos(null,this._currentScrollTop+(f.offsetTop+f.offsetHeight-(this._currentScrollTop-f.parentNode.parentNode.startPos)))):(this._selSelectRow(b,f),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,b,f),this._unclipRow(f))}};
AdfDhtmlTableBasePeer.prototype._getLastVisibleRowKeyAndRow=function(){for(var a=AdfAgent.AGENT,b=this.GetDataBody(),d=b.childNodes,e={},f=d.length-1;0<=f&&!e.rowKey;--f)for(var g=d[f].startPos,h=d[f].rows,k=h.length-1;0<=k;--k){var l=h[k];if(l.offsetTop-(this._currentScrollTop-g)+AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL<b.offsetHeight){g=a.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);e.rowKey=g;e.row=l;break}}return e};
AdfDhtmlTableBasePeer.prototype.GetFirstVisibleRowKeyAndRow=function(a){var b=this._cachedFirstVisibleRowKeyAndRow;if(b)return b;var d=AdfAgent.AGENT,e=this.GetDataBody().childNodes,f=e.length,b={};a=void 0==a?AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL:a;for(var g=0;g<f&&!b.rowKey;++g){var h=e[g],k=h.startPos,l=h.rows,m=0;null!=l&&(m=l.length);for(var n=0;n<m;++n)if(h=l[n],h.offsetTop+h.offsetHeight+k-a>this._currentScrollTop){k=d.getAttribute(h,AdfDhtmlTableBasePeer._ROW_KEY);b.rowKey=k;b.row=h;break}}return this._cachedFirstVisibleRowKeyAndRow=
b};
AdfDhtmlTableBasePeer.prototype.scrollToRowIndex=function(a,b){var d=a*this._averageRowHeight,e=this.getComponent(),f=this.GetFirstVisibleRowKeyAndRow(),e=f.rowKey?e.getRowIndex(f.rowKey):null,g;this._currentScrollTop!=d&&(g=this.scrollToPos(-1,d,!0,!1));e==a||g==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?this._callCallbackWithStatus(b,this.SCROLL_SUCCEEDED):(d=this._postEvalCallback,this._callCallbackWithStatus(d,this.SCROLL_CANCELLED),this._postEvalCallback=b,d||AdfPage.PAGE.addEventListener(AdfDomReplacedEvent.EVENT_TYPE,this._domReplacedListener,
this))};AdfDhtmlTableBasePeer.prototype._callCallbackWithStatus=function(a,b){if(a){AdfAssert.assertFunction(a);var d={};d.status=b;a(d)}};AdfDhtmlTableBasePeer.prototype._domReplacedListener=function(a){var b=this.getComponent();AdfAssert.assertPrototype(b,AdfUIComponent);b=b.getClientId();a.containsClientId(b)&&(AdfPage.PAGE.removeEventListener(AdfDomReplacedEvent.EVENT_TYPE,this._domReplacedListener,this),a=this._postEvalCallback,this._postEvalCallback=null,this._callCallbackWithStatus(a,this.SCROLL_SUCCEEDED))};
AdfDhtmlTableBasePeer.prototype._getNextRowKeyAndRow=function(a){for(var b=AdfAgent.AGENT,d=this.GetDataBody().childNodes,e=d.length,f={},g=0;g<e&&!f.rowKey;++g)for(var h=d[g].rows,k=h.length,l=0;l<k;++l){var m=h[l],n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY);if(null==a){f.rowKey=n;f.row=m;break}else if(n==a){f.lastRowKeyInView=n;if(l+1<k){m=h[l+1];if(this._hasDetailStamp&&AdfAgent.AGENT.getAttribute(m,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))if(l+2<k)m=h[l+2];else if(g+1<e&&0<d[g+1].rows.length)m=
d[g+1].rows[0];else return f;n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY);f.rowKey=n;f.row=m}else g+1<e&&(h=d[g+1].rows,0<h.length&&(m=h[0],n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY),f.rowKey=n,f.row=m));break}}return f};
AdfDhtmlTableBasePeer.prototype._getPreviousRowKeyAndRow=function(a){for(var b=AdfAgent.AGENT,d=this.GetDataBody().childNodes,e={},f=d.length-1;0<=f&&!e.rowKey;--f)for(var g=d[f],h=d[f].rows,k=h.length-1;0<=k;--k){var l=h[k],m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);if(null==a){e.rowKey=m;e.row=l;break}else if(m==a){e.lastRowKeyInView=m;if(0<=k-1){l=h[k-1];if(this._hasDetailStamp&&AdfAgent.AGENT.getAttribute(l,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))if(0<=k-2)l=h[k-2];else if(0<=f-1&&
0<d[f-1].rows.length)l=d[f-1].rows[d[f-1].rows.length-1];else return e;m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);e.rowKey=m;e.row=l}else 0<=f-1?(h=d[f-1].rows,0<h.length&&(l=h[h.length-1],m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY),e.rowKey=m,e.row=l)):0==b.getIntAttribute(g,"_startRow",-1)&&(e.isAtTop=!0);break}}return e};
AdfDhtmlTableBasePeer.prototype._handleSpaceKey=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager;switch(e.objectType){case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:this._grabFocus();this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]||this._selSelectAll();break;case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:e=this.GetRowKeyAndRow(e.domElement,this.getDomElement());null!=e&&(this._grabFocus(),this._doRowSelection(d.getEventTarget(b),d.isSelectionToggle(b),
b.shiftKey,e[0],e[1]));break;case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:if(this._isColumnSelectionEnabled()){var d=[],f=[];this._anchorColumnHeader=e=e.domElement;this._resolveColumns(d,f,e);this._doColumnSelections(b,d,f)}break;case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:this._supportsFocusRowNavigation&&(e=this._focusManager.currency,null!=e&&(this._selIsSelected(e)?b.ctrlKey&&this._selUnselectRow(e,this._focusManager.domElement):this._selSelectRow(e,this._focusManager.domElement)))}};
AdfDhtmlTableBasePeer.prototype._handleEnterKey=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager;if(this._isTargetCellFilter(a))this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,a,!0),d.getPlatform()==AdfAgent.GECKO_PLATFORM&&0<this._currentScrollLeft&&AdfFocusUtils.focusElement(this.getDomElement()),this._handleFilterCellAction();else if(this._isTargetCellEditable(a))d=this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&(e=d[0],null!=e&&(d=this._getCellAndIndexForNode(a,d[1]),d=
void 0!=this._ctePatternStart&&!b.shiftKey?this._ctePatternStart:d.cellIndex,-1<d&&(this._isClickToEdit()?this._clickToEditActivateRow(e,!b.shiftKey,d):this._setFocusOnEditableRowCell(e,!b.shiftKey,d))));else if(this._focusManager.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE){if((e=e.domElement)&&null!=d.getElementById(AdfRichUIPeer.CreateSubId(e.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR))){var d=AdfPage.PAGE.findComponent(e.id).getSortProperty(),f=AdfDhtmlTableBasePeer.__getSortOrderForColumn(e.id),
f=null==f?!0:!f;this.getComponent().setProperty("currentlySelectedHeaderId",e.id);AdfTableUtils.queueSortEvent(this.getComponent(),d,f)}}else if(this._isClickToEdit()&&null!=this.GetFocusedRowKey())this._editableTableReadOnlyMode?(this._setActiveRowKey(this.GetFocusedRowKey()),this._setReadOnlyMode(!1,a,!1),d=this._getActiveCellIndex(),-1==d&&(d=this._lastCTEIndex),void 0!=d&&(this._clickEditRequest={cellIndex:d})):this._clickToEditActivateRow(this.GetFocusedRowKey(),!b.shiftKey,this._lastCTEIndex);
else if(!this._isClickToEdit()&&this._editableTableReadOnlyMode)this._setReadOnlyMode(!1,a,!0);else return!0};
AdfDhtmlTableBasePeer.prototype._setFocusOnEditableRowCell=function(a,b,d){var e=b?this._getNextRowKeyAndRow(a):this._getPreviousRowKeyAndRow(a);a=e.rowKey;if(null!=a){b=AdfAgent.AGENT;e=e.row;d=this.FindCellByIndex(e,d);var f=!0;null==this._setFocusOnEditableElementInNode(b,d)&&null==this._setFocusOnEditableElementInNode(b,e)&&(f=!1);f&&(this._isRowSelectionEnabled()&&!this._selIsSelected(a))&&(this._selUnselectAll(),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,e),this._selSelectRow(a,
e))}};AdfDhtmlTableBasePeer.prototype._indexOfDomElement=function(a,b){for(var d=a.length,e=0;e<d;e++)if(a[e]==b)return e;return-1};
AdfDhtmlTableBasePeer.prototype._getFirstInputElementInNode=function(a,b,d){var e=a.getDomDocument();a=null;if(e.evaluate){b=e.evaluate('.//input[not(@type\x3d"hidden")]|.//select|.//textarea|.//button|.//a|.//*[@tabindex\x3e\x3d0]',b,null,XPathResult.ANY_TYPE,null);for(e=b.iterateNext();e;){if((d||!e.disabled&&-1!=e.tabIndex)&&("A"!=e.nodeName||e.href)){a=e;break}e=b.iterateNext()}}else{b=b.getElementsByTagName("*");for(var f=b.length,g=AdfDhtmlTableBasePeer._INPUT_REGEXP,h=0;h<f;h++){var e=b[h],
k=e.getAttribute("tabIndex",2);if(null!=k&&0<=k&&32768!=k&&65535!=k||e.tagName.match(g))if((d||!e.disabled&&-1!=k)&&("A"!=e.nodeName||e.href)){a=e;break}}}return a};
AdfDhtmlTableBasePeer.prototype._setFocusOnEditableElementInNode=function(a,b){var d=this._getFirstInputElementInNode(a,b);if(d){var e="INPUT"==d.nodeName;if(a.getPlatform()!=AdfAgent.GECKO_PLATFORM||!(e&&"file"==d.type)){var f=AdfPage.PAGE.getActiveDomElement();f&&f.blur&&f.blur();var f=!1,g=AdfPage.PAGE.getZOrderManager();g&&g.containsElement(this.getDomElement())&&(f=!0);a.getPlatform()==AdfAgent.IE_PLATFORM&&f&&!this._isClickToEdit()?AdfFocusUtils.focusElementDelayed(d,1):AdfFocusUtils.focusElement(d);
e&&void 0!=typeof d.select&&d.select();return d}}return null};
AdfDhtmlTableBasePeer.prototype._setInputElementCursorAtEndInNode=function(a,b){var d=this._getFirstInputElementInNode(a,b);if(d&&("INPUT"==d.nodeName&&"text"==d.type||"TEXTAREA"==d.nodeName)){var e=d.value.length;null!=d.selectionStart?(d.setSelectionRange(e,e),d.blur(),d.focus(),e=d.ownerDocument.createEvent("KeyboardEvent"),void 0!=e.initKeyEvent?e.initKeyEvent("keypress",!0,!0,null,!1,!1,!1,!1,27,0):e.initUIEvent("keypress",!0,!0,window,1),d.dispatchEvent(e)):(e=d.createTextRange(),e.collapse(!1),
e.select());return d}return null};AdfDhtmlTableBasePeer.prototype._unclipRow=function(a){AdfAssert.assert(null!=a,"Unable to unclipRow without a valid row being passed in!");var b=this.GetDataBody(),d=a.offsetTop+a.parentNode.parentNode.startPos;d<this._currentScrollTop?this._scrollerScrollToPos(null,d):(a=a.offsetTop+a.offsetHeight-(this._currentScrollTop-a.parentNode.parentNode.startPos),a>b.offsetHeight&&this._scrollerScrollToPos(null,this._currentScrollTop+(a-b.offsetHeight)))};
AdfDhtmlTableBasePeer.prototype.UpdateFocusManager=function(a,b,d,e){var f=this._focusManager;null!=f.domElement&&this._updateFocusCellStyle(!1);f.objectType=a;f.currency=b;f.domElement=d;this._updateFocusCellStyle(!0);this._disableRowMouseDownCellFocus||(e?this._setActiveDescendant(e,!0):f.domElement&&("TR"==f.domElement.nodeName?this._moveActiveCellToRow(f.domElement):this._setActiveDescendant(f.domElement,!0)))};
AdfDhtmlTableBasePeer.prototype._getLabelText=function(a){for(var b="",d=(a=a.childNodes)?a.length:0,e=0;e<d;e++){var f=a[e];1==f.nodeType&&(f="LABEL"==f.nodeName?f.textContent:this._getLabelText(f))&&(b+=(b?" ":"")+f)}return b};
AdfDhtmlTableBasePeer.prototype._getSortColumnHeaderLabel=function(a){var b=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR));if(b&&b.rows[0]){var d=b.rows[0].cells;if(d&&0<d.length){var e;b.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE)==AdfDhtmlTableBasePeer._SORTED_ASCENDING&&(e=AdfDomUtils.getFirstDescendentElement(d[1],"A"));e||(e=AdfDomUtils.getFirstDescendentElement(d[0],"A"));if(e)return a.textContent+" "+e.title}}return null};
AdfDhtmlTableBasePeer.prototype._setActiveDescendant=function(a,b){var d=this.getDomElement();if(d){var e=this._getActiveCellNode();if(e){if("columnheader"==e.getAttribute("role")&&null==e.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL))e.removeAttribute("aria-label");else{var f=e.getAttribute("aria-labelledby");if(f)for(var f=f.split(" "),g,h=0;h<f.length;h++)0<f[h].indexOf(":_ariaRHId")&&(g=this.getDomDocument().getElementById(f[h]))&&g.removeAttribute("id");e.removeAttribute("aria-labelledby")}e.id&&
0<e.id.indexOf(":_ariaActiveId")&&e.removeAttribute("id")}a.id||(this._ariaIdSuffix=1==this._ariaIdSuffix?0:1,a.id=this.getDomElement().id+":_ariaActiveId"+this._ariaIdSuffix);g=a.getAttribute("role");if(this._isFilterCell(a))a.getAttribute("aria-label")||a.setAttribute("aria-label",this._getLabelText(a));else if("columnheader"==g)(e=this._getSortColumnHeaderLabel(a))&&a.setAttribute("aria-label",e);else if("presentation"!=g){e="";"rowheader"!=g&&(g=this.GetRowKeyAndRow(a,this.getDomElement()),null!=
g&&(e=this._getRowHeaderIds(g[1])));g=this._getCellIndex(a);if(g=this._getLayeredColumnHeaderIds(g))e&&(e+=" "),e+=g;e&&(e=e+" "+a.id,a.setAttribute("aria-labelledby",e))}d.setAttribute("aria-activedescendant",a.id);if(this._editableTableReadOnlyMode||null==this._getFirstInputElementInNode(AdfAgent.AGENT,a))d=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM,e=!1,(g=AdfPage.PAGE.getZOrderManager())&&g.containsElement(this.getDomElement())&&(e=!0),!this.AllowCellNavigation()||d&&!this._isClickToEdit()&&
e?(g=this.GetRowKeyAndRow(a,this.getDomElement()))&&this._setFocusOnNode(g[1],!0):this._setFocusOnNode(a,!0)}};
AdfDhtmlTableBasePeer.prototype._restoreActiveCellFromDom=function(){var a=this.getDomElement(),b=document.activeElement;b&&AdfDomUtils.isAncestor(a,b)&&("TH"==b.nodeName?b.getAttribute(AdfDhtmlTableBasePeer._FILTER_COLUMN)?this.UpdateFocusManager(AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE,null,b):"columnheader"==b.getAttribute("role")&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE,null,b):"TD"==b.nodeName&&(a=this.GetRowKeyAndRow(b,a))&&(b.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?
this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,a[0],b):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a[0],a[1],b)))};AdfDhtmlTableBasePeer.prototype._findNextCell=function(a,b){var d=null;if(a){var e=this.GetRowKeyAndRow(a,this.getDomElement());if(null!=e&&(e=e[1],null!=e)){var f=this._getCellAndIndexForNode(a,e);f&&-1!=f.cellIndex&&(b?0<f.cellIndex&&(d=this.FindCellByIndex(e,f.cellIndex-1)):d=this.FindCellByIndex(e,f.cellIndex+1))}}return d};
AdfDhtmlTableBasePeer.prototype._findLastCell=function(a){var b=null;if(null!=a)for(var d=0,e;e=this.FindCellByIndex(a,d);)b=e,++d;return b};
AdfDhtmlTableBasePeer.prototype._getCellIndex=function(a){var b=-1,d=this.getDomElement();if(d&&a){var e=a.getAttribute("role");if(this._isFilterCell(a))b=AdfAgent.AGENT.getIntAttribute(a,"_d_index",-1);else if("columnheader"==e){if(d=AdfAgent.AGENT.getAttribute(d,"_leafColClientIds"),d=eval(d),null!=d)for(var e=d.length,f=0;f<e;f++)if(d[f]==a.id){b=f;break}}else if(d=this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&null!=d[0]&&(a=this._getCellAndIndexForNode(a,d[1])))b=a.cellIndex}return b};
AdfDhtmlTableBasePeer.prototype._getActiveCellNode=function(){var a,b=this.getDomElement();if(b)for((b=b.getAttribute("aria-activedescendant"))&&0<b.length&&(a=this.getDomDocument().getElementById(b));a&&"TD"!=a.nodeName&&"TH"!=a.nodeName;)a=a.parentNode;return a};AdfDhtmlTableBasePeer.prototype._getActiveCellIndex=function(){return this._getCellIndex(this._getActiveCellNode())};
AdfDhtmlTableBasePeer.prototype._changeActiveCell=function(a){var b;(b=this._findNextCell(this._getActiveCellNode(),a))?this._setActiveDescendant(b,!1):null!=this._associatedPeer&&(a?null!=this.getComponent().getProperty("_afrMasterId")&&(a=this._getActiveCellNode(),a=a.parentNode.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),this._associatedPeer.handleNavFromAssociatedPeer(a)):null!=this.getComponent().getProperty("_afrSlaveId")&&(a=this._getActiveCellNode(),a=a.parentNode.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),
this._associatedPeer.handleNavToAssociatedPeer(a)));return b};AdfDhtmlTableBasePeer.prototype._setHeaderCellFocus=function(a){var b;a.getAttribute(AdfDhtmlTableBasePeer._FILTER_COLUMN)?b=AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:a.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL)?b=AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:"columnheader"==a.getAttribute("role")&&(b=AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE);b&&this.UpdateFocusManager(b,null,a);return b};
AdfDhtmlTableBasePeer.prototype._restoreActiveCellFromDom=function(){var a=this.getDomElement(),b=document.activeElement;b&&AdfDomUtils.isAncestor(a,b)&&("TH"==b.nodeName?this._setHeaderCellFocus(b):"TD"==b.nodeName?(a=this.GetRowKeyAndRow(b,a))&&(b.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,a[0],b):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a[0],a[1],b)):(a=this._getTargetCell(b))&&this._isFilterCell(a)&&
this._setReadOnlyMode(!1,b,!1))};AdfDhtmlTableBasePeer.prototype.handleNavFromAssociatedPeer=function(a){var b=this.FindRowByKey(a);if(b&&b.tr){var d=this._findLastCell(b.tr);this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b.tr,d)}};AdfDhtmlTableBasePeer.prototype.handleNavToAssociatedPeer=function(a){var b=this.FindRowByKey(a);if(b&&b.tr){var d=this.FindCellByIndex(b.tr,0);this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b.tr,d)}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderId=function(a){var b;if(!this._headerless){var d=this.getDomElement();d&&(d=AdfAgent.AGENT.getAttribute(d,"_leafColClientIds"),d=eval(d),null!=d&&d.length>a&&(b=d[a]))}return b};AdfDhtmlTableBasePeer.prototype._getLayeredColumnHeaderIds=function(a){var b=this._getColumnHeaderId(a);a=b;if(null!=b)for(b=AdfAgent.AGENT.getElementById(b);b;)if((b=this._resolveImmediateParentColumn(b))&&b.id)a=b.id+" "+a;return a};
AdfDhtmlTableBasePeer.prototype._getRowHeaderIds=function(a){var b="",d=this.getDomElement().id;if(a)for(var e,f=0;e=this.FindCellByIndex(a,f++);)if("rowheader"==e.getAttribute("role")){var g;(g=this._getFirstInputElementInNode(AdfAgent.AGENT,e,!0))&&g.id?e=g.id:(e.id||(e.id=d+":_ariaRHId"+f),e=e.id);b=b+" "+e}return b};AdfDhtmlTableBasePeer.prototype._moveActiveCellToRow=function(a){var b=this._getActiveCellIndex();-1==b&&(b=0);(a=this.FindCellByIndex(a,b))&&this._setActiveDescendant(a,!0)};
AdfDhtmlTableBasePeer.prototype._getTargetCell=function(a){for(var b=this.getDomElement();a&&"TD"!=a.nodeName&&"TH"!=a.nodeName;){if(a==b)return null;a=a.parentNode}return a};
AdfDhtmlTableBasePeer.prototype._setReadOnlyMode=function(a,b,d){this._disableTabStop(a);this._editableTableReadOnlyMode=a;if(d)if(a){var e;a=this.GetRowKeyAndRow(b,this.getDomElement());null!=a&&null!=a[0]&&(e=this._getCellAndIndexForNode(b,a[1]),this._isClickToEdit()&&(this._lastCTEIndex=e.cellIndex),e.cell&&this._setActiveDescendant(e.cell,!1));b=this._getTargetCell(b);this._isFilterCell(b)?this._setHeaderCellFocus(b):this._isClickToEdit()?(this._setActiveRowKey(null),this._grabFocus()):(!e||!e.cell)&&
this._grabFocus()}else(e=this._getActiveCellNode())&&this._setFocusOnEditableElementInNode(AdfAgent.AGENT,e)};AdfDhtmlTableBasePeer.prototype._updateFocusCellStyle=function(a){var b=this._focusManager;a&&b.domElement?AdfDomUtils.addCSSClassName(b.domElement,AdfDhtmlTableBasePeer._FOCUSED_CLASS):!a&&b.domElement&&AdfDomUtils.removeCSSClassName(b.domElement,AdfDhtmlTableBasePeer._FOCUSED_CLASS)};AdfDhtmlTableBasePeer.prototype._isFilterable=function(){return null!=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._FILTERABLE)};
AdfDhtmlTableBasePeer.prototype._isTargetCellFilter=function(a){for(var b=this.getDomElement(),d=AdfAgent.AGENT,e=d.getAttribute(a,AdfDhtmlTableBasePeer._FILTER_COLUMN);null==e;){if(null==a||a==b)return!1;a=a.parentNode;if(null==a||1!=a.nodeType)break;e=d.getAttribute(a,AdfDhtmlTableBasePeer._FILTER_COLUMN)}return null!=e};AdfDhtmlTableBasePeer.prototype._handleFilterCellAction=function(){var a=this.getComponent();a.queueEvent(new AdfQueryEvent(a));a.setSelectedRowKeys(null)};
AdfDhtmlTableBasePeer.prototype.getRowKeyForEvent=function(a){a=a.getNativeEventTarget();if(null==this._getTargetRowHeader(a)){var b=this.getDomElement();a=this.GetRowKeyAndRow(a,b);if(null!=a)return a[0]}return null};AdfDhtmlTableBasePeer.prototype.applyDragReadyStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS);return a};
AdfDhtmlTableBasePeer.prototype.ClearDragReadyState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS)};AdfDhtmlTableBasePeer.prototype.applyDragSourceStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS);return a};
AdfDhtmlTableBasePeer.prototype.ClearDragSourceState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS)};
AdfDhtmlTableBasePeer.prototype.getDragOffsetForRowKeys=function(a,b){var d=a.getNativeEventTarget(),e=this.getDomElement(),f=this.GetRowKeyAndRow(d,e),e=d=0,g=AdfAgent.AGENT;if(null!=f)for(var h=f[0],f=f[1],k=0;k<b.length;k++)if(b[k]==h){h=g.getElementPosition(f);g=g.getMousePosition(a.getNativeEvent());d=g.x-h.x;e+=g.y-h.y;this._hasFrozenColumn()&&(d-=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t").offsetWidth);break}else{var l=this.FindRowByKey(b[k]);AdfAssert.assert(null!=
l);e+=l.tr.offsetHeight}return{x:d,y:e}};AdfDhtmlTableBasePeer.prototype.getDragNodeForRowKeys=function(a){AdfAssert.assertArray(a);var b=this.getDomDocument().createElement("table");a=this._getDomNodesForDrag(a);for(var d=0,e=a.length;d<e;++d){var f=this._cloneCellForDrag(a[d]);b.insertRow(-1).appendChild(f)}return b};
AdfDhtmlTableBasePeer.prototype._getDomNodesForDrag=function(a){for(var b=[],d=this._lastFrozen,e=this.GetDataBody(),f=0;f<a.length;++f){var g=this.FindRowByKey(a[f]);if(g){var g=g.tr,h=g.parentNode.parentNode.startPos;g.offsetTop+g.offsetHeight+h-AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL>this._currentScrollTop&&g.offsetTop-(this._currentScrollTop-h)+AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL<e.offsetHeight&&(h=g.cells[0],this._freezeColumnsToStart()?h=this._getInnerTableCell(g,d+1):this._freezeColumnsToEnd()&&
(h=this._getInnerTableCell(g,0)),null==h&&(h=g.cells[0]),b.push(h))}}return b};AdfDhtmlTableBasePeer.prototype._cloneCellForDrag=function(a){var b=a.cloneNode(!0),d=AdfAgent.AGENT;d.copyStyle(a,b);a=b.style;a.width="";a.borderRight=a.borderBottom="0px";d.setOpacity(b,50);return b};
AdfDhtmlTableBasePeer.prototype.getRowKeyAndOrientationFromHints=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);AdfAssert.assert(null!=d);var e=d[AdfStampedDropTarget.HINT_LAST_ROWKEY],f=d[AdfStampedDropTarget.HINT_LAST_ROWKEY_BOUNDS],g=d[AdfStampedDropTarget.HINT_LAST_DROP_ORIENTATION];if(e&&f&&(AdfAssert.assertString(e),AdfAssert.assertObject(f),a>=f.left&&b>=f.top&&a<=f.right&&b<=f.bottom)){d[AdfStampedDropTarget.ROW_KEY]=e;d[AdfStampedDropTarget.DROP_ORIENTATION]=g;return}this._getRowKeyAndOrientationForPosition(a,
b,d)};
AdfDhtmlTableBasePeer.prototype._getRowKeyAndOrientationForPosition=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);var e=this.GetDataBody(),f=AdfDomUtils.getElementAtPoint(e,a,b,null,{colgroup:!0});if(f&&(f=this.GetRowKeyAndRow(f,this.getDomElement()),null!=f)){d[AdfStampedDropTarget.ROW_KEY]=f[0];d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON;return}this.IsEmpty?(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):AdfAgent.AGENT.pointInElementBounds(e,
a,b)?(d[AdfStampedDropTarget.ROW_KEY]=this._getLastRowKey(),d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON)};
AdfDhtmlTableBasePeer.prototype.showDragFeedback=function(a,b,d,e,f,g,h){AdfAssert.assertPrototype(a,AdfDnDContext);AdfAssert.assertStringOrNull(b);AdfAssert.assertNumber(d);AdfAssert.assertStringOrNull(e);d==AdfDnDContext.ACTION_NONE&&(AdfDomUtils.removeCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),b=null);if(e!=b&&(e&&(a=this.FindRowByKey(e))&&AdfDomUtils.removeCSSClassName(a.tr,AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),b&&(a=this.FindRowByKey(b))))AdfDomUtils.addCSSClassName(a.tr,
AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),AdfDomUtils.removeCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS);null==b&&d!=AdfDnDContext.ACTION_NONE&&AdfDomUtils.addCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS)};AdfDhtmlTableBasePeer.prototype.getRowKeyBounds=function(a){return!a?null:(a=this.FindRowByKey(a))?AdfAgent.AGENT.getElementPageBounds(a.tr):null};
AdfDhtmlTableBasePeer.prototype.ShiftIndex=function(a,b,d){for(;a;)a.startRow+=b,a=d?a.nextSibling:a.previousSibling};AdfDhtmlTableBasePeer.prototype.IsReceivingActiveEvents=function(){return-1!=this._activeDataCount};AdfDhtmlTableBasePeer.prototype.RemoveAllBlocks=function(a){for(var b=a.childNodes,d=b.length-1;0<=d;d--)this._unregisterNode(b[d]),a.removeChild(b[d])};
AdfDhtmlTableBasePeer.prototype._getFirstRowKey=function(){var a=this.GetDataBody().childNodes;return 0<a.length?this._getBlockFirstRowKey(a[0]):null};AdfDhtmlTableBasePeer.prototype._getLastRowKey=function(){var a=this.GetDataBody().childNodes,b=a.length;return 0<b?this._getBlockLastRowKey(a[b-1]):null};
AdfDhtmlTableBasePeer.prototype._getBlockFirstRowKey=function(a){AdfAssert.assert(null!=a.rows&&0<a.rows.length,"Unable to get row key by index when the block contains no rows!");return AdfAgent.AGENT.getAttribute(a.rows[0],AdfDhtmlTableBasePeer._ROW_KEY)};
AdfDhtmlTableBasePeer.prototype._getBlockLastRowKey=function(a){AdfAssert.assert(null!=a.rows&&0<a.rows.length,"Unable to get row key by index when the block contains no rows!");var b=AdfAgent.AGENT;a=a.rows[a.rows.length-1];var d=b.getAttribute(a,AdfDhtmlTableBasePeer._ROW_KEY);null==d&&a.previousSibling&&(d=b.getAttribute(a.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY));return d};AdfDhtmlTableBasePeer.prototype._isImmediateContentDelivery=function(a){return"immediate"==a.getContentDelivery()};
AdfDhtmlTableBasePeer.prototype._isInlineDataAvailable=function(a){return a.getProperty("_afrDataInline")};
AdfDhtmlTableBasePeer.prototype._sizeRegionsForFrozenColumns=function(a,b){if(this._hasFrozenColumn()&&!this._areAllColumnsFrozen(this._colCount)){for(var d=a.firstChild;d;)this._sizeBlockForFrozenColumns(d,b),d=d.nextSibling;var e=this.__getColumnHeader(),f=this._unfrozenWidth;if(null!=e)if(d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"d2"),this._freezeColumnsToEnd()){if(e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t"))f=this._unfrozenWidth,b<this._totalWidth&&(f=Math.max(b-this._frozenWidth,0)),
d.style.width=f+"px",AdfDhtmlTableBasePeer.__getChildBySubId(d,"t2").style.width=f+"px",AdfDhtmlTableBasePeer._isRTL()?e.style.right=d.style.width:e.style.left=d.style.width}else d.style.width=Math.max(b-this._frozenWidth,0)+"px";f=this._getColumnFooter();if(null!=f)if(d=AdfDhtmlTableBasePeer.__getChildBySubId(f,"fd2"),this._freezeColumnsToEnd()){if(e=AdfDhtmlTableBasePeer.__getChildBySubId(f,"ft"))f=this._unfrozenWidth,b<this._totalWidth&&(f=b-this._frozenWidth),d.style.width=f+"px",AdfDhtmlTableBasePeer._isRTL()?
e.style.right=d.style.width:e.style.left=d.style.width}else d.style.width=Math.max(b-this._frozenWidth,0)+"px"}};AdfDhtmlTableBasePeer.prototype._getUnfrozenColumnsWidth=function(){var a=0,b=this.__getColumnHeader();if(b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"))a=b.offsetWidth;return a};
AdfDhtmlTableBasePeer.prototype._sizeBlockForFrozenColumns=function(a,b){if(this._hasFrozenColumn()){AdfAssert.assert(null!=a.rows&&null!=a.rows[0],"Unable to _sizeBlockForFrozenColumns when block contains no rows!");var d=a.rows[0].cells;if(!this._areAllColumnsFrozen(d.length)){var e;if(this._freezeColumnsToEnd()){e=Math.max(b-this._frozenWidth,0);var f=this._frozenWidth;0<this._totalWidth&&b>=this._totalWidth&&(e=this._unfrozenWidth);0<this._frozenWidth&&b<this._frozenWidth&&(f=b);d=d[0];d.style.width=
e+"px";a.style.width=e+f+"px";if(this._processColGroup()&&(e=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"))){for(e=e.childNodes[0];e&&"COL"!=e.tagName;)e=e.nextSibling;e&&(e.style.width=d.style.width,d.firstChild.style.width=d.style.width)}}else if(d=d[d.length-1],d.style.width=Math.max(b-this._frozenWidth,0)+"px",a.style.width=b+"px",this._processColGroup()&&(e=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"))){for(e=e.childNodes[e.childNodes.length-1];e&&"COL"!=e.tagName;)e=
e.previousSibling;e&&(e.style.width=d.style.width,d.firstChild.style.width=d.style.width)}}}};
AdfDhtmlTableBasePeer.prototype._registerInnerScrollCallback=function(a){if(this._hasFrozenColumn()){AdfAssert.assert(null!=a.rows&&null!=a.rows[0],"Unable to register inner scroll callback when the block contains no rows!");var b=a.rows[0].cells,d=b.length;if(!this._areAllColumnsFrozen(d))for(var e=0;e<a.rows.length;e++)b=a.rows[e].cells,b=this._freezeColumnsToEnd()?b[0]:b[d-1],AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").onscroll=this._innerTableScrollCallback}};
AdfDhtmlTableBasePeer.prototype._getNestedScrolledTable=function(a){AdfAssert.assert(null!=a,"Unable to get the nested scrolled table without a valid row passed in!");a=a.cells;a=this._freezeColumnsToEnd()?a[0]:a[a.length-1];a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"DIV");return AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"TABLE")};AdfDhtmlTableBasePeer._isRTL=function(){return AdfPage.PAGE.getLocaleContext().isRightToLeft()};
AdfDhtmlTableBasePeer.prototype._getExpandAction=function(a){var b=AdfPage.PAGE.getLookAndFeel(),d=b.getStyleClass(AdfDhtmlTableBasePeer._ICON_STYLE_EXPANDED),e=a.parentNode.className;if(d==a.className||d==e)return"collapse";b=b.getStyleClass(AdfDhtmlTableBasePeer._ICON_STYLE_COLLAPSED);return b==a.className||b==e?"expand":null};AdfDhtmlTableBasePeer.prototype.ComponentScrollTopChanged=function(a,b,d,e){this.scrollToPos(-1,d,!0);return!1};
AdfDhtmlTableBasePeer.prototype.ComponentScrollLeftChanged=function(a,b,d,e){this.scrollToPos(d,-1,!0);return!1};AdfDhtmlTableBasePeer.prototype.ComponentDisclosedRowKeysChanged=function(a,b,d,e){this._savedDisclosedState=e;a=AdfCollections.removeAll(e,d);d=AdfCollections.removeAll(d,e);b=e=!1;null!=a&&!AdfCollections.isEmpty(a)&&(this.HandleComponentCollapseEvent(a),e=!0);null!=d&&!AdfCollections.isEmpty(d)&&(this.HandleComponentExpandEvent(a),b=!0);AdfAssert.assert(!(e&&b))};
AdfDhtmlTableBasePeer.prototype.HandleComponentCollapseEvent=function(a){this._queueCollapseFetchEvent()};AdfDhtmlTableBasePeer.prototype.HandleComponentExpandEvent=function(a){this._queueExpandFetchEvent()};
AdfDhtmlTableBasePeer.prototype._changeDetailIcon=function(a,b){for(var d=AdfAgent.AGENT,e=null,f=a.cells,g=0;g<f.length;g++)if(d.getAttribute(f[g],AdfDhtmlTableBasePeer._DETAIL_COLUMN_MARKER,!1)){e=f[g];break}if(e){if(d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e,"A"))f=b?AdfDhtmlTableBasePeer._ICON_STYLE_EXPANDED:AdfDhtmlTableBasePeer._ICON_STYLE_COLLAPSED,e=AdfPage.PAGE.getLookAndFeel(),f=e.getStyleClass(f),d.className=f,e=b?e.getTranslatedString(AdfDhtmlTableBasePeer._EXPANDED_NODE_KEY):e.getTranslatedString(AdfDhtmlTableBasePeer._COLLAPSED_NODE_KEY),
d.title=e;(d=this._getDisclosureIcon(d))&&AdfDomUtils.swapIcon(d,b?AdfDhtmlTableBasePeer._ICON_EXPANDED:AdfDhtmlTableBasePeer._ICON_COLLAPSED)}};AdfDhtmlTableBasePeer.prototype._getDisclosureIcon=function(a){var b=AdfAgent.getAgent();return null!=a.firstChild&&(a=a.firstChild,b=b.getNodeName(a).toLowerCase(),"img"==b||"span"==b||"#text"==b)?a:null};AdfDhtmlTableBasePeer.prototype._getEstimatedRowCount=function(a){return AdfAgent.getAgent().getIntAttribute(a,"_estRowCount",-1)};
AdfDhtmlTableBasePeer._getBlockRowCount=function(a){var b=0,d=AdfAgent.getAgent();if(d.getAttribute(a,AdfDhtmlTableBasePeer._HAS_DETAIL_MARKER,!1)){a=a.rows;for(var e=0;e<a.length;e++)d.getAttribute(a[e],AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)||b++}else return a.rows.length;return b};
AdfDhtmlTableBasePeer.prototype.__isOwnComponentEvent=function(a){a=a.getSource();for(var b=this.getComponent(),d=!1,e=null!=AdfPage.PAGE.getDomWindow().AdfUITree;!d&&a;)if(a==b)d=!0;else{if(a instanceof AdfUITable||e&&a instanceof AdfUITree||a instanceof AdfUIPopup)break;a=a.getParent()}return d};AdfDhtmlTableBasePeer.prototype._isClickToEdit=function(){return this.getComponent().getEditingMode()==AdfDhtmlTableBasePeer._EDIT_MODE_CLICKTOEDIT};AdfDhtmlTableBasePeer.prototype._getActiveRowKey=function(){return this.getComponent().getProperty("_afrActiveRowKey")};
AdfDhtmlTableBasePeer.prototype.ComponentActiveRowKeyChanged=function(a,b,d,e){this._setActiveRowKey(d);return!1};
AdfDhtmlTableBasePeer.prototype._setActiveRowKey=function(a){if(AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW!=this._pendingFetch&&!this._ignoreActiveRowKeyChange){var b=null;this._ignoreActiveRowKeyChange=!0;try{var d=this.getComponent(),e=d.getProperty("_afrActiveRowKey");d.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_ALWAYS);d.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_ALWAYS);d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,null,!1,AdfUIComponent.PROPAGATE_ALWAYS);
this._remainReadOnly?d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!0,!1,AdfUIComponent.PROPAGATE_ALWAYS):d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!1,!1,AdfUIComponent.PROPAGATE_ALWAYS);delete this._remainReadOnly;b=this._queueFetchEvent(!1,AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW,-1,a);e&&b?(b.setOldClientKey(e),this._oldActiveRowKey=e):b||(d.setProperty("_afrActiveRowKey",e,!1,AdfUIComponent.PROPAGATE_ALWAYS),d.setProperty("activeRowKey",e,!1,AdfUIComponent.PROPAGATE_ALWAYS))}finally{this._ignoreActiveRowKeyChange=
!1}return b}};AdfDhtmlTableBasePeer.prototype._restoreActiveRowKey=function(){this._ignoreActiveRowKeyChange=!0;try{var a=this.getComponent();a.setProperty("_afrActiveRowKey",this._oldActiveRowKey,!1,AdfUIComponent.PROPAGATE_NEVER);a.setProperty("activeRowKey",this._oldActiveRowKey,!1,AdfUIComponent.PROPAGATE_NEVER);delete this._oldActiveRowKey}finally{this._ignoreActiveRowKeyChange=!1}};
AdfDhtmlTableBasePeer.prototype._getCellAndIndexForNode=function(a,b){for(var d=AdfAgent.AGENT,e=this.getDomElement(),f=null,g=-1,h=null;null!=a&&a!=e&&-1==g;)if("TD"==d.getNodeName(a)){var k=a.parentNode;if(k==b){g=this._freezeColumnsToEnd()?this._firstFrozen+this._indexOfDomElement(b.cells,a)-1:this._indexOfDomElement(b.cells,a);h=a;break}else if(this._hasFrozenColumn()&&(null==f&&(f=this._getNestedScrolledTable(b).rows[0]),k==f)){this._freezeColumnsToStart()?g=this._lastFrozen+this._indexOfDomElement(f.cells,
a)+1:this._freezeColumnsToEnd()&&(g=this._indexOfDomElement(f.cells,a));h=a;break}a=k}else a=a.parentNode;return{cellIndex:g,cell:h}};AdfDhtmlTableBasePeer.prototype._saveClickToEditRequest=function(a,b){var d=this._getCellAndIndexForNode(a,b),e={};e.cellIndex=d.cellIndex;this._clickEditRequest=e};
AdfDhtmlTableBasePeer.prototype._processClickToEditRequest=function(a){var b=AdfAgent.AGENT,d=this._clickEditRequest;if(d&&-1!==d.cellIndex){var e=this._getActiveRowKey();this._lastCTEIndex=d?d.cellIndex:void 0;if(e){var f=this.FindRowByKey(e);if(f){f=f.tr;AdfAssert.assertDomElement(f);if(!d||d.activateCellType)if(this._grabFocus(),d&&"last"==d.activateCellType)for(b=this.__getVisibleLeafColumns().length-1;0<=b;){d=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(f,b));if(0<d.length){AdfFocusUtils.focusElement(d[d.length-
1]);break}b--}else this._setFocusOnEditableElementInNode(b,f);else{d=this.FindCellByIndex(f,d.cellIndex);AdfAssert.assertDomElement(d);b=AdfAgent.AGENT;if(b.getPlatform()==AdfAgent.IE_PLATFORM){var g=this._getFirstInputElementInNode(b,d);g||(g=this._getFirstInputElementInNode(b,f));g&&this._grabFocus()}else this._grabFocus();null==this._setFocusOnEditableElementInNode(b,d)&&null==this._setFocusOnEditableElementInNode(b,f)&&this._setFocusOnNode(d)}a&&(this._isRowSelectionEnabled()&&!this._selIsSelected(e))&&
(this._selUnselectAll(),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,e,f),this._selSelectRow(e,f));this._clickEditRequest&&delete this._clickEditRequest;this._processClickToEditRequestTimerId&&delete this._processClickToEditRequestTimerId}}}};
AdfDhtmlTableBasePeer.prototype._handleTabKey=function(a,b){var d=this.GetRowKeyAndRow(a,this.getDomElement()),e=b.shiftKey,f=!0;if(null!=d){var g=d[1];if(null!=g){var h=this._getCellAndIndexForNode(a,g),k=h.cell;if(k){var l=h.cellIndex;!this._ctePatternStart&&0!=this._ctePatternStart&&(this._ctePatternStart=l);if(this._isClickToEdit()&&null!=this._getActiveRowKey()){var k=AdfDomUtils.getInputElementsInNode(k),m=k.length;if(0<m)if(!e&&AdfDomUtils.isAncestorOrSelf(k[m-1],a)){if(this._hasDetailStamp&&
(h=g.nextSibling)&&AdfAgent.AGENT.getAttribute(h,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))if(k=AdfDomUtils.getInputElementsInNode(h),0<k.length)return!0;h=this.__getVisibleLeafColumns().length;e=l>=h-1;if(!e){for(l++;l<h;){k=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(g,l));if(0<k.length)break;l++}e=l==h}if(e){if(f=AdfRichUIPeer.getFirstAncestorComponent(a))g=f.getPeer(),g.RunValidation&&g.RunValidation(f,a);this._clickToEditActivateRow(d[0],!0);f=!this._clickEditRequest}}else if(e&&
AdfDomUtils.isAncestorOrSelf(k[0],a)){l=0==h.cellIndex;if(!l){for(l=h.cellIndex-1;0<=l;){k=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(g,l));if(0<k.length)break;l--}l=-1==l}l&&(this._clickToEditActivateRow(d[0],!1),f=!this._clickEditRequest)}}}}}else if(!e&&this._hasDetailStamp&&this._isClickToEdit())return this._handleTabKeyInCTEDetailRegion(a);return f};
AdfDhtmlTableBasePeer.prototype._handleTabKeyInCTEDetailRegion=function(a){for(var b=this.getDomElement(),d=a.parentNode,e=AdfAgent.AGENT,f=!0;d&&d!=b;){if("TR"==e.getNodeName(d)&&e.getAttribute(d,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){elems=AdfDomUtils.getInputElementsInNode(d);0<elems.length&&elems[elems.length-1]==a&&(a=e.getAttribute(d.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY),this._clickToEditActivateRow(a,!0),f=!1);break}d=d.parentNode}return f};
AdfDhtmlTableBasePeer.prototype._clickToEditActivateRow=function(a,b,d){delete this._lastRowKeyInView;var e=b?this._getNextRowKeyAndRow(a):this._getPreviousRowKeyAndRow(a);if(!e.isAtTop){var f=e.rowKey,g=e.lastRowKeyInView;if(null!=f)this._setActiveRowKey(f),this._unclipRow(e.row),this._clickEditRequest=void 0!=d?{cellIndex:d}:{activateCellType:!b?"last":"first"},b=AdfPage.PAGE.getActiveDomElement(),g=this.getComponent().getProperty("activeRowKey"),a!=g&&(b&&b.blur)&&b.blur();else if(null!=g){a=this.GetScroller();
if(!this._hasSingleScroller()||this._isPaged)a=a[AdfDhtmlTableBasePeer._VSCROLLER];d=this._currentScrollTop+(b?this._averageRowHeight:-this._averageRowHeight);0<d&&d<this._getScrollHeight()&&(this._lastRowKeyInView=g,this._getScrollerClientHeight()+d<this._getScrollHeight()&&(AdfAgent.AGENT.scrollToPos(a,null,d),this._clickEditRequest={activateRowType:b?"next":"previous"}))}}};
AdfDhtmlTableBasePeer.prototype._processClickToEditActivateRequest=function(){var a=this._clickEditRequest;if(a&&a.activateRowType){var b="next"==a.activateRowType;attrs=b?this._getNextRowKeyAndRow(this._lastRowKeyInView):this._getPreviousRowKeyAndRow(this._lastRowKeyInView);a.activateCellType=b?"first":"last";attrs.rowKey&&this._setActiveRowKey(attrs.rowKey);delete this._lastRowKeyInView}};
AdfDhtmlTableBasePeer.prototype._restoreScrollPosition=function(){var a=this.getComponent().getScrollLeft();0<=a&&this.scrollToPos(a,-1,!0)};
AdfDhtmlTableBasePeer.prototype._unclipInputElem=function(a){var b=AdfAgent.AGENT,d=this.GetScroller();if(d){var e=this._getCellIndex(a);if(!this._hasFrozenColumn()||!this._isColumnFrozen(e)){if(!this._hasSingleScroller()||this._isPaged)d=d[AdfDhtmlTableBasePeer._HSCROLLER];var e=b.getElementLeft(a),f=b.getElementLeft(d);e+a.offsetWidth>f+d.clientWidth&&b.scrollToPos(d,this._currentScrollLeft+(a.offsetWidth+e-(f+d.clientWidth)),null)}}};
AdfDhtmlTableBasePeer.prototype.scrollColumnIntoView=function(a,b){AdfAssert.assert(null!=a||null!=b);var d=AdfAgent.AGENT;if(!b&&(b=d.getElementById(a),!b))return;var e=d.getIntAttribute(b,"_d_index",-1);if(!this._isColumnFrozen(e)){e=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)e=e[AdfDhtmlTableBasePeer._HSCROLLER];var f=b.offsetLeft;if(f!=this._currentScrollLeft){var g=this._colScrollAnimationDuration;void 0==g&&(g=AdfPage.PAGE,this._colScrollAnimationDuration=g=g.isAnimationEnabled()?
parseInt(g.getLookAndFeel().getSkinProperty("af|table-tr-column-scroll-animation-duration")):0);0<g?AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,g,[{element:e,properties:{scrollLeft:f}}],null,null,null):d.scrollToPos(e,f,null)}}};AdfDhtmlTableBasePeer.prototype.getRowIndex=function(a){AdfAssert.assertString(a);AdfAssert.assert(null!=a,"Row Key cannot be null");var b=-1;if(a=this.FindRowByKey(a))b=a.index;return b};
AdfDhtmlTableBasePeer.prototype.getRowKey=function(a){AdfAssert.assertNumber(a);AdfAssert.assert(0<=a,"index must be greater than or equal to 0");for(var b=null,d=this.GetDataBody().childNodes,e=d.length,f=0;f<e;f++){var g=d[f],h=g.startRow;if(a>=h&&a<h+g.numRows){b=AdfAgent.AGENT.getAttribute(g.rows[a-h],AdfDhtmlTableBasePeer._ROW_KEY);break}}return b};AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventAddedSet=function(){this._colSelEventSelectedColIds={}};
AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventRemovedSet=function(){this._colSelEventUnselectedColIds={}};AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventChangedSets=function(){this._colSelEventSelectedColIds={};this._colSelEventUnselectedColIds={}};AdfDhtmlTableBasePeer.prototype._hasColumnSelectionEventChangedSets=function(){return!AdfCollections.isEmpty(this._colSelEventSelectedColIds)||!AdfCollections.isEmpty(this._colSelEventUnselectedColIds)};
AdfDhtmlTableBasePeer.prototype._queueColumnSelectionEvent=function(){if(this._hasColumnSelectionEventChangedSets()){var a=this.getComponent();AdfTableUtils.queueColumnSelectionEvent(a,this._colSelEventSelectedColIds,this._colSelEventUnselectedColIds);this._clearColumnSelectionEventChangedSets()}};
AdfDhtmlTableBasePeer.prototype.ConvertClientIdToLocator=function(a,b,d,e){var f=this.__getColumnHeader();if(f&&(b=b.getPeer().getDomElement())&&AdfDomUtils.isAncestor(f,b))return;f=a.getClientId();a=AdfStrings.count(f,":");AdfAssert.assert(0<=d.indexOf(f));d=d.substring(f.length+1);f=d.indexOf(":");0<f&&(d=d.substring(0,f),d=this.FindRowByKey(d),e.push([a+1,d?d.index:null]))};
AdfDhtmlTableBasePeer.prototype.convertLocatorToClientId=function(a,b){var d=a.getClientId(),e=null,f=this.GetDataBody();if(null!=f)for(var f=f.childNodes,g=0;g<f.length&&!e;g++){var h=f[g],k=h.startRow;if(b>=k&&b<k+h.numRows){e=h.rows[b-k].getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);break}}return e?d+":"+e:null};
AdfDhtmlTableBasePeer.prototype._computeAutoHeight=function(){var a=AdfAgent.AGENT,b=0,d=this._autoHeightRows;if(0<d){var e=a.getPlatform()==AdfAgent.GECKO_PLATFORM,f=this.GetFirstVisibleRowKeyAndRow().row;if(f)for(var g=this.GetDataBody().childNodes,h=g.length,k=0,l=0,m=0;m<h&&k<d;m++){var l=m,n=g[m],n=n.rows,p=0;null!=n&&(p=n.length);for(var q=0;q<p&&k<d;q++)if(f===n[q]||0<k){k++;var r=n[q].getBoundingClientRect().height,b=b+r}}if(k!=d&&0<k){h=!1;for(m=l;0<=m;m--){n=g[m];n=n.rows;p=0;null!=n&&(p=
n.length);for(q=p-1;0<=q&&k<d;q--)f===n[q]?h=!0:h&&(k++,e?(l=a.getComputedStyle(n[q]),r=parseFloat(l.height)):r=n[q].offsetHeight,b+=r)}}}return e?Math.round(b):b};
AdfDhtmlTableBasePeer.prototype._setOuterHeightForBodyHeight=function(a){var b=this.getDomElement(),d=this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_OVERLAY,e=d&&!this.IsEmpty?0:this._getScrollbarHeight(),e=a+this._cachedCHHeight+this._cachedCFHeight+this._cachedNBHeight+e;this._sizeOuterContainer(b,e);if(this.IsEmpty)d&&(this._scrollerOverlayEmptyOverflowStyle=b.style.overflow,b.style.overflow="hidden");else{var f=AdfAgent.getAgent(),g=f.getPlatform()==AdfAgent.IE_PLATFORM;this._restoreHorizontalScrollBarForIE8();
this._setScrollerHeight(e,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight);e=d?0:this._getScrollbarHeight();this._setScrollerWidth(b.clientWidth,this._frozenWidth);g&&8>f.getVersion()&&this._setFakeCanvasHeight(this._canvasHeight);f=this._getScrollbarHeight();e!=f&&!d&&(e=a+this._cachedCHHeight+this._cachedCFHeight+f,this._sizeOuterContainer(b,e),this._setScrollerHeight(e,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight));this.SizeDataBody(this.GetDataBody(),b.clientWidth,
b.clientHeight)}};AdfDhtmlTableBasePeer.prototype._sizeOuterContainer=function(a,b){var d=AdfAgent.AGENT;if("border-box"==d.getBoxSizing(a)){var e=AdfAgent.getCSSLengthAsInt,d=d.getComputedStyle(a);b=b+e(d.paddingTop)+e(d.paddingBottom)+e(d.marginTop)+e(d.marginBottom)+e(d.borderTopWidth)+e(d.borderBottomWidth)}a.style.height=b+"px";a.style.minHeight&&parseFloat(a.style.minHeight)>b&&(a.style.minHeight=b+"px")};
AdfDhtmlTableBasePeer.prototype.AdjustAutoHeight=function(){var a=this.GetPanelCollectionPeer(),b=this.GetDataBody();if(a&&a.isDetached()){var a=this.getDomElement(),d=a.clientHeight;this.__fixPanelCollectionDimensions(!0);this.SizeDataBody(b,a.clientWidth,d);this.IsEmpty||this._setScrollerHeight(d,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight)}else if(this.isHeightAutoSized()&&!this.BusyAnimating()){var d=!this.IsEmpty?this._computeAutoHeight():b.offsetHeight,e=AdfAgent.AGENT,e=
e.getPlatform()==AdfAgent.IE_PLATFORM&&9>e.getVersion()&&7<e.getVersion();if(this.IsEmpty||d!=b.offsetHeight||e&&2>this.GetRowCount())this._setOuterHeightForBodyHeight(d),a&&this.__fixPanelCollectionDimensions(!1);this._checkAutoHeightScrollbar(b);!this._stretchingTheColumns&&!this._desendentResizeQueued&&this._doStretch()}};
AdfDhtmlTableBasePeer.prototype._queueDescendantResize=function(){if(!this._desendentResizeQueued){this._desendentResizeQueued=!0;try{AdfPage.PAGE.__queueDescendantResizeNotifySource(this.getComponent()),AdfPage.PAGE.__doDescendantResizeNotify()}finally{delete this._desendentResizeQueued}}};AdfDhtmlTableBasePeer.prototype._doStretch=function(a){a=this._totalWidth;this._stretchTheColumns();this._totalWidth!=a&&this._queueDescendantResize();return-1};
AdfDhtmlTableBasePeer.prototype._checkAutoHeightScrollbar=function(a){var b=a.childNodes,d=this._autoHeightRows,e=b.length,f=this._getRowCountWithDisclosedDetailStampRow(a);this._allRowsAvailableOnClient(b,e)&&f<=d&&(b=this._getScrollerClientHeight(),b!=this._canvasHeight&&(this._canvasHeight=b,this._setFakeCanvasHeight(b),b=this.getDomElement(),this._setScrollerWidth(b.clientWidth,this._frozenWidth),this.SizeDataBody(a,b.clientWidth,b.clientHeight)))};
AdfDhtmlTableBasePeer.prototype._getRowCountWithDisclosedDetailStampRow=function(a){var b=0;if(this._hasDetailStamp){a=a.childNodes;for(var d=a.length,e=0;e<d;e++){var f=null;null!=a[e]&&(f=a[e].rows);null!=f&&(b+=f.length)}}else b=this.GetRowCount();return b};AdfDhtmlTableBasePeer._maxMessageType=function(a){AdfAssert.assertString(a);a=AdfPage.PAGE.getMessages(a);for(var b=AdfFacesMessage.TYPE_INFO,d=0;d<a.length;d++)b=Math.max(b,AdfFacesMessage.getTypeFromMessage(a[d]));return b};
AdfDhtmlTableBasePeer.prototype._getRTLScrollAdjustment=function(){var a=AdfAgent.getAgent(),b=a.getPlatform();if(b==AdfAgent.IE_PLATFORM&&7<a.getVersion()||b==AdfAgent.WEBKIT_PLATFORM){a=this.GetScroller();if(!this._footerless||this._isPaged)a=a[AdfDhtmlTableBasePeer._HSCROLLER];return a.scrollWidth-a.clientWidth-this._currentScrollLeft}return this._currentScrollLeft};
AdfDhtmlTableBasePeer.prototype.DescendantMessageChanged=function(){var a=this.getDomElement(),b=AdfAgent.AGENT,d=this.getComponent().getClientId(),e=this._rowKeysWithMessages;e||(this._rowKeysWithMessages=e=[]);for(var f=AdfPage.PAGE.getClientIdsWithMessages(d),d={},g={},h=0;h<f.length;h++){var k=f[h],l=AdfDhtmlTableBasePeer._maxMessageType(k);if(k=b.getElementById(k))if(k=this.GetRowKeyAndRow(k,a)){var m=k[0];if(k=this.GetRowHeaderCellFromRow(k[1])){var n=AdfCollections.indexOf(e,m);-1==n&&(n=e.push(m)-
1);d[n]=Math.max(l,!d[n]?-1:d[n]);g[n]=k}}}for(h=e.length-1;-1<h;h--)if(m=e[h],d[h])k=g[h],f=b.getExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),a=d[h],f!=a&&(-1<f&&AdfMessageUtils.removeCSSClassName(k,f),b.setExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,a),AdfMessageUtils.addCSSClassName(k,a));else if(a=this.FindRowByKey(m)){if(k=this.GetRowHeaderCellFromRow(a.tr))f=b.getExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),
AdfMessageUtils.removeCSSClassName(k,f),b.setExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),AdfCollections.removeArrayKey(e,h)}else AdfCollections.removeArrayKey(e,h)};AdfDhtmlTableBasePeer.prototype.ApplyTooltipTitle=function(a){var b=this._getOnlyTextNode(a);b&&this._isCellTruncated(a)&&a.setAttribute("title",b.nodeValue)};
AdfDhtmlTableBasePeer.prototype._getParentMatchingId=function(a,b){for(var d=a,e=null,f=this.getDomElement();!e&&d&&d!=f.parent&&1==d.nodeType;)if(d.id&&0<=d.id.indexOf(b)){e=d;break}else d=d.parentNode;return e};
AdfDhtmlTableBasePeer.prototype._resizeNavBar=function(a,b){var d=!1;a<this._cachedNBWidth&&!this._nbarMin?d=this._nbarMin=!0:a>=this._cachedNBWidth&&this._nbarMin&&(this._nbarMin=!1,d=!0);if(d){var d=AdfAgent.AGENT,e=this.getComponent().getClientId(),f=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_RANGE_TEXT),f=d.getElementById(f),e=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_PAGE_CNT),d=d.getElementById(e);this._nbarMin?(d.style.display="none",f.style.display="none"):(d.style.display=
"",f.style.display="")}};
AdfDhtmlTableBasePeer.prototype.__handleNavBarItemsClick=function(a,b){var d=!1;if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_PREVIOUS))-1<this._isLinkDisabled(b)||(this._handlePrevClick(a),d=!0);else if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_NEXT))-1<this._isLinkDisabled(b)||(this._handleNextClick(a),d=!0);else if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_FIRST))-1<this._isLinkDisabled(b)||(this._handleFirstClick(a),d=!0);else{var e=this._getNavBarPageRow(b,AdfDhtmlTableBasePeer._NAVBAR_LAST);
null!=e?-1<this._isLinkDisabled(b)||(this._handlePageRowClick(e,a),d=!0):(e=this._getNavBarPageRow(b,AdfDhtmlTableBasePeer._NAVBAR_PAGE),null!=e&&(this._handlePageRowClick(e,a),d=!0))}d&&AdfDomUtils.addCSSClassName(b,"p_AFActivated")};AdfDhtmlTableBasePeer.prototype._isLinkDisabled=function(a){return a.className.indexOf("p_AFDisabled")};
AdfDhtmlTableBasePeer.prototype.__handleLoadMoreItemsClick=function(a,b){var d=this.getComponent(),e=b.id;e==AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_LINK)?this._loadMoreFetch(!0):e==AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_TOP_LINK)&&this._loadMoreFetch(!1)};
AdfDhtmlTableBasePeer.prototype._loadMoreFetch=function(a){var b=this.GetDataBody().childNodes,d=b.length;if(a){if(a=b[d-1],b=a.startRow+a.numRows,d=this.GetRowCount(),0<d&&b<d||0>d)b-=1,a=this._getBlockLastRowKey(a),this._startFetch(AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE,b,a,null,!1)}else a=b[0],b=a.startRow,a=this._getBlockFirstRowKey(a),this._startFetch(AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE,b,a,null,!1)};
AdfDhtmlTableBasePeer.prototype._updateLoadMoreItemsRangeText=function(a,b,d,e){if(!this._isImplicitLoadMore){var f=AdfPage.PAGE.getLookAndFeel(),g=this.getComponent(),h=this._getLoadMore(e);e=AdfRichUIPeer.CreateSubId(g.getClientId(),e?AdfDhtmlTableBasePeer._LOAD_MORE_RNG_TOP_TEXT:AdfDhtmlTableBasePeer._LOAD_MORE_RNG_BOTTOM_TEXT);a=parseInt(a)+1;h=h.childNodes[0].childNodes;for(g=0;g<h.length;g++)if(null!=h[g].id&&-1!=h[g].id.indexOf(e)){e=null;e=0<this.GetRowCount()&&0<d?f.getTranslatedString("af_table.LABEL_ITEM_RANGE_KNOWN_COUNT",
new String(a),new String(b),new String(d)):f.getTranslatedString("af_table.LABEL_ITEM_RANGE_UNKNOWN_COUNT",new String(a),new String(b));h[g].childNodes[0].nodeValue=e;break}}};AdfDhtmlTableBasePeer.prototype.GetFirst=function(){return this.getComponent().getFirst()};AdfDhtmlTableBasePeer.prototype.RegisterFirstPropertyChange=function(){AdfRichUIPeer.addComponentPropertyChanges(AdfDhtmlTablePeer,"first")};AdfDhtmlTableBasePeer.prototype.GetRows=function(){return this.getComponent().getRows()};
AdfDhtmlTableBasePeer.prototype.ComponentFirstChanged=function(a,b,d,e){this.QueueRangeChangeEvent(e,d);this._isPaged&&AdfPage.PAGE.addPartialTargets(a);return!1};AdfDhtmlTableBasePeer.prototype.ComponentRowsChanged=function(a,b,d,e){AdfRangeChangeEvent.queue(a,(0).toString(),parseInt(e).toString(),(0).toString(),parseInt(d).toString());this._isPaged&&AdfPage.PAGE.addPartialTargets(a);return!1};
AdfDhtmlTableBasePeer.prototype.QueueRangeChangeEvent=function(a,b){var d=this.getComponent(),e=parseInt(this.GetRows()),f=parseInt(a),g=f+e-1,h=parseInt(b);AdfRangeChangeEvent.queue(d,f.toString(),g.toString(),h.toString(),(h+e-1).toString())};AdfDhtmlTableBasePeer.prototype._isNavBarLink=function(a,b){var d=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),b);return null!=this._getParentMatchingId(a,d)};
AdfDhtmlTableBasePeer.prototype._getNavBarPageRow=function(a,b){var d=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),b),e=this._getParentMatchingId(a,d);if(null!=e)return e.id.substring(d.length)};AdfDhtmlTableBasePeer.prototype._handlePrevClick=function(a){var b=parseInt(this.GetFirst()),d=parseInt(this.GetRows()),b=Math.max(b-d,0);this.QueueRangeChangeEvent(this.GetFirst(),b);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlTableBasePeer.prototype._handleFirstClick=function(a){this.QueueRangeChangeEvent(this.GetFirst(),0);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};AdfDhtmlTableBasePeer.prototype._handleNextClick=function(a){var b=parseInt(this.GetFirst()),d=parseInt(this.GetRows());this.QueueRangeChangeEvent(this.GetFirst(),b+d);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlTableBasePeer.prototype._handlePageRowClick=function(a,b){this.QueueRangeChangeEvent(this.GetFirst(),a);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(b)};AdfDhtmlTableBasePeer.prototype.setBusy=function(a,b){AdfAgent.AGENT.supportsTransientStyleClasses()&&AdfDhtmlTableBasePeer.superclass.setBusy.call(this,a,b)};
AdfDhtmlTableBasePeer.prototype.setSelectedRowKeysWithoutEvent=function(a){this.suppressSelectionEventDelivery(!0);this.getComponent().setSelectedRowKeys(a);this.suppressSelectionEventDelivery(!1)};
AdfDhtmlTableBasePeer.prototype._addScrollEventListeners=function(a){var b=AdfAgent.AGENT,d=b.getPlatform();d==AdfAgent.IE_PLATFORM&&8<b.getVersion()||d==AdfAgent.GECKO_PLATFORM&&17<=b.getVersion()?a.addEventListener("wheel",AdfDhtmlTableBasePeer._handleMouseWheel,!0):a.onmousewheel=AdfDhtmlTableBasePeer._handleMouseWheel;d!=AdfAgent.IE_PLATFORM&&a.addEventListener("DOMMouseScroll",AdfDhtmlTableBasePeer._handleMouseWheel,!0);a.onscroll=this.createCallback(this._handleDataBodyScroll);AdfAgent.guessOS()==
AdfAgent.ANDROID_OS&&-1<navigator.userAgent.toLowerCase().indexOf("chrome")&&(this._touchMoveManager=b.createTouchMoveManager(a,this.createCallback(this._handleTouchMovement),1));this._isIOS13OrLater()&&(this._touchMoveManager=b.createTouchMoveManager(a,this.createCallback(this._handleTouchMovement),1));this._handleTouchEndCallback=this.createCallback(this._handleTouchEnd);b.addBubbleEventListener(a,"touchend",this._handleTouchEndCallback);(a=this.__getColumnHeader())&&b.addBubbleEventListener(a,
"touchend",this._handleTouchEndCallback)};AdfDhtmlTableBasePeer.prototype._handleTouchEnd=function(a){a._insideADFTable=1};AdfDhtmlTableBasePeer.prototype._isIOS13OrLater=function(){return"AdfSafariMobileAgent"==AdfAgent.AGENT.getTypeName()&&13<=parseFloat(AdfAgent.AGENT.getVersion())&&"Mac"==AdfAgent.AGENT.getOS()||13<=parseFloat(AdfAgent.AGENT.getVersion())&&"Mac"==AdfAgent.AGENT.getOS()&&this._isTouch};AdfDhtmlTableBasePeer.prototype._processColGroup=function(){return!0};
AdfDhtmlTableBasePeer._findHiddenLabel=function(a){if(a.id){a=AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlEditableValuePeer._CONTENT_ID);var b=AdfAgent.AGENT.getElementById(a);if(b&&(b=b.nextElementSibling)&&"LABEL"==b.nodeName&&b.htmlFor==a)return b}return null};AdfDhtmlTableBasePeer.msgMap={update:"AFActiveDataTableRowUpdate",remove:"AFActiveDataTableRowDelete"};AdfDhtmlTableBasePeer.prototype.preventSwitchToEditableMode=function(){this._remainReadOnly=!0};