Skip to content

Inline Edit and Add #158

@leefaroe

Description

@leefaroe

I guess I'm missing something. I can't get the inline edit to work, much less the inline add. is there a working example of inline edit and add? Here is one of my grid examples, building number should be editable.

def buildingGrid = {
    domainClass Building
    inlineEdit true
    edit true
    globalFilterClosure { params ->
        eq('project.id', session.project.id?:1 )
    }
    columns {
        id {
            type 'id'
            enableFilter false
            jqgrid {
                hidden = true
            }
        }
        buildingNumber
        nrFloors {
            enableFilter false
            value { Building building ->
                building.floors.size()
            }
        }
    }
}

grid:grid name="building" addFunction="addBuilding">
grid:set caption="Buildings" width="700"/>
grid:set inlineNav="${[addParams:[position:'last'],editParams:'f:editOptions']}"/>
/grid:grid>
class Building {
Integer buildingNumber

static belongsTo = [project:Project]
static hasMany = [floors:Floor]

static constraints = {
    buildingNumber(nullable:false)
}
static mapping = {
    floors sort: 'floorNumber', order: 'asc'
}
def numberOfFloors() {
    return floors?.size()?:0
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions