JProgress Plugin
Dependency :
compile ":jprogress:0.2"
Summary
Installation
grails install-plugin jprogress
Description
This plugin was developed to simplify the use of JQuery, Grails and Progressbars.Basically we provide 2 Tags to include a simple progress bar into your gsp.First add the jquery and jquery-UI resources:Then for a simple embedded progressbar which listens to a button/link click event you need to first define your button or other event sourceand than just include the tag with an unique id and the name of the triggerthis will now include your progress bar into your page.To update the progress bar you need to get a reference to the included service and set a value for the progress id and the percentage value.
this was all. Simple isn't it?if you like to have a modal dialog instead, you just need to useeverything else is identical.If you like to render the progress bar in a specific div, you can define this with the attribute 'progressTarget'. You can also provide a short message with the 'message' parameter.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sample title</title>
<g:javascript library="jquery" plugin="jquery"/>
<jqui:resources/>
</head>
. . .<g:form>
<g:submitToRemote action="executeAction" name="progressButton" value="start...."/>
</g:form><g:jprogress progressId="123" trigger="progressButton"/>
class JProgressTesterController { def progressService def executeAction = { for (int i = 1; i <= 100; i++) { //this updates the progress bar value for the progress id 123
progressService.setProgressBarValue("123", i) //let's waste some time
for (int a = 0; a < 10000; a++) { for (int b = 0; b < 1000; b++) { }
}
} render "the progress is done"
}
}<g:jprogressDialog progressId="123" trigger="progressButton"/>