Select to view content in your preferred language

Query Result to DataGrid

4429
13
Jump to solution
08-29-2014 05:34 AM
saurabhgupta2
New Contributor II

Hi all

I am trying to populate datagrid from my query result. I am looking for something similar to attribute table for a datagrid i.e Its floating and selection on attribute table highlights and zoom to the feature but the result of query table should not go. Can anyone suggest on this .

I am using FV 3.6 , FB 4.7

I cant use featurelayer for this I am displaying all my result in graphic Layer

Regards

Saurabh

0 Kudos
13 Replies
saurabhgupta2
New Contributor II

Robert

I would love to use those codes of your widget. But due to my limited experience I am really finding it difficult to fit that piece of code into my own widget(Developed specifically for a purpose). That is why I am trying to show just some basic datagrid stuff. I have copy pasted my own code for the widget for which i have to show the results. It would be very helpful if you can tell me how to integrate your fixed or floating window with my widget result set.

<?xml version="1.0" encoding="utf-8"?>

<!--

///////////////////////////////////////////////////////////////////////////

// Copyright (c) 2010-2011 Esri. All Rights Reserved.

//

// Licensed under the Apache License, Version 2.0 (the "License");

// you may not use this file except in compliance with the License.

// You may obtain a copy of the License at

//

//    http://www.apache.org/licenses/LICENSE-2.0

//

// Unless required by applicable law or agreed to in writing, software

// distributed under the License is distributed on an "AS IS" BASIS,

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

// See the License for the specific language governing permissions and

// limitations under the License.

///////////////////////////////////////////////////////////////////////////

-->

