2012-05-17 59 views
1

jQueryUI的有單選按鈕,一個相當不錯的顯示:Sencha是否有相當於jQuery的Radioset?

jQuery UI radioset

煎茶是否有類似的東西嗎?


跟進的問題,如果不是:

你發現了什麼是好的UX的三個項目(甚至四,項目)組件,它僅需要一個觸摸? (例如,一個選擇框是兩個觸摸,一個打開選擇列表,一個選擇您的選項)

回答

3

您在爲Sencha Touch尋找Ext.SegmentedButton

的示例代碼段: -

var segmentedButton = new Ext.SegmentedButton({ 

    allowMultiple: false, // ensures only 1 button gets pressed at a time. 
    items: [ 
     { 
      text: 'Choice 1' 
     }, 
     { 
      text : 'Choice 2', 
      pressed: true 
     }, 
     { 
      text: 'Choice 3' 
     } 
    ], 
    listeners: { 
     toggle: function(container, button, pressed){ 
      console.log("User toggled the '" + button.text + "' button: " + (pressed ? 'on' : 'off')); 
     } 
    } 
}); 
Ext.Viewport.add({ xtype: 'container', padding: 10, items: [segmentedButton] }); 

輸出: -

enter image description here

+1

工程就像一個魅力,謝謝RR。 對於具有相同問題的其他人,這也可以在FormPanel中工作,通過使xtype ='segmentedbutton' –

+0

不客氣! :) –

+0

嗨@roadRunner,當在表單中使用segmenetedbutton時,是否通常在它旁邊創建一個隱藏域並更新隱藏域的變化值? (sencha 1.1) –

相關問題