2016-09-06 3 views
0

콤보 상자 선택에 따라 양식 컨테이너 요소 표시/숨기기에 대한 도움을 찾고 있습니다.ExtJS 5.0.1 콤보 상자 선택을 기준으로 그리드 표시

"NSP Provider"가 combobox (id : carrierConnectivity)에서 선택된 경우에만 그리드 (id : NspList)가 표시되기를 원합니다. 누구든지 이것이 어떻게 성취 될 수있는 아이디어가 있습니까? 코드 아래 :

당신이 체크 박스를 기본값으로 NSP 파트너를 선택하지 않았기 때문에
listeners:{ 
    change:function(cb,newValue) { 
     cb.nextSibling().setVisible(newValue=="NSP Partner"); 
    } 
} 

, 당신은 그리드를 구성해야합니다

    { 
        xtype: 'container', 
        layout: 'vbox', 
        style: { paddingRight: '10px', paddingBottom: '10px' }, 
        items: [{ 
          xtype: 'combobox', 
          labelAlign: 'top', 
          fieldLabel: 'Connectivity Type', 
          id: 'carrierConnectivity', 
          name: 'connectivity_type', 
          store:['GRE', 'GRE - with internet peering', 'MPLS', 'Direct Leased Line', 'NSP Partner'], 
          width: 250, 

         }, 
         { 
          id: 'NspList', 
          flex: 1, 
          xtype: 'grid', 
          minHeight: 200, 
          maxHeight: 300, 
          width: 250, 
          selType: 'rowmodel', 
          title: 'NSP Providers', 
          forceFit: true, 
          bind: { store: '{nspnames}' }, 
          plugins: [ 
           Ext.create('Ext.grid.plugin.CellEditing', { 
            clicksToEdit: 2 
           }) 
          ], 
          columns: { 
           defaults: { 
            editor: 'textfield' 
           }, 
           items: [ 
            { text: 'Name', dataIndex: 'name'} 
           ] 
          }, 
          tools: [ 
           {type: 'plus', handler: 'addNsp'}, 
           {type: 'minus', handler: 'removeNsp'} 
          ] 
         } 

        ] 
       } 

답변

2

콤보 사용하려는 변경 청취자를 가지고

hidden:true 
+0

이것은 완벽하게 작동했습니다. 감사합니다 알렉산더 많이 주셔서 감사합니다. – Jukebox

관련 문제