Grails Javascript Converter.

  • Authors : null
0 vote
Dependency :
compile ":javascript-converter:0.2"

Documentation

Summary

Installation

grails install-plugin javascript-converter

Description

Download manual and demo application from project home page

The plugin uses groovy syntax to generate javascript code in Grails controllers in response to AJAX requests.

//Put this at the top
import grails.converters.Javacript
//now in controllers when rendering use this.
render( {
   jQuery("#status").hide();
   jQuery("#main").html( g.render( template:"list", model:[list:list]) )
} as Javascript)

will render as

jQuery("#status").hide();
   jQuery("#main").html( "...rendered template content..." )

or if you like $ syntax

//Put this at the top
import grails.converters.Javascript
//now in controllers when rendering use this.
render( { jq ->
   jq("#status").hide();
   jq("#main").html( g.render( template:"list", model:[list:list]) )
} as Javascript)

will render as

$("#status").hide();
   $("#main").html( "...rendered template content..." )

Installation

grails install-plugin javascript-converter

Manual

Can be downloaded from project site. Here is a direct link http://grails-javascript.googlecode.com/files/manual-0.2.zip

Demo Application

Can be downloaded from project site. Here is a direct link http://grails-javascript.googlecode.com/files/javascript-demo-0.2.zip