Mobideck / appdeck

AppDeck is a mobile hybrid application engine for iOS and Android.
http://www.appdeck.mobi/
47 stars 22 forks source link

Loading Menu URL via Javascript? #24

Closed prodikl closed 8 years ago

prodikl commented 8 years ago

Hi there!

Thank you for appdeck; it's been a pleasure to use so far! I just had a use case that I couldn't find in the API's. Certain pages in our site/app would have different left and right menus, so I wanted to know if there's an API call I can use to push a new URL to each menu?

I've been tinkering and tried this but it didn't work: appDeckAPICall("slidemenu", {command: "load", url: "http://www.google.com"});

Is there more documentation about the options we have using appDeckAPICall?

Thanks again for the great work!

mdekermadec commented 8 years ago

First aim of AppDeck is a perfect user experience as close as possible as a native app.

So far we manage to do this without putting too many rules or limitation on the developper side ... except one: menu must is cached and HTML is embed in application at compilation time.

Why ?

Because an application MUST ALWAYS be up and running, even if your server is down, network is down or slow, or in case of partially downloaded file.

So we force menu to be cached and embed an compilation time.

This way even if when user launch your application for the first time network is down, your application is up.

For dynamic menu needs, work around is to make ajax query to refresh part of it on demand or even use message API from on page to another to ask for update.

So far this way we cover most use case.

Could you tell me more about your need ?

htwmehdi commented 8 years ago

Hello,

Any quick howto to load the menu from external url?

mdekermadec commented 8 years ago

Sure:

I make a doc for you:

http://www.appdeck.mobi/doc/advanced_dynamic_menu

htwmehdi commented 8 years ago

@mdekermadec Appreciated!