Giter Site home page Giter Site logo

Comments (4)

tudor-malene avatar tudor-malene commented on July 22, 2024

This is because of a bug in the current version of dynamic-controller plugin, which I used in 1.4 to register those methods.
I notified Burt ( the author of dynamic-controller ) , so it should be resolved soon.

from easygrid.

tudor-malene avatar tudor-malene commented on July 22, 2024

fixed in 1.4.1

from easygrid.

tombray avatar tombray commented on July 22, 2024

Hmm, I just tried 1.4.1 and get this exception when I start my app:

context.GrailsContextLoader Error initializing the application: Cannot invoke method remove() on null object
java.lang.NullPointerException: Cannot invoke method remove() on null object
at org.grails.plugin.easygrid.builder.EasygridBuilder$_evaluateGrid_closure2.doCall(EasygridBuilder.groovy:98)
at org.grails.plugin.easygrid.builder.EasygridBuilder$1.invokeMethod(EasygridBuilder.groovy:165)
at com.ifn.country.CountryGridController$__clinit__closure1_closure2.doCall(CountryGridController.groovy:19)
at org.grails.plugin.easygrid.builder.EasygridBuilder.buildWithDelegate(EasygridBuilder.groovy:176)
at org.grails.plugin.easygrid.builder.EasygridBuilder.evaluateGrid(EasygridBuilder.groovy:49)
at org.grails.plugin.easygrid.builder.EasygridBuilder$_evaluate_closure1.doCall(EasygridBuilder.groovy:34)
at org.grails.plugin.easygrid.builder.EasygridBuilder$1.invokeMethod(EasygridBuilder.groovy:165)
at com.ifn.country.CountryGridController$__clinit__closure1.doCall(CountryGridController.groovy:14)
at org.grails.plugin.easygrid.builder.EasygridBuilder.buildWithDelegate(EasygridBuilder.groovy:176)
at org.grails.plugin.easygrid.builder.EasygridBuilder.evaluate(EasygridBuilder.groovy:33)
at org.grails.plugin.easygrid.EasygridInitService$$EOLg8NM0.generateConfigForGrids(EasygridInitService.groovy:365)
at org.grails.plugin.easygrid.EasygridInitService$$EOLg8NM0.initializeFromClosure(EasygridInitService.groovy:177)
at org.grails.plugin.easygrid.EasygridInitService$$EOLg8NM0.initControllerGrids(EasygridInitService.groovy:145)
at org.grails.plugin.easygrid.EasygridInitService$_initializeGrids_closure2.doCall(EasygridInitService.groovy:45)
at org.grails.plugin.easygrid.EasygridInitService$$EOLg8NM0.initializeGrids(EasygridInitService.groovy:43)
at EasygridGrailsPlugin$_closure3.doCall(EasygridGrailsPlugin.groovy:53)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

Here are my grid definitions:

static grids = {
    countryGrid {
        dataSourceType 'gorm'
        domainClass Country
        gridImpl 'jqgrid'
        inlineEdit true
        filterForm true
        columns {
            countryCode  {
                editable false

            }
            description
            uiEnabled {
                jqgrid {
                    edittype "'checkbox'"
                }
            }
        }
    }

    callActivityGrid {
        dataSourceType 'gorm'
        domainClass CallActivity
        gridImpl 'jqgrid'
        inlineEdit true
        columns {
            activityTypeCode {
                value {
                    it.activityTypeCode.name()
                }
                jqgrid {
                    edittype "'select'"
                    editoptions """{
                        value: '${Activity.ActivityTypeCode.values().collect({ it.toString() + ":" + it.toString() }).join(";")}',
                        dataInit: function (elem) {
                           alert(elem);
                        },
                        multiple: false
                    }"""
                }
            }

        }
    }

from easygrid.

tudor-malene avatar tudor-malene commented on July 22, 2024

It's because of that "filterForm true" line in 'countryGrid'.
The Builder expect filterForm to be a closure where you define the fields and other parameters.
I should have thrown a better error message there.
If you just remove that line, it will work.

Also, in 1.4.1 , you can define your grids like this:

   def countryGrid = {
        dataSourceType 'gorm'
        domainClass Country
        gridImpl 'jqgrid'
        inlineEdit true
        filterForm true
        columns {
            countryCode  {
                editable false

            }
            description
            uiEnabled {
                jqgrid {
                    edittype "'checkbox'"
                }
            }
        }
    }

But, if you do this, you will have to keep in mind that the name which you'll use to refer the grid will be without the "Grid" suffix ( just 'country' in this case)

Another suggestion would be that it may be preferable to keep the UI properties in the gsp. You can do this by overriding different properties in the tag:
For example:

<grid:grid name='callActivityGrid' columns.activityTypeCode.jqgrid.editoptions =' ......'/>

from easygrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.