2016-07-04 6 views
0

私はsenchaを新しくしました。 私は別のボタンをクリックすると選択フィールドが開きます。sencha touch

    { 

        "xtype": "container", 
        //"shrinkWrap": false, 
        //"width": "100%", 
        //"height": "100%", 
        style: { 
         //"padding-bottom": "5px", 
        }, 

        "layout": { 
         "type": "hbox", 
         "align": "stretch" 
        }, 
        "items": [ 
         { 
          "xtype": "container", 
          "flex": 1, 
          "layout": { 
           "type": "hbox", 
           "align": "stretch" 
          }, 
          "items": [ 
           { 
            xtype: 'textfield', 
            placeHolder: 'Subject', 
            id: 'rejectSubject', 
            name: 'rejectSubject', 
            itemId: 'rejectSubject', 
            hidden: true, 
            //readOnly: true, 
            //width: "100%", 
            //columnWidth: 0.5 
            flex: 1, 
           }, 
           { 
            xtype: 'button', 
            flex: 0.1, 
            style: { 
             'position': 'absolute', 
             'right': '5px', 
             'height': '35px', 
             'border': '0px none', 
             'background': ' #fff', 
            }, 

            html: '<i class="fa fa-chevron-down" aria-hidden="true"></i>', 
            autoEl: { 
             tag: 'right' 
            }, 
            handler: function() { 
             Ext.get('templateemail').dom.click(); 
            } 
           }, 
           { 
            xtype: 'selectfield', 
            //cls: 'field-border-right', 
            //label: 'Email ', 
            name: 'template_id', 
            itemId: 'template_id', 
            id: 'templateemail', 
            hidden: true, 
            listeners: { 
             change: function() { 
              if (this.getValue() > 0) { 
               //             this.parent.down('label[name=templateError]').setHidden(true); 
              } 
             } 
            } 
           }, 
          ] 
         } 

        ] 
       }, 

は次のようになり、煎茶ベースの設計要件の異なるボタンのクリックでselectfieldをトリガしよう:

enter image description here

私を助けてください。

答えて

1

はselectfield

showPicker(上showPicker()を使用する必要があります)

はそれがExt.picker.Pickerまたは単純なリストであるかどうか、選択フィールドのためのピッカーを表示します。

Ext.getCmp('templateemail').showPicker(); 
+0

あなたの答えのおかげで、私は、私はそのことを私は検証メッセージを生成することができませんですので、ボタンアプリを選択し、ポップアップ自動、最後のオプションを毎回選択しクリックという別の問題に直面しています。助けてください。 – Neotrixs

+0

私はselectfieldに 'autoSelect:false'を付ける必要があると思います –

関連する問題