I've been fighting this problem here recently and hoping someone has a good workaround:
1) When I configure the attribute table widget from within WAB Dev 2.10 or 2.11, the order of layers will NOT match the order in the Portal web map.
2) After saving my edits (which layers I want visible in attribute table), the config .json file will be scrambled. The "name" and "id" keys will match the order of layers in the Portal web map; however, everything within all the other keys for that layer will match the order and configurations that I set in the WAB UI.
3) The result is an attribute table that will not load attributes. If I manually fix the mis-matches (give the proper "name" and "id" keys), then it will work.
4) If I go back into WAB and try to reconfigure in WAB's UI again, it either won't load at all (2.10) or the layers will be in the proper web map order now (2.11) but upon reconfiguring and saving, I find that the .json is still scrambled.
I thought it might be some kind of problem with adjustments made to an existing Portal web map, so I tried everything from scratch (new Portal web map, new WAB app) and got the same results.
Anyone else experience this issue?
P.S. While I'm at it - why is the default "sort" column for so many of my layers the "SHAPE" field? SQL can't do this unless you convert to string... this shouldn't even be an option, right? How are these defaults selected? Sometimes it picks a data column but most of the time it chooses OBJECTID or SHAPE. Perhaps it's number ordered when the file is first built and the problem is related to the layer scrambling?
Found my own workaround:
Remove the Attribute Table widget and re-add it. UI order is now correct and the orders of layers in the .json match up as well.
Simple fix, but it's very odd that the underlying script used to build the config .json works properly with a "reloaded" attribute table widget, but doesn't work during the first-time configuration of the widget in a brand-new app.
I have also had troubles with this, starting in WAB for Developers 2.10. I created an idea at community.esri.com/ideas in hopes that Esri might fix this problem: https://email@example.com/ideas/16655-fix-the-attribute-table-for-wab-developers-edition-210-onwar...
I am still regularly experiencing scrambled references in the attribute table configs. I have noted that in particular, tables and portal items created for an outside services that requires credits, tend to confuse the attribute table config. I have now gotten into the practice of deleting all layer references except those I want to show up by default in the attribute table config after creating the app, since almost every time now I experience errors with the attribute table config file.