Select to view content in your preferred language

programatically activate a specific view within a Section widget?

372
1
10-07-2022 04:58 PM
john_cartwright_noaa
New Contributor III

Hello All,

Is there any way to activate a specific view within a Section widget either through the Section widget's properties or via the View Navigation widget?

I don't see the Section widget, any of the View widgets, nor the View Navigation widget listed in the state, e.g.

const appWidgets = getAppStore().getState().appConfig.widgets
widgetsArray = Object.values(appWidgets)
widgetsArray.forEach(w => {
  console.log(w.id, w.uri)
})

 

 

1 Reply
LeonAus
New Contributor III

I couldn't find a way to do it through ExB code either so I just simulated a click with

document.querySelectorAll('a[role="button"]').forEach((a: any) => a.innerText === "Map" && a.click());
Not the most elegant/robust solution but seems to work ok.
 
0 Kudos