Select to view content in your preferred language

How to use a widget to activate the tabs of a grid widget

173
1
a month ago
Labels (1)
PLadd
by
Frequent Contributor

As @JeffreyThompson2 has pointed out here , API documentation for Experience Builder Developer edition is lacking so I'm lost.

Has anyone been able to reference the tabs in a grid widget?  I'm able to reference the grid widget itself but debugger doesn't reveal any properties of the grid widget that indicate tabs exist.

My ultimate goal is to activate one of two tabs based on the feature selected (point or polygon) but right now just being able to find and activate one of the tabs by hacking the sample control-the-widget-state widget is a start.

0 Kudos
1 Reply
PLadd
by
Frequent Contributor

Here is some additional information. 

This code finds the grid widget and identifies the 2 embed widgets in the grid widget.  But the tabs are what I'm after.

// if we have a grid widget, find the widgets within via layouts
const gridWidgets = widgetsArray.filter(w => w.uri === 'widgets/layout/grid/')
if (gridWidgets.length === 0) return
const gridWidget = gridWidgets[0]
const gridWidgetLayout = gridWidget?.layouts?.DEFAULT?.LARGE
if (!gridWidgetLayout || gridWidgetLayout.length === 0) return
const widgetsInGridWidget = widgetsArray.filter(w => w.parent?.LARGE && w.parent?.LARGE.length > 0 && w.parent?.LARGE[0].layoutId === gridWidgetLayout)
setGridWidgetsArray(widgetsInGridWidget)

Here are the 2 embed widget tabs in the grid widget:

PLadd_1-1726244258308.png

 

 

 

0 Kudos