gpt4 book ai didi

grails - g:sortableColumn具有复杂的关联

转载 作者:行者123 更新时间:2023-12-02 15:29:07 24 4
gpt4 key购买 nike

因此,我正在尝试对对象表(可交付成果)进行排序。我想对每个标题(客户端,项目,可交付成果)使用g:sortableColumn。目前,我正在尝试实现在此博客http://sguthula.blogspot.com/2011/05/implementing-advanced-search-in-grails.html中找到的解决方案,但没有成功。

我的关联示例如下:

class Deliverable {
static belongsTo = [project: Project]
}

class Project {
Client client
static hasMany = [deliverables: Deliverable]
}

class Client {
String name
static hasMany = [projects: Project]
}

在我的表格中,我尝试按客户名称排序。
<g:sortableColumn property="name" title="${message(code: 'deliverable.project.client.name.label', default: 'Client')}"></g:sortableColumn>

这是较复杂的关联之一,但是即使我尝试仅按project.name进行排序,也会导致对每个项目的可交付成果进行重新排序,而不是根据客户或项目名称对整个列表进行重新排序。

为提供的任何帮助加油。

最佳答案

请问您可以在浏览器中看到并发布检查结果吗?

1. goto inspect window and network

2. press the `g:sortablecolumn` and see if anything is posted or a request ?

3. if yes , that is how i can resolve this issue and you should to ..see which
object/parameteris passed to
the controller so that you can play with the code.

4.if not Syntax error please first try with simple settings and correct
to see how it works on 1,2,3 steps.

欢呼声确定您将找到解决方案!

关于grails - g:sortableColumn具有复杂的关联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22618892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com