leandrogehlen / grails-easyui

jQuery EasyUI resources and taglibs
6 stars 3 forks source link

can't get easyui-generated views to work in grails 2.2.x app #5

Closed thomasbittermann closed 11 years ago

thomasbittermann commented 11 years ago

how to reproduce:

1) create-app (2.2.2) 2) add easyui dep (and perfom install steps) 3) create domain 4) easyui-generate-all for domain 5) run

result: buttons and list view don't work

expected: working easyui crud.

Please help to get this fantastic plugin to fly!

leandrogehlen commented 11 years ago

This problem occurs because the scaffold generator uses the layout "main" by default. The next version of the plugin will use the "resources" plugin, so this problem has been solved

To resolve this issue modify the "main" within grails-app/view/layouts for the tag <r:layoutResources /> stay before <g:layoutHead/>
Also remove the css uses, to avoid conflict with the css easyui components

<link rel="stylesheet" href="${resource(dir:'css', file:'main.css')}" type="text/css">
<link rel="stylesheet" href="${resource(dir:'css', file:'mobile.css')}" type="text/css">

example:

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]-->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title><g:layoutTitle default="Grails"/></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
        <link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
        <link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">

        <r:layoutResources />
        <g:layoutHead/>

    </head>
    <body>
        <div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/></a></div>
        <g:layoutBody/>
        <div class="footer" role="contentinfo"></div>
        <div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
        <g:javascript library="application"/>
        <r:layoutResources />
    </body>
</html>