Sign in to edit and +1 items.
Login required
Download

Ext Direct

(3)
Author(s) dferrand
Current Release 0.1   (3 years ago)
Grails Version 1.1 > *
Tags ajax  ext.direct  extjs  rich client 
Dependency
compile ":directext:0.1"
Last updated by admin 3 years ago
grails install-plugin directext
Last updated by dferrand 3 years ago
ExtJS 3.0 introduced a new package Ext.Direct for client/server communication in ExtJS app. This plugin is a server stack for Ext.Direct in grails app.

For more information about Ext.Direct, please refer to ExtJS site.

Usage

Actions

Once the plugin is installed, action classes are created in the grails-app/actions directory. Action names must end with @Action@.

Actions can be created with:

grails create-action name

In an action class, defined closures will be made available to the client:

class DemoAction {
   def returnTrue = { ->
      true
   }
}

On the client, this action method can be called with:

demo.returnTrue(function(provider,response){
   alert('The function returned '+response.result);
});

Remoting API

On the client, the remoting API must be included with:

<script type="text/javascript" src="api"></script>
in the head section of you html page.

Kown issues

  • Currently the plugin does not handle form posts (which are used when there is a file upload) JIRA
Last updated by dferrand 3 years ago

Why can't I use an action method with no argument?

In groovy, a closure without declared argument like:
def methodWithOneArgument = {
}
actually has one argument ( it ).

To declare a closure with no argument use:

def methodWithNoArgument = { ->
}
Last updated by admin 3 years ago