/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("datatable-body",function(e,t){var n=e.Lang,r=n.isArray,i=n.isNumber,s=n.isString,o=n.sub,u=e.Escape.html,a=e.Array,f=e.bind,l=e.Object,c=/\{value\}/g,h="contentUpdate",p={above:[-1,0],below:[1,0],next:[0,1],prev:[0,-1],previous:[0,-1]};e.namespace("DataTable").BodyView=e.Base.create("tableBody",e.View,[],{CELL_TEMPLATE:'
{content} | ',ROW_TEMPLATE:'{content}
',TBODY_TEMPLATE:'',getCell:function(t,n){var i=this.tbodyNode,o,u,a,f;return t&&i&&(r(t)?(o=i.get("children").item(t[0]),u=o&&o.get("children").item(t[1])):t._node&&(u=t.ancestor("."+this.getClassName("cell"),!0)),u&&n&&(f=i.get("firstChild.rowIndex"),s(n)&&(p[n]||e.error("Unrecognized shift: "+n,null,"datatable-body"),n=p[n]),r(n)&&(a=u.get("parentNode.rowIndex")+n[0]-f,o=i.get("children").item(a),a=u.get("cellIndex")+n[1],u=o&&o.get("children").item(a)))),u||null},getClassName:function(){var t=this.host,n;return t&&t.getClassName?t.getClassName.apply(t,arguments):(n=a(arguments),n.unshift(this.constructor.NAME),e.ClassNameManager.getClassName.apply(e.ClassNameManager,n))},getRecord:function(e){var t=this.get("modelList"),n=this.tbodyNode,r=null,i;return n&&(s(e)&&(e=n.one("#"+e)),e&&e._node&&(r=e.ancestor(function(e){return e.get("parentNode").compareTo(n)},!0),i=r&&t.getByClientId(r.getData("yui3-record")))),i||null},getRow:function(e){var t=this.tbodyNode,n=null;return t&&(e&&(e=this._idMap[e.get?e.get("clientId"):e]||e),n=i(e)?t.get("children").item(e):t.one("#"+e)),n},render:function(){var e=this.get("container"),t=this.get("modelList"),n=this.get("columns"),r=this.tbodyNode||(this.tbodyNode=this._createTBodyNode());return this._createRowTemplate(n),t&&(r.setHTML(this._createDataHTML(n)),this._applyNodeFormatters(r,n)),r.get("parentNode")!==e&&e.appendChild(r),this.bindUI(),this},refreshRow:function(e,t,n){var r,i,s=n.length,o;for(o=0;o1?'headers="'+s._headers.join(" ")+'"':"",l={content:"{"+a+"}",headers:f,className:this.getClassName("col",a)+" "+(s.className||"")+" "+this.getClassName("cell")+" {"+a+"-className}"},!h&&s.formatter&&(l.content=s.formatter.replace(c,l.content)),s.nodeFormatter&&(l.content=""),t+=o(s.cellTemplate||n,l);this._rowTemplate=o(this.ROW_TEMPLATE,{content:t})},_setColumnsFormatterFn:function(t){var r=e.DataTable.BodyView.Formatters,i,s,o,u;for(o=0,u=t.length;o