Welcome Guest, Not a member yet? Register   Sign In
Static menu driven applications?
#1

[eluser]javaprog[/eluser]
Would like to know if it would be possible to have a static menu at the top of a page, and each menu item, when clicked, would load the appropiate application in a div just under the static menu. This way I could load entirely different applications inside of a div by just clicking on a menu item.

Is this possible?
#2

[eluser]Otemu[/eluser]
Hi,

Yes this is possible, when an item is clicked in the menu, you can make an Ajax request which will basically load the appropriate application/module.

The most simple method is to use JQuery Ajax load method http://api.jquery.com/load/


#3

[eluser]javaprog[/eluser]
That sounds good, but how would I load a different application using jQuery. I am very familiar with jQuery, but just unsure how to pass a different application folder to it to load in a div? Any further help or hints here would be much appreciated. Thanks...
#4

[eluser]Otemu[/eluser]
Hi,

Can you define the scope of your applications??

Are we talking applications running in the same single instance of codeigniter, or you have separate applications each contained in different instances of codeigniter ?
Are you talking about applications that loaded from different frameworks and enviroments (flash, java, zend, cake, native php, c# etc)?
How are the applications loaded if you was to access them directly, would you simple use a url? and are there all on the same domain?
Are we talking purely web based applications??
#5

[eluser]javaprog[/eluser]
I would prefer to have differently named application folders that run in one instance of codeigniter. I would like to have a menu that is always visible in a div in a web app, and when a user clicks on a different menu item, it loads the corresponding application associated with the menu item, in the main div. And this repeats each time a menu item is clicked.

I guess I could use sub domains to do this action.
#6

[eluser]Ed Robindon[/eluser]
Most menus I have used use anchor <a> tags and the href is where to go so couldn't you use that to jump to another page?

I am using the Brainjar menu and it is totally links. I have it used in a CI app with no problems...

Ed
#7

[eluser]Otemu[/eluser]
Hi,

If your application and all functionality is inline(self contained), then all your need to do is call the url/controller and load the contents of the application into the div. If functionality isn't all inline then most likely your have to load the application into an iframe.

I have setup a quick example for you here using an iframe http://jsfiddle.net/otemu/cPBML/4/ your notice it loads different calculator widgets depending on the menu item clicked.

Here is an example that someone else did showing how to load content using ajax
http://jsfiddle.net/bozdoz/uZ5XS/
Notice how it loads the content from http://fiddle.jshell.net/bozdoz/2XgVd/show/
Like I said above though, if you do load content like this, your need to make it self contained

Hope that helps





Theme © iAndrew 2016 - Forum software by © MyBB