I have one array that contain all the office list. another array is user selected list. so now I want to display all officelist and if the value in selected list is the same with office list then the checkbox will be checked
No. actually i create a new array like array like this
filter_array(){
for (var i = 0; i < this.getSize.length; i++) {
var ismatch = false; // we haven't found it yet
for (var j = 0; j < this.pro_size_list.length; j++) {
if (this.[i].size_id == this.pro_size_list[j].product_size) {
ismatch = true;
this.getSize[i].checked = true;// checkbox status true
this.newArray.push(this.getSize[i]);
break;
}//End if
}
if (!ismatch) {
this.getSize[i].checked = false;// checkbox status false
this.newArray.push(this.getSize[i]);
} //End if
}
console.log(this.newArray);
}