/* See license.txt for terms of usage */ define("domplate/tableView",["domplate/domplate","core/lib","i18n!nls/tableView","domplate/domTree","core/trace"],function(Domplate,Lib,Strings,DomTree,Trace){with(Domplate){var TableView=domplate({className:"table",tag:DIV({"class":"dataTableSizer",tabindex:"-1"},TABLE({"class":"dataTable",cellspacing:0,cellpadding:0,width:"100%",role:"grid"},THEAD({"class":"dataTableThead",role:"presentation"},TR({"class":"headerRow focusRow dataTableRow subFocusRow",role:"row",onclick:"$onClickHeader"},FOR("column","$object.columns",TH({"class":"headerCell a11yFocus",role:"columnheader",$alphaValue:"$column.alphaValue"},DIV({"class":"headerCellBox"},"$column.label"))))),TBODY({"class":"dataTableTbody",role:"presentation"},FOR("row","$object.data|getRows",TR({"class":"focusRow dataTableRow subFocusRow",role:"row"},FOR("column","$row|getColumns",TD({"class":"a11yFocus dataTableCell",role:"gridcell"},TAG("$column|getValueTag",{object:"$column"})))))))),getValueTag:function(e){var t=typeof e;if(t=="object")return DomTree.Reps.Tree.tag;var n=DomTree.Reps.getRep(e);return n.shortTag||n.tag},getRows:function(e){var t=this.getProps(e);return t.length?t:[]},getColumns:function(e){if(typeof e!="object")return[e];var t=[];for(var n=0;n=0;--h)r.appendChild(s[h].row)}},getHeaderColumns:function(e){var t;for(var n in e){t=e[n];break}if(typeof t!="object")return[{label:Strings.objectProperties}];var r=[];for(var n in t){var i=t[n];if(!this.domFilter(i,n))continue;r.push({property:n,label:n,alphaValue:typeof i!="number"})}return r},domFilter:function(e,t){return!0},render:function(e,t,n){if(!t)return;var r=[];for(var i=0;n&&i0&&l.clientHeight>c&&(l.style.height=c+"px")}catch(h){Trace.exception("tableView.render; EXCEPTION "+h,h)}finally{delete this.columns}}});return TableView}});