目的: V80202 - store - filterBy - 過濾欄位 -只顯示符合條件的資料
處理說明: 1> store.filterBy(function(cur_rec)) : 過濾 function 傳回值為 true 的資料
var Tmp_filter_Ary = ['s_filter1', 's_filter2', 's_filter3']; //過濾條件的 Array
Tmp_filter_Ary.forEach(function (id) {
if (id !== combo.id) {
var otherCombo = Ext.getCmp(id);
otherCombo.getStore().clearFilter(); //清除 store.filter 內容
otherCombo.getStore().filterBy(function (record)
Tmp_filter_Ary.forEach(function (id) {
if (id !== combo.id) {
var otherCombo = Ext.getCmp(id);
otherCombo.getStore().clearFilter(); //清除 store.filter 內容
otherCombo.getStore().filterBy(function (record)
{//filterBy function , 若為 true ,則包含該選項
var Tmp_isAdd = true;
if (record.get('value') == cur_value)
Tmp_isAdd = false;
var selectedValues_Ary = Object.entries(selectedValues);
console.log("selectedValues_Ary: ", selectedValues_Ary);
for (i = 0; i < selectedValues_Ary.length; i++) {
if (record.get('value') == selectedValues[i])
Tmp_isAdd = false;
}
return Tmp_isAdd;
});
console.log(" selectedValues: ", selectedValues);
console.log(" id: ", id);
var Tmp_store = otherCombo.getStore();
console.log(" otherCombo.getStore()- Tmp_store", Tmp_store);
}
var Tmp_isAdd = true;
if (record.get('value') == cur_value)
Tmp_isAdd = false;
var selectedValues_Ary = Object.entries(selectedValues);
console.log("selectedValues_Ary: ", selectedValues_Ary);
for (i = 0; i < selectedValues_Ary.length; i++) {
if (record.get('value') == selectedValues[i])
Tmp_isAdd = false;
}
return Tmp_isAdd;
});
console.log(" selectedValues: ", selectedValues);
console.log(" id: ", id);
var Tmp_store = otherCombo.getStore();
console.log(" otherCombo.getStore()- Tmp_store", Tmp_store);
}