Select to view content in your preferred language

Multiple find tasks populating multiple datagrids

1132
7
06-12-2014 01:35 PM
RyanSellman
Deactivated User
I am wondering if it is possible to have multiple datagrids in an application, each consuming attribute data from its own findtask result.  So for example, in my app, it would be cool to have an Accordion Container, with multiple Content Panes, with each pane holding a single search box tied to its own dgrid.  When the user performs that particular search, results are shown its own datagrid below it.

I have spent some time looking, but I haven't seen any samples on the API site or any references to this in the forums.  I have made some attempts at getting this to work but the various searches always feed one datagrid, even if the results are assigned to another. 
Has anyone else tried to create this type of functionality in an app?

Thanks!
0 Kudos
7 Replies
KyleMorgan
Deactivated User
This shouldn't be too much of an issue as long as you isolate your FindTask results.  By putting them into separate calls, you should be able to use event listeners and handle populating each dgrid based on the tasks returned.
0 Kudos
OwenEarley
Frequent Contributor
This is possible - just use multiple datagrids with unique ids and assign data to them from the results of your find tasks.

I created a quick example based on some other ESRI samples here: http://jsbin.com/bacuwova

If you are hitting multiple map services then you will need to modify this pattern to use a more than one find task.

Owen
www.spatialxp.com.au
0 Kudos
KenBuja
MVP Esteemed Contributor
Here are a couple of examples of multiple dGrids (the newer version that you should eventually transition to) in various containers.

Missouri Legislative Analysis - using FindTask
Long Island Sound Data Viewer - using IdentifyTask
0 Kudos
PeggyCorey
Emerging Contributor

Ken,

Could you be kind enough to supply the URL's for these sites, since the links no longer work on this site?  I'd appreciate it, as I'm currently working on incorporating the FindTask and datagrid into my map.

Thanks so much!

0 Kudos
KenBuja
MVP Esteemed Contributor

Hi Peggy,

I've added the links back into the post.

Ken

0 Kudos
RyanSellman
Deactivated User
These are excellent!  Thank you all for the responses - they are exactly what I was looking for.  I hope to build something similar very soon!

Best,

Ryan
0 Kudos
TracySchloss
Honored Contributor

The Missouri Legislative Analysis example uses QueryTask, not FindTask, because its based on a polygon as input to the Query.  It should still show how to manage multiple tasks as well as a corresponding grid for each.