To enable the Grails AJAX spinner you must include the Prototype or script.acolo.us JavaScript typically using the
If you are using the default layout found in main.gsp, you can declare the Prototype or script.acolo.us inclusions in one of two places. You can either make the declarations in the header section of an individual view such as in this example:
Or in the header section of the main.gsp prior to the application declaration such as in this example.
<head>
<title>Make and Model</title>
<meta equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="layout" content="main">
<g:javascript library="scriptaculous"/>
</head>
If you are not using the standard layout just make sure you put the Prototype or script.acolo.us tag prior to the application tag and include the following or similar div tag found in the default layout.
<head>
<title><g:layoutTitle default="Grails" /></title>
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'main.css')}" />
<link rel="shortcut icon" href="${createLinkTo(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
<g:layoutHead />
<g:javascript library="scriptaculous" />
<g:javascript library="application" />
</head>
<div id="spinner" class="spinner" style="display:none;">
<img src="${createLinkTo(dir:'images',file:'spinner.gif')}" alt="Spinner" />
</div>
No comments:
Post a Comment