YUI.add("datatable-table",function(a,e){var i=a.Array,t=a.Lang,s=t.sub,n=t.isArray,o=t.isFunction;a.namespace("DataTable").TableView=a.Base.create("table",a.View,[],{CAPTION_TEMPLATE:'<caption class="{className}"></caption>',TABLE_TEMPLATE:'<table cellspacing="0" class="{className}"></table>',getCell:function(){return this.body&&this.body.getCell&&this.body.getCell.apply(this.body,arguments)},getClassName:function(){var e=this.host,t=e&&e.constructor.NAME||this.constructor.NAME;return e&&e.getClassName?e.getClassName.apply(e,arguments):a.ClassNameManager.getClassName.apply(a.ClassNameManager,[t].concat(i(arguments,0,!0)))},getRecord:function(){return this.body&&this.body.getRecord&&this.body.getRecord.apply(this.body,arguments)},getRow:function(){return this.body&&this.body.getRow&&this.body.getRow.apply(this.body,arguments)},_afterSummaryChange:function(e){this._uiSetSummary(e.newVal)},_afterCaptionChange:function(e){this._uiSetCaption(e.newVal)},_afterWidthChange:function(e){this._uiSetWidth(e.newVal)},_bindUI:function(){var e;this._eventHandles||(e=a.bind("_relayAttrChange",this),this._eventHandles=this.after({columnsChange:e,modelListChange:e,summaryChange:a.bind("_afterSummaryChange",this),captionChange:a.bind("_afterCaptionChange",this),widthChange:a.bind("_afterWidthChange",this)}))},_createTable:function(){return a.Node.create(s(this.TABLE_TEMPLATE,{className:this.getClassName("table")})).empty()},_defRenderBodyFn:function(e){e.view.render()},_defRenderFooterFn:function(e){e.view.render()},_defRenderHeaderFn:function(e){e.view.render()},_defRenderTableFn:function(e){var t=this.get("container"),i=this.getAttrs();this.tableNode||(this.tableNode=this._createTable()),i.host=this.get("host")||this,i.table=this,i.container=this.tableNode,this._uiSetCaption(this.get("caption")),this._uiSetSummary(this.get("summary")),this._uiSetWidth(this.get("width")),(this.head||e.headerView)&&(this.head||(this.head=new e.headerView(a.merge(i,e.headerConfig))),this.fire("renderHeader",{view:this.head})),(this.foot||e.footerView)&&(this.foot||(this.foot=new e.footerView(a.merge(i,e.footerConfig))),this.fire("renderFooter",{view:this.foot})),i.columns=this.displayColumns,(this.body||e.bodyView)&&(this.body||(this.body=new e.bodyView(a.merge(i,e.bodyConfig))),this.fire("renderBody",{view:this.body})),t.contains(this.tableNode)||t.append(this.tableNode),this._bindUI()},destructor:function(){this.head&&this.head.destroy&&this.head.destroy(),delete this.head,this.foot&&this.foot.destroy&&this.foot.destroy(),delete this.foot,this.body&&this.body.destroy&&this.body.destroy(),delete this.body,this._eventHandles&&(this._eventHandles.detach(),delete this._eventHandles),this.tableNode&&this.tableNode.remove().destroy(!0)},_extractDisplayColumns:function(){var e=this.get("columns"),s=[];e&&!function o(e){for(var t,i=0,a=e.length;i<a;++i)t=e[i],n(t.children)?o(t.children):s.push(t)}(e),this.displayColumns=s},_initEvents:function(){this.publish({renderTable:{defaultFn:a.bind("_defRenderTableFn",this)},renderHeader:{defaultFn:a.bind("_defRenderHeaderFn",this)},renderBody:{defaultFn:a.bind("_defRenderBodyFn",this)},renderFooter:{defaultFn:a.bind("_defRenderFooterFn",this)}})},initializer:function(e){this.host=e.host,this._initEvents(),this._extractDisplayColumns(),this.after("columnsChange",this._extractDisplayColumns,this)},_relayAttrChange:function(e){var t=e.attrName,e=e.newVal;this.head&&this.head.set(t,e),this.foot&&this.foot.set(t,e),this.body&&("columns"===t&&(e=this.displayColumns),this.body.set(t,e))},render:function(){return this.get("container")&&this.fire("renderTable",{headerView:this.get("headerView"),headerConfig:this.get("headerConfig"),bodyView:this.get("bodyView"),bodyConfig:this.get("bodyConfig"),footerView:this.get("footerView"),footerConfig:this.get("footerConfig")}),this},_uiSetCaption:function(e){var t=this.tableNode,i=this.captionNode;e?(i||(this.captionNode=i=a.Node.create(s(this.CAPTION_TEMPLATE,{className:this.getClassName("caption")})),t.prepend(this.captionNode)),i.setHTML(e)):i&&(i.remove(!0),delete this.captionNode)},_uiSetSummary:function(e){e?this.tableNode.setAttribute("summary",e):this.tableNode.removeAttribute("summary")},_uiSetWidth:function(e){var t=this.tableNode;t.setStyle("width",e?this.get("container").get("offsetWidth")-(parseInt(t.getComputedStyle("borderLeftWidth"),10)||0)-(parseInt(t.getComputedStyle("borderLeftWidth"),10)||0)+"px":""),t.setStyle("width",e)},_validateView:function(e){return o(e)&&e.prototype.render}},{ATTRS:{columns:{validator:n},width:{value:"",validator:t.isString},headerView:{value:a.DataTable.HeaderView,validator:"_validateView"},footerView:{validator:"_validateView"},bodyView:{value:a.DataTable.BodyView,validator:"_validateView"}}})},"patched-v3.18.7",{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]});