Can attribute table results be limited to map extent by default?

6239
21
Jump to solution
02-05-2015 10:29 AM
MikeMartin
New Contributor III


I do not want all records of a layer's attribute table to be loaded into the attribute table. Can the config_Attribute Table.json be modified to limit results to the map extent by default, and only when the layer's scale range has been reached? Thanks.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Mike and Rebecca,

  There is not configuration option for this but it is a really simple one line code change if you are using the WAB Dev version.

client\stemapp\widgets\AttributeTable\widget.js line 185.

this.matchingMap = false;

change to:

this.matchingMap = true;

View solution in original post

21 Replies
RebeccaStrauch__GISP
MVP Esteemed Contributor

I have the same question....specifically in the WAB dev edition for me.  And using some of Robert Scheitlin, GISP‌ custom widgets.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mike and Rebecca,

  There is not configuration option for this but it is a really simple one line code change if you are using the WAB Dev version.

client\stemapp\widgets\AttributeTable\widget.js line 185.

this.matchingMap = false;

change to:

this.matchingMap = true;

RebeccaStrauch__GISP
MVP Esteemed Contributor

Robert, that worked great.

Note: Of course it does not transfer forward to existing apps, so if anyone else uses this, remember to also update your  \server\apps\<app#>\widgets\AttributeTable\widget.js

Interesting observation of odd behavior, even though it definitely works, the Options checkbox started off as unchecked.   Checking didn't seem to change anything the first time...but doing it a few times did.  So, the togle timing is a bit strange, but not an issue in my opinion, since I would rather have it always filtered.

EDITED:  Not totally strange behavior, its just the initial checkbox isn't checked.  After code modification, firing up the app and revieiwing attribute table:

- filter box unchecked, but table filtered  (minor graphical issue)

- manually check the box - table filtered, as expected

- manualy uncheck the box - table goes back to being unfiltered.

so, just a very minor checkbox thing.

I can't mark your answer as "correct", but hopefully Mike will after he's tested.

0 Kudos
MikeMartin
New Contributor III

That is beautiful! Thank you Robert.  Worked like a charm. I appreciate your help. Thanks also Rebecca.

0 Kudos
GeorgeKatsambas
Occasional Contributor III

In WAB 2.11 where is this option?

  1. this.matchingMap = false;  

change to:

  1. this.matchingMap = true;  
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

George,

   In more recent versions like 2.10 you do not need to make any code change this is an option in the widgets settings page.

GeorgeKatsambas
Occasional Contributor III

oops, i should have read the whole thread, thanks.

0 Kudos
NicholasBarger
Occasional Contributor III

You can also change the following line of code so that the box appears checked.

line 1963 this.matchingcheckbox=true

This will keep the functionality consistent... i.e. you won't have to check the box and uncheck the box to turn off the spatial filter

MichaelPotter1
New Contributor III

Does the Attribute Table widget limit the results when the layer's scale range has not been reached?

Regardless of whether I am using a Web Map or Local Layers, my Attribute Table displays all features in that extent, even if the layer is turned off and not yet at a visible scale range.

0 Kudos