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.
Solved! Go to Solution.
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);
// }
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);
// }
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.