judulnya rada aneh, cz susah mencari judul :D
Bismillah
Melanjutkan tulisan :
https://saifiahmada.wordpress.com/2014/12/12/bootstrap-table/
1. tambahkan attribute pada file general.xml
2. edit file classic.jsp
3. test hasil
q> - - - mulai - - -
1. tambahkan attribute pada file general.xml
[sourcecode language="xml"]<put-attribute name="current" value="index" />[/sourcecode]
pada definition index (menu home), dan
[sourcecode language="xml"]<put-attribute name="current" value="barang" />[/sourcecode]
pada definition barang (menu barang)
2. edit file classic.jsp
tambahkan script ini :
[sourcecode language="xml"]
<%@ taglib uri="http://tiles.apache.org/tags-tiles-extras"
prefix="tilex"%>
<tilex:useAttribute name="current" />
[/sourcecode]
dan edit tag li, seperti ini :
[sourcecode language="xml"]<li class="${current == 'index' ? 'active' : '' }"><a href="<spring:url value="/" />">Home</a></li>
<li class="${current == 'barang' ? 'active' : '' }"><a href="<spring:url value="/barang/list.html" />">Barang</a></li>
<li class="${current == 'contact' ? 'active' : '' }"><a href="#">Contact</a></li>
[/sourcecode]
3. test hasil

ketika menu Home di-klik maka menu tersebut akan aktif,

begitu juga klo menu barang di-klik maka menu tersebut akan aktif.
Alhamdulillah
No comments:
Post a Comment