【问题标题】:In extjs how to store selected radio buttons option在 extjs 中如何存储选定的单选按钮选项
【发布时间】:2013-01-03 07:09:41
【问题描述】:

我在 extjs+Yii 工作。在 extjs 中,我正在创建 20 个问题的多项选择题。这些问题是我从 Yii 框架中提取的。所以在 extjs 我的代码为= 查看= 问题.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:'Vote',
              name:'vote',
              formBind:true,
              text:'submit',
              action:'voteAction',
          }
    ]
         });

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>'+
            '</tpl></p>'+

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

});

所以我正在查看将问题及其选项显示为单选按钮的视图。我正在显示 20 个问题。最后它有提交按钮。点击提交按钮,我想显示结果。要计算结果,我需要将用户选择的所有问题的选项存储在 extjs 的存储中以计算结果。那么如何在 extjs 中存储所有选题选项呢?

【问题讨论】:

    标签: extjs4 radio-group


    【解决方案1】:

    您是否询问如何将表单的单选按钮值放入临时 Ext 数据存储中?

    【讨论】:

    • 感谢先生的回复...实际上,我想将所有 20 个问题选择的单选按钮选项保存到存储中?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-03
    • 2016-11-10
    • 1970-01-01
    • 1970-01-01
    • 2016-11-23
    相关资源
    最近更新 更多