<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:s="library://ns.adobe.com/flex/spark"

                   xmlns:mx="library://ns.adobe.com/flex/mx"

                   xmlns:viewer="com.esri.viewer.*"

    xmlns:text="flash.text.*"

    xmlns:Class ="widgets.Samples.AssetsLifeWidget.*"

   

    xmlns:esri="http://www.esri.com/2008/ags"

                  

    widgetConfigLoaded="basewidget_widgetConfigLoaded()">

  <fx:Style>

  @namespace esri "http://www.esri.com/2008/ags";

  esri|InfoSymbolWindow {

  infoPlacementMode: none;

  infoPlacement:top;

  infoOffsetX: 12;

  infoOffsetY: 12;

  infoOffsetW: 6;

  borderThickness: 2;

  }

  </fx:Style>

  <fx:Script>

        <![CDATA[

  import com.esri.ags.FeatureSet;

  import com.esri.ags.Graphic;

  import com.esri.ags.geometry.Extent;

  import com.esri.ags.geometry.MapPoint;

  import com.esri.ags.layers.GraphicsLayer;

  import com.esri.ags.tasks.QueryTask;

  import com.esri.ags.tasks.supportClasses.Query;

  import com.esri.ags.utils.GraphicUtil;

  import com.esri.ags.layers.FeatureLayer;

    

  import mx.collections.ArrayCollection;

  import mx.controls.Alert;

  import mx.formatters.DateFormatter;

  import mx.rpc.AsyncResponder;

  import spark.components.DataGrid;

  import com.esri.ags.renderers.UniqueValueRenderer;

  import com.esri.ags.events.LayerEvent;

  import com.esri.ags.renderers.supportClasses.UniqueValueInfo;

  import com.esri.ags.layers.supportClasses.FeatureCollection;

  import com.esri.viewer.utils.ErrorMessageUtil;

  import com.esri.ags.layers.supportClasses.LayerDetails;

  private var mygraphicsLayer:GraphicsLayer = new GraphicsLayer() ;

  private var resultFeatureLayer:FeatureLayer ;

  private var Result:String = null;

  private var WhereString:String = null;

  private var DateArray:ArrayCollection ;

  private var Attobject:ArrayCollection ;

  private var PresentDate:Date = new Date();

  private var DateArrayCondition:ArrayCollection ;

  private var DateDiffInYearsMonthsDaysUsed:String;

  private var DateDiffInYearsMonthsDaysLeft:String;

  private var FromDateString:String;

  private var ToDateString:String;

  private var dataGridResult:DataGrid =null;

  private var FeaturesetDataGrid:Array =new Array;

  private var queryLayer:FeatureLayer;

  private var FromDate:Date;

  private var ToDate:Date;

  private var DateFmt:DateFormatter = new DateFormatter;

  private var layerDetails:LayerDetails;

  private  var uniqueValuerenderer:UniqueValueRenderer = new UniqueValueRenderer();

  private var weightedClusterer:WeightedClusterer = new WeightedClusterer();

  private var uniqueValueInfos:Array = [];

  private var RecordCount:int ;

  private function basewidget_widgetConfigLoaded():void

  {

  queryLayer = new FeatureLayer();

  queryLayer.addEventListener(LayerEvent.LOAD, queryLayer_loadHandler);

  queryLayer.addEventListener(LayerEvent.LOAD_ERROR, queryLayer_loadErrorHandler);

  queryLayer.useAMF = true;

  queryLayer.outFields = query.outFields;

  queryLayer.url = "http://192.168.9.70:6080/arcgis/rest/services/Jasdan_Data/MapServer/25";

  resultFeatureLayer = new FeatureLayer();

  resultFeatureLayer.outFields = queryLayer.outFields;

  resultFeatureLayer.addEventListener(LayerEvent.LOAD, resultFeatureLayer_loadHandler);

  resultFeatureLayer.addEventListener(LayerEvent.LOAD_ERROR, resultFeatureLayer_loadErrorHandler);

  uniqueValuerenderer.field = "timeofexpire";

  uniqueValueInfos.push(new UniqueValueInfo(Under1Month,"Under1Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Under2Month, "Under2Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Under3Month, "Under3Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Under4Month,"Under4Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Under5Month, "Under5Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Under6Month, "Under6Month"));

  uniqueValueInfos.push(new UniqueValueInfo(Expired, "Expired"));

  uniqueValuerenderer.infos = uniqueValueInfos;

  weightedClusterer.sizeInPixels = 22;

  weightedClusterer.symbol=flareSymbol;

  weightedClusterer.center = map.center;

  //map.addEventListener(MapMouseEvent.MAP_CLICK, onClickFunction);

  trace(resultFeatureLayer.name);

  }

  private function resultFeatureLayer_loadHandler(event:LayerEvent):void

  {

  resultFeatureLayer.removeEventListener(LayerEvent.LOAD, resultFeatureLayer_loadHandler);

  resultFeatureLayer.removeEventListener(LayerEvent.LOAD_ERROR, resultFeatureLayer_loadErrorHandler);

  if (resultFeatureLayer)

  {

  resultFeatureLayer.clusterer =weightedClusterer;

  resultFeatureLayer.renderer = uniqueValuerenderer;

  resultFeatureLayer.visible = false;

  resultFeatureLayer.isEditable = true;

  resultFeatureLayer.name ="AssestLifeRresult"

  }

  }

  private function resultFeatureLayer_loadErrorHandler( event:LayerEvent):void

  {

  resultFeatureLayer.removeEventListener(LayerEvent.LOAD, resultFeatureLayer_loadHandler);

  resultFeatureLayer.removeEventListener(LayerEvent.LOAD_ERROR, resultFeatureLayer_loadErrorHandler);

  var errorMessage:String = getDefaultString("layerFailedToLoad",

  event.layer.name,

  ErrorMessageUtil.makeHTMLSafe(ErrorMessageUtil.buildFaultMessage(event.fault)));

  showError(errorMessage);

  }

  private function queryLayer_loadHandler(event:LayerEvent):void

  {

  queryLayer.removeEventListener(LayerEvent.LOAD, queryLayer_loadHandler);

  queryLayer.removeEventListener(LayerEvent.LOAD_ERROR, queryLayer_loadErrorHandler);

  layerDetails = queryLayer.layerDetails;

  layerDetails.minScale = 0; // removing scale dependency

  layerDetails.maxScale = 0;

  }

  private function queryLayer_loadErrorHandler(event:LayerEvent):void

  {

  queryLayer.removeEventListener(LayerEvent.LOAD, queryLayer_loadHandler);

  queryLayer.removeEventListener(LayerEvent.LOAD_ERROR, queryLayer_loadErrorHandler);

  var errorMessage:String = getDefaultString("layerFailedToLoad",

  event.layer.name,

  ErrorMessageUtil.makeHTMLSafe(ErrorMessageUtil.buildFaultMessage(event.fault)));

  showError(errorMessage);

  }

  // Array for creating To date and from date from the prsent date so that they

  //can be compared with the dates in the database

  /*private function onClickFunction(event:MapMouseEvent):void

  {

  var tol:Number = 20;//((map.width) / (map.width ));

  trace(tol);

  trace(map.extent.width);

  trace( map.width * 5)

  var x:Number = event.mapPoint.x;

  var y:Number = event.mapPoint.y;

  trace(x);

  trace(y);

  var queryExtent:Extent = new Extent(x - tol, y - tol, x + tol, y + tol, event.mapPoint.spatialReference);

  var thisSelectionQuery:Query = new Query();

  trace(queryExtent);

  trace(event.mapPoint.spatialReference);

  trace(map.spatialReference);

  thisSelectionQuery.geometry = queryExtent;

  resultFeatureLayer.selectFeatures(thisSelectionQuery, FeatureLayer.SELECTION_NEW);

  }*/

    private function  DateArrayFunc():ArrayCollection

    {

    var DateFmt:DateFormatter = new DateFormatter;

    DateFmt.formatString ="YYYY-MM-DD";

    if (TimeOFExpire.selectedIndex==0)

    {

   

    FromDate = PresentDate;

    ToDate = new Date(PresentDate.fullYear,

    PresentDate.month + 1 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

   

    }

   

    else if(TimeOFExpire.selectedIndex==1)

    {

    FromDate = new Date(PresentDate.fullYear,

    PresentDate.month + 1 ,

    PresentDate.date + 1,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    ToDate = new Date(PresentDate.fullYear,

    PresentDate.month + 3 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

   

  

    }

    else if (TimeOFExpire.selectedIndex==2)

    {

    FromDate = new Date(PresentDate.fullYear,

    PresentDate.month + 3 ,

    PresentDate.date + 1,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    ToDate = new Date(PresentDate.fullYear,

    PresentDate.month + 6 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

   

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

   

   

   

  

    }

    else if(TimeOFExpire.selectedIndex==3)

    {

    FromDate = new Date(PresentDate.fullYear,

    PresentDate.month + 6 ,

    PresentDate.date + 1,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    ToDate = new Date(PresentDate.fullYear,

    PresentDate.month + 9 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

   

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

   

  

  

    }

    else if (TimeOFExpire.selectedIndex==4)

    {

    FromDate = new Date(PresentDate.fullYear,

    PresentDate.month + 9 ,

    PresentDate.date + 1,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    ToDate = new Date(PresentDate.fullYear,

    PresentDate.month + 12 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

   

  

  

    }

    else   (TimeOFExpire.selectedIndex==5)

    {

    FromDate = new Date(PresentDate.fullYear,

    PresentDate.month + 12 ,

    PresentDate.date + 1,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    ToDate = new Date(PresentDate.fullYear + 1000,

    PresentDate.month + 3 ,

    PresentDate.date,

    PresentDate.hours,

    PresentDate.minutes,

    PresentDate.seconds,

    PresentDate.milliseconds);

    FromDateString = DateFmt.format(FromDate);

    FromDateString = "date "+ "'"+FromDateString+"'";

    ToDateString = DateFmt.format(ToDate);

    ToDateString = "date "+ "'"+ToDateString+"'";

    trace (FromDateString);

    trace(ToDateString);

    DateArray = new ArrayCollection();

    DateArray.addItem(FromDateString);

    DateArray.addItem(ToDateString);

   

    return DateArray;

  

  

    }

  

   

    }

  private function TimeOFExpireSelection():void

  {

  if (TimeOFExpire.selectedIndex==5)

  {

  }

  }

  // start of Do Query function which will be executed once

  private function doQuery():void

  {

     mygraphicsLayer.clear();

  //  Query Url according to layer select 25 is for transformer , 17 for service point and 22 for support structure

  if (AssetsSelection.selectedIndex==0)

  {

  queryTask.url = "http://192.168.9.70:6080/arcgis/rest/services/Jasdan_Data/MapServer/25";

     }

  else if (AssetsSelection.selectedIndex==1)

  {

  queryTask.url = "http://192.168.9.70:6080/arcgis/rest/services/Jasdan_Data/MapServer/17";

  }

          else 

         {

          queryTask.url = "http://192.168.9.70:6080/arcgis/rest/services/Jasdan_Data/MapServer/22";

      }

  // Getting the final DateArray

         DateArrayCondition = DateArrayFunc();

  trace(DateArrayCondition.getItemAt(0));

  trace(DateArrayCondition.getItemAt(1));

  //WhereString =  '\"Date_Of_Expiry\" > '+ DateArrayCondition.getItemAt(0)+ ' AND \"Date_Of_Expiry\" <= '+ DateArrayCondition.getItemAt(1);

     if (SubStationSelection.selectedIndex==2)

  {

  WhereString =  "Date_Of_Expiry > "+ DateArrayCondition.getItemAt(0)+ " AND Date_Of_Expiry <= "+ DateArrayCondition.getItemAt(1) ;

  }

  else

  {

  WhereString =  "Date_Of_Expiry > "+ DateArrayCondition.getItemAt(0)+ " AND Date_Of_Expiry <= "+ DateArrayCondition.getItemAt(1) + ' AND RelElectricStationID = ' +"\'"+SubStationSelection.selectedItem +"\'";

  }

  trace (WhereString);

  query.where = WhereString;

  trace(query.where);

  //queryTask.execute(query, new AsyncResponder(onResult, onFault));

  queryLayer.queryFeatures(query, new AsyncResponder(onResult, onFault));

  function onResult(featureSet:FeatureSet, token:Object = null):void

  {

  if (featureSet.attributes.length ==0)

  {

  Alert.show("No Result of the Query");

  }

  else

  {

  //map.addLayer(resultFeatureLayer);

  var graphicCollection:Array = new Array();

  trace(featureSet.attributes.length);

  // check for if map extent is clicked or not

  trace(CurrentExtentDTR.selected);

  if(CurrentExtentDTR.selected)

  {

  RecordCount=0;

  for each (var myGraphic2:Graphic in featureSet.features)

  {

  var ExtentMap:Extent = map.extent;

  var check:Boolean =(ExtentMap.contains(MapPoint(myGraphic2.geometry)));

  trace(ExtentMap);

  trace (MapPoint(myGraphic2.geometry));

  if (ExtentMap.contains(MapPoint(myGraphic2.geometry)))

  {

  graphicCollection.push(myGraphic2);

  RecordCount =RecordCount+1;

  }

  }

  if (RecordCount ==0)

  {

  Alert.show("No Feature found in current extent");

  return;

  }

  if(RecordCount !=0)

  {

  mygraphicsLayer.graphicProvider =graphicCollection;

  mygraphicsLayer.clusterer =weightedClusterer;

  mygraphicsLayer.renderer = uniqueValuerenderer;

  }

  }

  else

  {

  RecordCount=0;

  for each (var myGraphic1:Graphic in featureSet.features)

  {

  graphicCollection.push(myGraphic1);

  RecordCount =RecordCount+1;

  }

  trace("Length of total count :", RecordCount);

  mygraphicsLayer.graphicProvider =graphicCollection;

  mygraphicsLayer.renderer = uniqueValuerenderer;

  mygraphicsLayer.clusterer =weightedClusterer;

  }

  map.addLayer(mygraphicsLayer);

  var featureSet:FeatureSet = new FeatureSet(graphicCollection);

  resultFeatureLayer.visible = true;

  resultFeatureLayer.featureCollection = new FeatureCollection(featureSet, layerDetails);

  trace(featureSet.features);

  var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features);

  trace(GraphicUtil.getGraphicsExtent(featureSet.features));

  if (graphicsExtent)

  {

  var width:Number = graphicsExtent.width*.3;

  var Height:Number = graphicsExtent.height*.3

  trace("Length"+ featureSet.features.length);

  trace("1"+ featureSet.features);

  trace (map.extent);

  trace(graphicsExtent);

  graphicsExtent.extent.ymax = graphicsExtent.ymax + Height;

  graphicsExtent.extent.ymin = graphicsExtent.ymin - Height;

  graphicsExtent.extent.xmax = graphicsExtent.xmax + width;

  graphicsExtent.extent.xmin = graphicsExtent.xmin - width;

  map.extent = graphicsExtent.extent

  trace(map.extent);

  }

  else

  {

  map.extent = map.initialExtent;

  trace("11");

  }

  trace(resultFeatureLayer.outFields)

  resultFeatureLayer.refresh();

  }

  }

    function onFault(info:Object, token:Object = null):void

  {

  trace("error");

    Alert.show(info.toString(), "Query Problem");

  }

  

  }

  protected function differenceBetweenDates(date1:Number, date2:Number):Number{

  var MS_PER_DAY:uint = 1000 * 60 * 60 * 24;

  var tempDate:Number = (date2 - date1);

  var difference:Number =

  Math.abs(Math.round((tempDate/ MS_PER_DAY)));

  return difference;

  }

  protected function Assets_openHandler(event:Event):void

  {

  if (mygraphicsLayer)

  {

  mygraphicsLayer.visible  =true;

  }

  }

  protected function Assets_closeHandler(event:Event):void

  {

  if (mygraphicsLayer)

  {

  mygraphicsLayer.clear();

  mygraphicsLayer.visible  = false;

  map.removeLayer(mygraphicsLayer);

  }

  }

  private function ClearGraphic():void

  {

  if (mygraphicsLayer)

  {

  mygraphicsLayer.clear();

  }

  }

  protected function ExportToCSV_clickHandler(event:MouseEvent):void

  {

  }

  ]]>

    </fx:Script>

  <fx:Script>

  <![CDATA[

  [Embed(source="/assets/images/br.png")]

  [Bindable]

  public var imgCls:Class;

  ]]>

  </fx:Script>

  <fx:Declarations>

  <!-- Layer with JASDAN DATA -->

  <esri:QueryTask id="queryTask"

  showBusyCursor="true"

  url="http://192.168.9.70:6080/arcgis/rest/services/Jasdan_Data/MapServer/25"

  useAMF="false"/>

  <esri:Query id="query"

  outSpatialReference="{map.spatialReference}"

  returnGeometry="true"

  >

  <esri:outFields>

  <fx:String>FacilityID</fx:String>

  <fx:String>Date_Of_Manufacture</fx:String>

  <fx:String>Date_Of_Expiry</fx:String>

  <fx:String>Revenue</fx:String>

  <fx:String>TimeOfExpire</fx:String>

  </esri:outFields>

  </esri:Query>

  <esri:SimpleMarkerSymbol id="Under1Month"

  style = "circle"

  alpha="0.7"

  color="#ff8000"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Under2Month"

  alpha="0.7"

  style = "circle"

  color="#8e1720"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Under3Month"

  alpha="0.7"

  style = "circle"

  color="#55ff00"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Under4Month"

  style = "circle"

  alpha="0.7"

  color="#52D017"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Under5Month"

  alpha="0.7"

  style = "circle"

  color="#FFA500"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Under6Month"

  alpha="0.7"

  style = "circle"

  color="#FF0000"

  size="18"/>

  <esri:SimpleMarkerSymbol id="Expired"

  alpha="0.7"

  style = "circle"

  color="#ff003f"

  size="12"/>

  <text:TextFormat id="tf"

  color="0xE6E6E6"

  font="Arial"

  size="14"/>

  <esri:FlareSymbol id="flareSymbol"

   backgroundAlphas="[0.7,1.0]"

   backgroundColor="0x394B8C"

   backgroundColors="[0x5B8C3E,0xBF2827]"

   borderColor="0x666666"

   flareMaxCount="30"

   flareSizeIncOnRollOver="3"

   sizes="[20,30]"

   textFormat="{tf}"

   weights="[30,60]"/>

  <esri:WeightedClusterer id="clusterer"

  sizeInPixels="22"

  symbol="{flareSymbol}"/>

  <esri:InfoSymbol id ="Assets_PIE_INFO" infoRenderer="widgets.Samples.AssetsLifeWidget.AssetsLifeWidgetRenderer" /> 

  </fx:Declarations>

    <viewer:WidgetTemplate id="DTR"

                           width="210" height="240" open="Assets_openHandler(event)" closed="Assets_closeHandler(event)">

        <viewer:layout>

            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>

        </viewer:layout>

  <s:VGroup left="5" right="5" top="5" bottom="5">

  <s:Label fontWeight="bold" text="Select the Substation"/>

  <s:DropDownList id="SubStationSelection"

  width="100%"

  requireSelection="true">

  <s:dataProvider>

  <s:ArrayList>

  <fx:String>PGJASES1</fx:String>

  <fx:String>PGJASES2</fx:String>

  <fx:String>All</fx:String>

  </s:ArrayList>

  </s:dataProvider>

  </s:DropDownList>

  <s:Label fontWeight="bold" text="Select the Assets Layer"/>

  <s:DropDownList id="AssetsSelection"

  width="100%"

  requireSelection="true">

  <s:dataProvider>

  <s:ArrayList>

  <fx:String>DTR</fx:String>

  <fx:String>Service Point</fx:String>

  <fx:String>SupportStructure</fx:String>

  </s:ArrayList>

  </s:dataProvider>

  </s:DropDownList>

  <s:Label fontWeight="bold" text="Select the Time Period "/>

  <s:DropDownList id="TimeOFExpire"

  width="100%"

  requireSelection="true">

  <s:dataProvider>

  <s:ArrayList>

  <fx:String>Under One Month</fx:String>

  <fx:String>1-3 Month</fx:String>

  <fx:String>3-6 Month</fx:String>

  <fx:String>6-9 Month</fx:String>

  <fx:String>9-12 Month</fx:String>

  <fx:String>Above 1 year</fx:String>

  </s:ArrayList>

  </s:dataProvider>

  </s:DropDownList>

  </s:VGroup>

  <s:HGroup left="5" right="5" top="5" bottom="5">

  <s:Button click="doQuery()" label="Submit"/>

  <s:Button click="ClearGraphic()" label="Clear"/>

  </s:HGroup>

  <s:HGroup>

  <s:CheckBox id ="CurrentExtentDTR" label ="Within Map Extent"/>

  </s:HGroup>

    </viewer:WidgetTemplate>

</viewer:BaseWidget>

All i want to show the featureset result into interactive datagrid.

Thanks a lot for your help!!

Thanks and regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

  Wow that is a pretty big request... Good thing you caught me in a really giving mood, normally this would be to much to ask.

As your data is not publicly available to test I just made what I assume would be the necessary changes, but was unable to test against your data.

saurabhgupta2
New Contributor II

Robert

I am really grateful to you for all your help so far . Just like to share one thing that when i started my flex development (3 months back) I have came across many of your great works but always wondered if i can build something near to it in future. I am still searching for those skills. Your help to the community especially to a new developers like me is beyond words. Now coming back to my earlier post i have posted it to seek your valuable guidance to make changes to esearch code so as to learn and develop as it was difficult for me to understand the flow of eseach code (due to my inexperience) or to create a simple floating grid and make it interactive.

As suggested by you i was able to use titlewindow in my code . Now I am focusing for passing the data from widget to that grid.

Once again I am highly grateful for all your help

Thanks and regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   Be sure to mark the correct answer and or appropriate replies as helpful.

0 Kudos