Picture of Fernando 6750
Registered 1 year 311 days
Fernando 6750 Monday, 31 July 2023, 09:36 AM
config howto
Hi,

I'm starting to learn how to develop myapps apps.

I have been able to install the development environtment and code my first javascript app.

Now I would like to try to code a config option which would be a per user config. But I have not been able to figure out how to do it.

Not the client side, are there already libraries to add a burger menu? Nor the server side to store the value per user.

Where can I find documentation and example if available?

Regards,
Fernando
Picture of Elias Lievens (innovaphone)
Moderator Registered 4 years 95 days
Elias Lievens (innovaphone) Monday, 31 July 2023, 04:29 PM
Re: config howto
Hello Fernando,

About the question to add a Burger Menu: you can use the 'setMenuState(state)'-method from the start-object icw the 'onmenustatechanged'-event.

More info: https://sdk.innovaphone.com/13r3/web1/lib1/lib1.htm
  • The start-object -> Methods -> setMenuState(state)
  • The start-object -> Event -> onmenustatechanged
Example-code can be found at the bottom of this page:
start.setMenuState("closed"); 
start.onmenustatechanged.attach(function (sender, value) { 
 if (value == "open") { 
 // show menu 
 } else { 
 // hide menu 
 } 
});
Picture of Fernando 6750
Registered 1 year 311 days
Fernando 6750 Monday, 31 July 2023, 07:45 PM
Re: config howto
Hi,

I'm a step further.

But without a more detailed example I'm not able to do anything but showing the burger button but no buger menu.

Is there a predefined way to add ui1 items to that burger menu so when it pops up on the right it blurs out the rest of the interface behind? Or is it maybe a popup aligned to the right?

And once I have the client side. I will not know how to save per user config. Is there an API that should be used for that?

Thanks. Regards.
Picture of Elias Lievens (innovaphone)
Moderator Registered 4 years 95 days
Elias Lievens (innovaphone) Wednesday, 2 August 2023, 02:12 PM
Re: config howto
Hello Fernando,

The appMenu I created is indeed a popup. In fact a div which is hidden or shown via CSS. Depending on the value ('open' or 'closed'), I assign another className:
start.setMenuState("closed"); 
start.onmenustatechanged.attach(function (sender, value) { 
 var appMenuContainer = document.getElementById('appMenuContainer'); 
 if (value == "open") { 
 console.log("Top Menu Open"); 
 appMenuContainer.className = "open"; 
 } 
 else { 
 console.log("Top Menu Close"); 
 appMenuContainer.className = "closed"; 
 } 
}); 
CSS:
#appMenuContainer { 
 height: 100%; 
 width: 300px; 
 right: 0px; 
 background-color: var(--bg-appSettingsMenu); 
 position: absolute; 
 z-index: 1; 
 border-left: 
 1px solid var(--separator); 
} 
 #appMenuContainer.open { 
 visibility: visible; 
 } 
 #appMenuContainer.closed { 
 visibility: hidden; 
 }

But this is just how I implemented it. Maybe there are better ways...
Making the background flou/blurred is also done via CSS...

Kind Regards,
Elias
← You can define your color theme preference here