2014-09-19 15 views
0

我想更新另一個g:select的內容。我使用remoteFunction但它不起作用。當我從部門選擇價值時,沒有什麼好玩的。我使用的Grails 2.4.3如何更新一個g:使用Grails中的另一個選擇

SubjectInfoController.groovy

class SubjectInfoController { 

def create(){ 
     institutes: Institute.listOrderByName(order: "asc"), 
    } 

def updateInstitutes(){ 
     def department = Department.get(params.int('department')) 
     [institues: department.institutes] 
    } 

} 

create.gsp

​​

控制檯錯誤:

GET http://localhost:8080/SARNA/js/application.js 404 (Not Found) create:261 
GET http://localhost:8080/SARNA/js/jquery/jquery-1.11.1.js 404 (Not Found) create:20 
Uncaught ReferenceError: jQuery is not defined create:36 
onchange 
+0

你有控制檯錯誤?是#institutes取而代之的東西?答案看起來如何 – 2014-09-19 10:13:20

+0

@johnSmith,我編輯過,我有控制檯錯誤。我不明白你的第二個問題,我不知道如何檢查響應的樣子;( – Tasmanski 2014-09-19 10:24:58

回答

0

好,所以$ {remoteFunction。 。}最有可能生成一些Jquery代碼

,併爲你的jquery.js找不到/無法正常收錄,請求失敗

應該沒有問題,如果jQuery是包括

+0

感謝你的回答,是的,我有''和它應該是''。 – Tasmanski 2014-09-19 11:46:30

相關問題