题
我建立使用Grails web应用。我决定使用Dojo和我加了一个道场鱼眼菜单在main.gsp begining所以这将是适用于所有应用程序的页面。 它工作正常的(家庭)index.gsp中页,但一旦我选择另外一个,鱼眼菜单在前看不见。如果我回到家里它的存在。我修改我的设置,一切看起来OK我。我没有使用任何幻想,只是简单的事情。我失去了一些东西,但没能找到答案。
这里是为了清楚而简化在我main.gsp的代码:
<html>
<head>
...
<g:layoutHead />
<!-- use dojo library ... this has not effect at all -->
<g:javascript library="dojotk"/>
<!-- Load Dojo -->
<script type="text/javascript" src="js/dojotk/dojo/dojo.js"
djConfig="parseOnLoad:true, isDebug:false"></script>
<!-- need fisheye -->
<g:javascript type="text/javascript">
dojo.require("dojox.widget.FisheyeList");
</g:javascript>
<!-- required css for dojo fisheye -->
<style type="text/css">@import "js/dojotk/dojox/widget/FisheyeList/FisheyeList.css";</style>
</head>
<body >
...
<!-- fisheye bar -->
<div id="fisheyebar"><g:render template="/common/fisheyebar"/></div>
<g:layoutBody />
</body>
这里是_fisheyebar.gsp
<g:javascript>
function load_app(target){
window.location.href=target
}
</g:javascript>
<center >
<div class="outerbar">
<div dojoType="dojox.widget.FisheyeList"
itemWidth="50" itemHeight="50"
itemMaxWidth="200" itemMaxHeight="200"
orientation="horizontal"
effectUnits="2"
itemPadding="10"
attachEdge="top"
labelEdge="bottom"
>
<div dojoType="dojox.widget.FisheyeListItem"
onClick= "load_app('${createLinkTo(dir:'/something')}');"
iconsrc="images/icon_something.png" caption="Web Browser">
</div>
.....
</div>
</div> <!-- outbar -->
</center>
所有页面包括index.gsp中有以下内容:
<head>
<title>some titel</title>
<meta name="layout" content="main" />
</head>
请不是模板(_fisheyebar)的使用不是原因,我直接把代码在主并具有相同的效果。所以我错过了什么?
解决方案
它是在相对URL道场的位置。它是相对于根所以这就是为什么该指数的作品,而不是其他的页面。
使用绝对网址解决该问题。
其他提示
你有没有尝试在道场申报进口移动到您的布局模板页,而不是把它在你的main.gsp的?
不隶属于 StackOverflow