2017-05-23 2 views
0

드롭 다운 목록이있는 팝업 창이 있습니다. 드롭 다운 값을 다른 값으로 변경하면 더티 체크의 주황색 삼각형이 표시되지만 드롭 다운 값을 이전 값으로 다시 변경하면 더티 체크 표시가 계속 표시됩니다.콤보 상자가 더러운 지 확인하십시오.

값이 드롭 다운의 원래 값으로 다시 변경된 경우 드롭 다운에 더티 기호가 표시되지 않도록하고 싶습니다.

내 코드

columns: { 
    defaults: { 
     align: 'left', 
     flex: 2 
    }, 
    items: [{ 
      xtype: 'actioncolumn', 
      localized: { 
       text: 'commonTranslations.function' 
      }, 
      items: [{ 
       iconCls: 'iwp-icon-gen_edit', 
       handler: 'onEditClick', 

       getTip: function() { 
        return I18n.get('commonIconTranslations.penReleaseConcepts') 
       } 
      }], 
      align: 'center', 
      flex: 1 
     }, 
     { 
      localized: { 
       text: 'commonTranslations.description' 
      }, 
      dataIndex: 'title', 
      renderer: CommonRendererUtils.htmlEncode 
     }, 
     { 
      localized: { 
       text: 'commonTranslations.fileName' 
      }, 
      dataIndex: 'filename', 
      renderer: CommonRendererUtils.htmlEncode 
     }, 
     { 
      xtype: 'actioncolumn', 
      localized: { 
       text: 'commonTranslations.file' 
      }, 
      items: [{ 
       getClass: function(v, metadata, r) { 
        if (!r.get('filename')) { 
         return 'x-hidden' 
        } else { 
         return 'iwp-icon-zeb_folder' 
        } 
       }, 
       getTip: function() { 
        return I18n.get('commonIconTranslations.halfOpenFolder') 
       }, 
       handler: 'onDownloadClick' 
      }], 
      align: 'center', 
      flex: 1 
     }, 
     { 
      localized: { 
       text: 'commonTranslations.source' 
      }, 
      dataIndex: 'source', 
      flex: 1 
     }, 
     { 
      localized: { 
       text: 'details.tabview.scope.contents.release.main.uploadDate' 
      }, 
      dataIndex: 'changeDate', 
      xtype: 'dynamicTimestampColumn' 
     }, 
     { 
      localized: { 
       text: 'details.tabview.scope.contents.release.main.uploadBy' 
      }, 
      dataIndex: 'changeUser', 
      xtype: 'usercolumn' 
     }, 
     { 
      localized: { 
       text: 'commonTranslations.status' 
      }, 
      /*-----facing issue for the column*/ 
      dataIndex: 'status', 
      renderer: function(value) { 
       return value.germanDescription; 
      } 

     }, 
     { 
      localized: { 
       text: 'commonTranslations.changeReason' 
      }, 
      dataIndex: 'changeReason', 
      renderer: CommonRendererUtils.htmlEncode 
     }, 
     { 
      localized: { 
       text: 'commonTranslations.modulOrg' 
      }, 
      dataIndex: 'modulOrgs', 
      renderer: function(value, metaData, record) { 
       if (record.isModified(metaData.column.dataIndex)) { 
        console.log("modified 9999999" + record.isModified(metaData.column.dataIndex)); 
        metaData.tdCls += 'x-grid-dirty-cell'; 
       } 
       var formattedValue = ""; 
       if (value) { 
        value.forEach(function(modulOrg) { 
         formattedValue += modulOrg.modulOrg + ", "; 
        }); 
       } 
       return formattedValue.substring(0, formattedValue.length - 2); 
      }, 
      flex: 1 
     }, 
     { 
      localized: { 
       text: 'details.tabview.scope.contents.release.main.historyIndex' 
      }, 
      dataIndex: 'historyIndex', 
      flex: 1 
     } 
    ] 
} 
+0

콤보 상자에 대한 설명서를 참조하십시오. 원래 값과 새로운 값을 비교해야하는 메서드 인 isDirty()가 있습니다. 어떤 이유로 든 원래 값이 올바르게 설정되지 않았습니다. – dearSympho

답변

0

공유 난 당신이 너무 많은 코드를 가지고 생각합니다. 어쨌든 다음과 같이 당신이 당신의 드롭 다운에 추가 할 수있는 변경 이벤트 리스너가 :

listeners:{ 
    change:'combochange' 
} 

이제 컨트롤러 내부의이 combochange 기능을 쓸 수 있습니다 또는 당신은 단지보기 내에서이 기능을 정의 할 수 있습니다.

combochange:function(field,newValue,oldValue,e){ 
// Inside this function you will get both the values of the dropdown of 
yours where newValue is the value currently selected and oldValue is the 
previous value. So inside this function according to your conditions you 
can put a check that if the old and newvalue matches then not to show the 
orange triangle. 
} 

문제가 있으면 알려주십시오. 행복한 학습 :)

관련 문제