ext radiogroup如何取值和設值


 1 var radios = Ext.create('Ext.form.Panel', {
 2     title: 'RadioGroup Example',
 3     width: 300,
 4     height: 125,
 5     bodyPadding: 10,
 6     renderTo: Ext.getBody(),
 7     items:[{
 8         xtype: 'radiogroup',
 9         fieldLabel: 'Two Columns',
10         // Arrange radio buttons into two columns, distributed vertically
11         columns: 2,
12         vertical: true,
13         items: [
14             { boxLabel: 'Item 1', name: 'rb', inputValue: '1' },
15             { boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true},
16             { boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
17             { boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
18             { boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
19             { boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
20         ]
21     }]
22 });

 

里面有設置項,把checked設為true,拿值的話用
var val = radios.down('radiogroup').getValue()['rb'];

摘自百度問答,地址:https://zhidao.baidu.com/question/981847790759065939.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM