2016-07-01 2 views
0

편집 가능한 격자 열 (ExtJs v4.2.2)에서 저장소를 동적으로 변경하는 방법은 무엇입니까? 그래서, 모든 행편집 가능한 열 격자의 동적 저장소

this.columns = [ 
{ 
    text: 'id', 
    dataIndex: 'movementId', 
    sortable: false, 
    hideable: true, 
    sortableColumn: false, 
    hidden: true, 
    flex : 1, 
    scope:this 
}, 
{ 
    text: 'TypeId', 
    dataIndex: 'movementTypeId', 
    sortable: false, 
    sortableColumn: false, 
    hideable: true, 
    sortableColumns: false, 
    hidden: true, 
    flex : 2, 
    scope:this 
}, 

{ 
    text: 'Reason', 
    dataIndex: 'movementReasonId', 
    sortable: false, 
    hideable: true, 
    sortableColumn: false, 
    field: { 
     xtype: 'combobox', 
     align: 'center', 
     typeAhead: true, 
     triggerAction: 'all', 
     //selectOnTab: true, 
     store: this.storeMovementReasonType, 
     displayField: 'label' 
    }, 
    flex : 3, 
    scope:this 
}, 

]; 

: 열은, diffrent리스트 필드는 '이유'가 첨부 될

: 포인트 이동의 유형에 따라 다를 PARAMS (movementTypeId)으로 가기를로드하는 것 저장소가로드 될 때 추가 매개 변수를 설정하려는 경우

if(movementTypeId === 89){ 
storeMovementReasonType.getProxy().setExtraParam('dictionaryTypeId',11); 
} 
if(movementTypeId === 94){ 
    storeMovementReasonType.getProxy().setExtraParam('dictionaryTypeId',8); 
} 

이 가능합니까? 시간 :

답변

1

에 대한 감사합니다 당신은 당신의 rowediting 플러그인에 beforeedit 리스너를 구현하려면 :

listeners:{ 
    beforeedit:function(editor , context , eOpts) { 
     var movementTypeId = context.record.get("movementTypeId"); 
     if(movementTypeId === 89){ 
      storeMovementReasonType.getProxy().setExtraParam('dictionaryTypeId',11); 
     } 
     if(movementTypeId === 94){ 
      storeMovementReasonType.getProxy().setExtraParam('dictionaryTypeId',8); 
     } 
     storeMovementReasonType.load(); 
    } 
} 
+0

덕분에, 나도 그리드의 저장소의 필드 값을 표시해야 – aurny2420289

+0

좋은 소리. 렌더러를 사용하고 레이블을 반환하기 전에로드 된 저장소를 기다리지 만 렌더러 메서드가 반환을 기다리지 않습니다 .. 아이디어가 있습니까? – aurny2420289

+0

@ aurny2420289 Hanc marginis exiguitas non caperet. – Alexander

관련 문제