开发者

Sencha Touch radio buttons

I'm trying to find an example of how to setup so开发者_运维问答me simple radio buttons in Sencha Touch. Can anyone point me at a good example?


you can try ..

this.viewOne = new Ext.form.FormPanel({
    text: 'Form',
    iconCls: 'bookmarks',
    items: [
      {
        xtype:'radiofield,
        name: 'radiogroup',
        value: 'A',
        label: 'radio1'
      },{
        xtype:'radiofield,
        name: 'radiogroup',
        value: 'B',
        label: 'radio2'
      }
    ]
  });


The kitchensink demo has a Radio example on the User Experience -> Form example. It's the "Favorite color" of the form. Also, Radio extends Checkbox, so if you can find examples of Checkbox it's similar.

Radio documentation here

The main thing is to give each Radio in a group the same name like the following :

this.viewOne = new Ext.form.FormPanel({
    text: 'Form',
    iconCls: 'bookmarks',
    items: [
      new Ext.form.Radio({
        name: 'radiogroup',
        value: 'A',
        label: 'radio1'
      }), new Ext.form.Radio({
        name: 'radiogroup',
        value: 'B',
        label: 'radio2'
      })
    ]
  });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