Select to view content in your preferred language

Query Result to DataGrid

4348
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
1 Solution

Accepted Solutions
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.

View solution in original post

13 Replies
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   You should look at using the eSearch widget as this will accomplish your query and display your results in a floating datagrid.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

0 Kudos
saurabhgupta2
New Contributor II

Robert,

I have looked to the widget earlier and tried to figure out about how you have done that . But i was not able to strike the precise point where to get it started. More over i would like to have data displayed in tabular form ( as in attribute table ).

Thanks and Regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   OK so you have me confused then as if you click on the link I provided it will take you to the download and live preview site for the eSearch widget that uses either a Fixed Data Grid (as shown in the Live Preview site) or a floating datagrid (something that can be configured in the widgets xml configuration file). Based on what you are asking for here I know the eSearch will accomplish your requested features. There is a pretty detailed PDF documentation  in the download and an eSearchWidget.xml that has a lot of example configurations.

0 Kudos
saurabhgupta2
New Contributor II

Robert

Sorry for making a statement so confusing . I have downloaded that widget way back and looked into the contents I could see that you have used two mxml one is SearchWidgetFixedDG.mxml for fixed Datagrid and SearchWidgetFloatDG.mxml for floating data grid. Now my question is that how to make use of that Fixed data Grid for representing the query result so that it become invisible as soon as I close the query widget.

Where do I have to Make these changes and How to pass query result to this .

Thanks and regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   The fixed datagrid is designed to work with the eSearch widget. Getting it to work with another widget like the query widget would take an experienced programmer.

0 Kudos
saurabhgupta2
New Contributor II

Robert

Can you just guide me how to add a floating datagrid into my flexviewer

Thanks and regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   Are you asking how to configure the eSearch Widget to use the floating datagrid?

0 Kudos
saurabhgupta2
New Contributor II

Robert

What I am trying to do is that I have my query result in featureset and i can populate datagrid with this featureset. What I am trying to ask how to open up a separate floating datagrid ( which is not a part of my query widget UI) in my Application.

Do i have to make a new mxml for datagrid and pass the featureset to it  ? Please forgive me If i am still not able to put my point clearly.

Regards

Saurabh

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   Ok, now I understand that you are wanting to develop your own widget and not use something where all the development work is done for you already.

So if you look at my code in the eSearch widget the SearchWidgetFloatDG.mxml uses a custom ResizeTtitleWindow.as which extends a standard TitleWindow component to give it the ability to be resized by the user at runtime. The SearchWidgetFloatDG.mxml has all kinds of code for different abilities that I have given the datagrid over the years but it is basically a spark DataGrid component. to populate a datagrid with data from a query you just pass the features attributes as an array collection to the Data Grids datasource.

gridDataProvider = qFeatSet.attributes;

You can look at my code as an example of sending query results to a datagrid or use this esri sample: Query result in table—ArcGIS API for Flex | ArcGIS for Developers