Select to view content in your preferred language

Attribute Table

875
3
09-21-2013 08:45 PM
TateM
by
Occasional Contributor
Hello all,

I am a newbie here and trying to get into development with JavaScript API, and I have a question to ask you guys.  In the ArcGIS viewer for Flex, there is an "attribute table" function/tool that comes with default with it and is displaying at the bottom of the webmap.  I guess my question is that is there a similar "attribute table" function/tool in ArcGIS JavaScript API?  If there is please point me into the right direction.  Much appreciated, thanks!
0 Kudos
3 Replies
JasonZou
Frequent Contributor
Welcome on board:)

Unfortunately, there is no such attribute table dijit you can use directly using Javascript API. And personally I think since the requirement for an attribute table can be wildly different from project to project, as a software vendor, it's almost impossible for ESRI to develop a generic one that will meet every users' need.

However, it's not hard to develop one on your own using various javascript libraries. If using dojo, I'd recommend to use dgrid which is very powerful and perform well. Here is a sample.
0 Kudos
TateM
by
Occasional Contributor
Thanks Jason,

However when you have multiple layers/feature class that you want to displayed. You would have to coded in how you would want the field/columns to look like for each of the layer/feature class?  That seems a bit much, when compares to the Flex Viewer where you can just choose the layer/feature class that you want to displayed and how the field/columns would look.
0 Kudos
KenBuja
MVP Esteemed Contributor
Tate,

Take a look at the Fiddle I created that shows different layers in "attribute tables". It puts the results of an IdentifyTask on each layer that have different fields into a dgrid on separate tabs. None of the fields are hard coded, since is designed to work the same way with different map services.

The only issue with this Fiddle is that it doesn't render the tab correctly, but it works properly in my final application.
0 Kudos