2013-01-04 6 views
1

extjs 및 yii 프레임 워크에서 객관식 질문지 프로젝트를 만들고 있습니다. 내 서버 사이드 디자인은 yii 프레임 워크에 있지만 클라이언트 사이드는 extjs에 있습니다. 에 extjs에서 나는 extjs에서 라디오 버튼 값을 얻는 방법은 무엇입니까?

Question.js= 
      Ext.define('Balaee.view.question.Question', 
      { 
     extend:'Ext.form.Panel', 
     requires:[ 
        'Balaee.view.question.QuestionView' 
        ], 
     id:'QuestionId', 
     alias:'widget.question', 
     title:'Question', 
     height:180, 
     items:[ 
      { 
       xtype:'questionView', 
      }, 

     ],//end of items square 
     buttons:[ 
       { 
        xtype:'button', 
        fieldLabel:'Submit', 
        name:'answer', 
        formBind:true, 
        text:'submit', 
        action:'submitAction', 
       } 
     ] 
       }); 


QuestionView.js= 
      Ext.define('Balaee.view.question.QuestionView', 
      { 
     extend:'Ext.view.View', 
     id:'QuestionViewId', 
     alias:'widget.questionView', 
     store:'Question', 
     config: 
     { 
      tpl:'<tpl for=".">'+ 
       '<div id="main">'+ 
       '</br>'+ 
       '<b>Question :-</b> {question}</br>'+ 
       '<p>-------------------------------------------</p>'+ 

       '<tpl for="options">'+  // interrogate the kids property within the data 
        //'<p>&nbsp&nbsp<input type="radio" name="opt" >&nbsp{option}</p>'+ 
       '<p>&nbsp&nbsp<input type="radio" name="opt{questionNumber}" >&nbsp{option} </p>'+ 
       '</tpl></p>'+ 

       '</div>'+ 
       '</tpl>', 
      itemSelector:'div.main',  
     } 
       }); 

그래서 내가 30 질문에 extjs에서 라디오 버튼 등의 optopns을 표시하고 시스 - 볼 수 있습니다. 이 질문은 클라이언트 측에서 가져옵니다. 버튼을 클릭하면 모든 사용자가 선택한 라디오 버튼의 값을 가져오고 싶습니다. 그렇다면 라디오 버튼의 값을 선택하는 방법은 무엇입니까?

답변

0

왜 이런 복잡한 작업을 원하십니까? 양식 및 양식 필드를 대신 살펴보십시오.

관련 문제