react sidebar: activate tab by JavaScript function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

react sidebar: activate tab by JavaScript function

Matze
react layout 0.13.x, sidebar template:

Can the tabs be selected and activated manually with a JavaScript function?
Is there already a function available? Like
viewer.sidebar.setActiveTab('taskPaneTab');

Example:
The legendtab is activated. Then selecting an object on the map
automatically activates the tasktab by calling a function inside the
registered selectionhandler



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: react sidebar: activate tab by JavaScript function

Jackie Ng
dispatch the Fusion/SET_ELEMENT_STATE redux action with your desired
visibility like so.

viewer.dispatch({
    type: "Fusion/SET_ELEMENT_STATE",
    payload: {
        legendVisible: false,
        selectionPanelVisible: false,
        taskPaneVisible: true
    }
});

The dispatched action will flow state changes back into the sidebar template
which will know to show the Task Pane and hide the others.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users