0

谁能告诉如何在 extjs4.1 的单选组中为单选按钮设置动态 inputValue 和 boxlabel

谢谢

4

1 回答 1

0

也许你可以在 sencha wiki 上使用像这个例子这样的监听器。

带广播组的面板:

Ext.create('Ext.form.Panel', {
    title: 'RadioGroup Example',
    width: 300,
    height: 125,
    bodyPadding: 10,
    renderTo: Ext.getBody(),
    items:[{
        xtype: 'radiogroup',
        fieldLabel: 'Two Columns',
        // Arrange radio buttons into two columns, distributed vertically
        columns: 2,
        vertical: true,
        items: [
            { boxLabel: 'Item 1', name: 'rb', inputValue: '1',
              listeners: {
                change: function (e, t, eOpts) {
                    ... 
                }
              }
            },
            { boxLabel: 'Item 2', name: 'rb', inputValue: '2' checked: true},
            { boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
            { boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
            { boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
            { boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
        ]
    }]
});

小例子:在stackoverflow上

于 2013-06-20T14:15:13.487 回答