Select to view content in your preferred language

Programmiticaly navigate between pages within a web app

632
1
10-04-2022 05:45 AM
arahman_mdmajid
Frequent Contributor

I have added two pages in my WebApp, I am able to navigate between pages using menu widget provided by ExB, We can close and open widgets as shown in below code

let closeAction = appActions.closeWidget("widget_19");
getAppStore().dispatch(closeAction); 

I want to navigate between pages programmatically, is this possible? if yes, please help me with code sample

@TonghuiMing , @DanJiang , @ShengdiZhang 

Abdur Rahman
GIS Developer
Tags (1)
1 Reply
UalasRohrer
Regular Contributor

@arahman_mdmajid  You can use client-side javascript to navigate through the pages. Might not be the most elegant, but it works. I did the following for my widget to toggle the sidebar:

 

var sidebar = document.getElementsByClassName('jimu-btn sidebar-controller d-flex justify-content-center align-items-center app-root-emotion-cache-ltr-1kgaagp btn btn-default');
sidebar[0].click();

 

 

0 Kudos