function queryGeometryResultsHandler_toGrid(results, idx) { //format the data for the data grid var dataList = {}; dataList.data = arrayUtils.map(results.features, function(feature){ return feature.attributes; }); var currentMemory = new Memory({data:dataList.data, idProperty:'OBJECTID'}); var gridcolumns = []; for (attName in dataList.data[0]) { if (attName != "Shape" && attName !== "Shape.area" && attName !== "Shape.len") { var objects = {}; objects.label = attName; objects.field = attName; gridcolumns.push(objects); } } //create a titlePane in the floatingPane for each visible layer var currentLayerId = qTaskNameList[idx];//a list of layers created in query task functions var paneTitle = (currentLayerId.split('_').join(' '))+" ("+results.features.length+")";//formats string to look nice tp = new TitlePane({ id: 'gridPane_'+currentLayerId, title: paneTitle, splitter:true, class:'reportTitlePane'}); registry.byId("reportContainer").addChild(tp); tp.startup(); // Create Grid using structure and data defined above grid = new Grid({id:currentLayerId+'_grid', autoHeight:true, columns:gridcolumns, store:currentMemory} ); //dgrid grid.startup(); if (results.features.length > 0) { tp.set("content", grid); }else { tp.set("content", "No features found"); } }
Solved! Go to Solution.
I hate to mark any particular reply as the answer to my posting, but I'm always looking for the green 'A' to know the posting did had a resolution. I'll continue to pursue my formatting a zoom button question, but mark this answered since my grid now has data in it.