Add calculated value to eSearch data grid

3851
4
Jump to solution
02-10-2015 06:55 AM
JaneCopeland
New Contributor

I'm using the eSearch widget to allow a user to select a set of polygons. The widget then calculates a value based on the attributes from those polygons. I want the attributes and the calculated value to show up in the floating data grid. I can get the attributes and the column header for the calculated value to show up but not the calculated value. Has anyone accomplished this?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Jane,

   I have not actually do this but here is how I would approach this myself. Use ObjectUtil.toString to print out the structure of gridDataProvider and then you will know the structure of what you will be adding to gridDataProvider.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Jane,

   The calculated value would have to be added as an attribute of the result before the data was sent to the datagrid unless you also do the calculation there too.

0 Kudos
JaneCopeland
New Contributor

Robert - thanks for your quick reply. I had tried adding it to the search result then using a set in the SearchWidgetFloatDG file. Since the dProvider function takes the attributes from the featureset in searchwidget.mxml I can't figure out how to add it to the grid provider in the dProvider function. Should I just be able to push the name:value pair for my attribute to the _data array?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jane,

   I have not actually do this but here is how I would approach this myself. Use ObjectUtil.toString to print out the structure of gridDataProvider and then you will know the structure of what you will be adding to gridDataProvider.

0 Kudos
JaneCopeland
New Contributor

Robert - checking the structure of the gridDataProvider showed me that I wasn't going to be able to add this attribute by using the featureset attributes. I changed the gridDataProvider to use the graphicsLayer attributes instead. Now the new attribute shows up in the table.

Thanks for your help.

Jane

0 Kudos