2014-04-07 5 views
0

저는 Yii Mvc 프레임 워크를 사용하고 있으며 아약스와 PHP를 사용하고 있습니다. 의견을 작성/저장 한 후 요청을 업데이트 할 때 작동하지 않을 수 있습니다. 업데이트/저장 작업을하려면 생성/저장 후에 페이지를 새로 고침해야합니다. 내가 무엇이 누락 되었습니까? 클릭 이벤트가 마지막 컨트롤러/액션으로 돌아 가지 않도록 만드는 방법 ? 사전에 도움을 주셔서 감사합니다.제출 후 업데이트 Yii와 아약스가 업데이트 양식 페이지를 렌더링하지 않습니다

단계는 아약스의 다음

              **adresses called** 
1. the user request the index page (normal call)   /post/index 
    (the page index is rendered) 
2. the user click to create comment (ajax call)  /post/createComment 
    (the comment-form is rendered inside the index page) 
3. the user click to save the comment (ajax call)   /post/saveComment 
    (the comment is saved and the comment-form is removed) 
4. the user clcik to update the comment (ajax call)   /post/saveComment 
                  is called again 
                  nothing happens 

if before point 4 I refresh the page 

4. the user click to update the comment (ajax call)   /post/updateComment 
    (the comment-form with existing comment is rendered) 

5. the user click to save the commnt (ajax call)   /post/saveComment 
    (the comment is saved and the comment-form is removed) --> ok 

답변

0

업데이트 페이지가 YII 자동으로 작동하지 않을 수 있습니다. CActiveFrom 위젯과 해당 ajax 유효성 검사 기능을 사용하거나 일부 페이지 요소를 javascript로 수동 업데이트 할 수 있습니다. CAtiveForm을 사용하는 경우보기 및 컨트롤러 소스 코드를 참조해야합니다.