How to automatically choose the active table in the attribute table widget?

218
2
Jump to solution
03-02-2018 01:18 AM
LucileGimenez
New Contributor

Hello, 

I do a custom widget in WebAppBuilder and I would like to open automatically the attribute table widget to see a specific layer.  

I'm able to open the attribute table widget but the issue is that I can't choose which table is visible in the widget.

For example, I would like to open the attribute table widget with "landuse_91" and not "roads" (which is visible by default). I find in the widget the object "_activeTable" which contains infos about "roads" but I don't know how to change it and refresh the attribute table widget to see "landuse_91". 

Thanks a lot

Regards

 

Lucile

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Lucile,

   This is how I do it:

        //Where this.attWidget is a var that equals the AT Widget
        //open TrafficCams in AT widget
        this.wManager.openWidget(this.attWidget);
        this.attWidget._openTable().then(lang.hitch(this, function(){
          var page = this.attWidget.getExistLayerTabPage('LOJIC_PublicSafety_Louisville_7908_2');
          this.attWidget.tabContainer.selectChild(page);
        }));

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Lucile,

   This is how I do it:

        //Where this.attWidget is a var that equals the AT Widget
        //open TrafficCams in AT widget
        this.wManager.openWidget(this.attWidget);
        this.attWidget._openTable().then(lang.hitch(this, function(){
          var page = this.attWidget.getExistLayerTabPage('LOJIC_PublicSafety_Louisville_7908_2');
          this.attWidget.tabContainer.selectChild(page);
        }));

View solution in original post

LucileGimenez
New Contributor

Thank you Robert, it works  

0 Kudos