// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare dojo/_base/html dijit/_WidgetBase dojo/_base/lang dojo/_base/array jimu/utils dgrid/OnDemandGrid dgrid/extensions/ColumnResizer dgrid/extensions/ColumnReorder".split(" "),function(e,f,l,g,d,m,n,p,q){return e([l],{declaredClass:"jimu.dijit.DataPreviewTable",baseClass:"jimu-data-preview-table",featureSet:null,loadingIndicator:null,_AUTO_WIDTH_COLS:6,postCreate:function(){this.inherited(arguments);m.loadStyleLink("dgrid",apiUrl+"dgrid/css/dgrid.css");this.tableContainer=f.create("div",
{"class":"table-container"},this.domNode);this.height&&f.style(this.tableContainer,"height",this.height-80+"px");var a=this._getColumns();this.grid=new (e([n,p,q]))({columns:a},this.tableContainer);a=this._getData();this.grid.renderArray(a)},_getColumns:function(){var a="auto";this.featureSet.fields&&this.featureSet.fields.length&&this.featureSet.fields.length>this._AUTO_WIDTH_COLS&&(a=120);var b={};d.forEach(this.featureSet.fields,function(c){b[c.name]={label:c.alias,width:a}});return b},_getData:function(){var a=
[];d.forEach(this.featureSet.features,function(b,c){var h={};d.forEach(this.featureSet.fields,function(k){h[k.name]=b.attributes[k.name]},this);a.push(g.clone(g.mixin({id:c+1},h)))},this);return a}})});