Refresh attribute table programmatically from a widget?

1293
4
Jump to solution
10-19-2018 01:10 PM
by Anonymous User
Not applicable

Hi all,

I have a custom widget that can add featurelayer created from featurecollection to the map and I use publishData to send this layer to attribute table widget. This way the attribute table will be opened automatically. The problem I had right now is when new features are added to this feature layer (also from that custom widget), the attribute table can not be updated unless I click on that refresh button. Is there any way I can avoid this one click and get it refreshed every time I add new features to that layer? 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Yiran,

   This is how I do it in my eSearch widget:

this.attWidget._activeTable.refresh();

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Yiran,

   This is how I do it in my eSearch widget:

this.attWidget._activeTable.refresh();
0 Kudos
by Anonymous User
Not applicable

Thank you so much Robert that's exactly what I need and it works perfect! I really appreciate your quick reply.

I have another question related to attribute table widget. when I try to close the attribute table just like clicking on that triangle tab, I did this:

WidgetManager.getInstance().closeWidget(attWidget);

It removes the attribute table completely from the application and leaves a blank next time when I try to open it. Do you happen to know why and what is the correct way to turn off attribute table in JS code like clicking the triangle? Thanks in advance!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

this.attWidget._closeTable();

0 Kudos
by Anonymous User
Not applicable

Thank you Robert. It works! I guess I should read more esri source code of the widget.

0 Kudos