Gilberto,
I don't use the GP widget but here is some code fro closing all the tabs on the AT widget:
define([
...
'jimu/WidgetManager',
...
function (
...
WidgetManager,
...
) {
this.wManager = WidgetManager.getInstance();
...
if (this.wManager) {
var widgetCfg = this._getWidgetConfig('AttributeTable');
if(widgetCfg){
var attWidget = this.wManager.getWidgetByLabel(widgetCfg.label);
if(attWidget){
for(var t = attWidget.layerTabPages.length - 1; t >= 0; t--){
attWidget.layerTabPageClose(attWidget.layerTabPages[t].paneId, true);
}
}
}
}
_getWidgetConfig: function(widgetName){
var widgetCnfg = null;
array.some(this.wManager.appConfig.widgetPool.widgets, function(aWidget) {
if(aWidget.name == widgetName) {
widgetCnfg = aWidget;
return true;
}
return false;
});
if(!widgetCnfg){
array.some(this.wManager.appConfig.widgetOnScreen.widgets, function(aWidget) {
if(aWidget.name == widgetName) {
widgetCnfg = aWidget;
return true;
}
return false;
});
}
return widgetCnfg;
},