2017-05-23 4 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

を共有

。とにかく、次のように、あなたのドロップダウンに追加することができchangeイベントリスナーがあります:

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. 
} 

問題がある場合はお知らせください。ハッピーラーニング:)

関連する問題