Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic menu using jquery with data from database

 
Yuva Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
<sj:accordionItem title="Configurations"></sj:accordionItem>
<sj:accordionItem title="Generate Rate Card"></sj:accordionItem>
</sj:accordion>

Thanks in advance

Yuva
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic