1
Grails的GSP我做這樣的事情Grails的順序由1到很多相關對象
<g:each in="${testInstance?.testConfigs?}" var="t">
兩個類
class Test{
static hasMany = [testConfigs:TestConfig]
}
class TestConfig {
Date dateCreated
Date lastUpdated
Test test
static constraints = {
dateCreated display:false
lastUpdated display:false
questionType inList:["Fill in the blanks","Multipl choice","True False"]
}
}
我怎樣才能改變每個循環,使testConfigs對象檢索的有序降序由dateCreated字段?
我肯定得上什麼地方,在對文檔,只是不知道在哪裏......多謝不是說RTFM – Sap 2012-02-06 16:45:32
@Grrrrr無後顧之憂!有這麼多的文檔,像這樣深奧的東西往往會被埋沒:-)祝你好運! – 2012-02-06 16:47:33