Sorting in the Attribute Table WAB widget

662
2
Jump to solution
11-01-2017 01:07 PM
Clint_Glover
New Contributor III

When using the Attribute Table widget (version 2.5), I can click on a field and sort ascending/descending on that field, but when I click the Refresh button to refresh the table my sort is cleared and the table is reset back to it's normal state.  Does anyone know of a way to prevent the sort from being cleared when the table is refreshed?  I'm not sure if this is just the way ESRI intended on it to work or if there are any options. I am currently using the Attribute Table widget for Web AppBuilder version 2.5.

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Clint,

   I believe it is intended behavior at this time, but there is an easy fix if you are using WAB Dev.

  In the AttributeTable\table\_FeatureTable.js find the createTable function and comment out.

(in WAB 2.5 it is lines 1814 - 1816):

      // if (this.layer.objectIdField) {
      //   this.grid.set('sort', this.layer.objectIdField, false);
      // }

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Clint,

   I believe it is intended behavior at this time, but there is an easy fix if you are using WAB Dev.

  In the AttributeTable\table\_FeatureTable.js find the createTable function and comment out.

(in WAB 2.5 it is lines 1814 - 1816):

      // if (this.layer.objectIdField) {
      //   this.grid.set('sort', this.layer.objectIdField, false);
      // }

View solution in original post

0 Kudos
Clint_Glover
New Contributor III

Yes I am indeed using the WAB Developer Edition.  I commented out the code and it appears to be working.  Thank you for the assistance.

0 Kudos