File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Dynamic menu using jquery with data from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic menu using jquery with data from database" Watch "Dynamic menu using jquery with data from database" New topic

Dynamic menu using jquery with data from database

Yuva Kumar

Joined: Jul 18, 2008
Posts: 12
Hi All

I have a static accordion menu displayed currently using the struts-jquery. Now, I need to fetch list of menus / submenu items from the database and display to the logged in user, based on their roles. How can I achieve this. Is there any solution in jquery/json/ajax. Can someone please help me with an example.

My static menu :

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<sj:accordion id="accordion" collapsible="true" autoHeight="false">
<sj:accordionItem title="Master Maintenance" cssStyle="color: red;">
<s:a href="duration-form" style="text-decoration: none">Duration Master</s:a></br>
<s:a href="grade-form" style="text-decoration: none">Grade Master</s:a></br>
<s:a href="technology-form" style="text-decoration: none">Technology Master</s:a></br>
<s:a href="currency-form" style="text-decoration: none">Currency Master</s:a></br>
<s:a href="customer-form" style="text-decoration: none">Customer Master</s:a></br>
<s:a href="customer-form" style="text-decoration: none">Project Master</s:a></br>
<s:a href="customer-form" style="text-decoration: none">Hourly Rate Master</s:a></br>
<sj:accordionItem title="Configurations"></sj:accordionItem>
<sj:accordionItem title="Generate Rate Card"></sj:accordionItem>

Thanks in advance

I agree. Here's the link:
subject: Dynamic menu using jquery with data from database
jQuery in Action, 3rd edition