2012-07-16 71 views

回答

1

Ext.menu.CheckItem可以被配置爲顯示爲一個單選按鈕,所以我們要使用它,然後我們必須指定我們所有項目的自定義菜單爲Ext.menu.CheckItem,並在每個項目中提供group配置使其成爲單選按鈕。

{ 
    xtype : 'cyclebutton', 
    menu : { 
     xtype : 'menu', 
     items : [{ 
      xtype : 'menucheckitem', 
      text : 'Check 1', 
      group : 'check'  // this will make sure that checkboxes will be rendered as group 
     },{ 
      xtype : 'menucheckitem', 
      text : 'Check 2', 
      group : 'check'  // this should be same for every check item to put it in single group 
     }] 
    } 
} 
+0

非常好!這個呈現單選按鈕,如我所料。謝謝 – jorel 2012-07-17 00:34:38

0

你可以嘗試設置項目的xtype無線電

items: [{ 
     xtype: 'radio', 
     boxLabel : 'a'    
    },{ 
     xtype: 'radio', 
     boxLabel : 'b' 
    }] 
+0

這對我無效 – jorel 2012-07-17 00:33:00

相關問題