I have this object an array which holds the data that will be used to a loop that creates elements
The data:
callList : [
{'Agent Name':'AB Ferrancullo','Call ID':'s',ANI:'3',DNIS:'4043','Call Queue':'Paymaya','Call Type':'INBOUND','Call Start':'8/12/2019 7:48:15 AM','test':'1',Duration : '1427','Final Grade':75,'Evaluted By':'Arnulfo','Evaluation Date':'August 13,2019'},
{'Agent Name':'AB Ferrancullo','Call ID':'d',ANI:'2',DNIS:'4043','Call Queue':'Paymaya','Call Type':'INBOUND','Call Start':'8/12/2019 12:32:40 PM','test':'2',Duration : '403','Final Grade':100,'Evaluted By':'Angelo','Evaluation Date':'August 14,2019'},
{'Agent Name':'AB Ferrancullo','Call ID':'1',ANI:'5',DNIS:'7788','Call Queue':'Paymaya','Call Type':'INBOUND','Call Start':'8/12/2019 9:46:39 AM','test':'3',Duration : '605','Final Grade':50,'Evaluted By':'John','Evaluation Date':'August 15,2019'}
]
The loop:
<div class="col-sm-3" v-for="(call) in callList" :key="call.id">
<div class="card">
<div class="card-header fc-white" :class="[call['Final Grade'] >= 75 ? 'pqm-green' : 'bg-red']">
<h6 class="m-0">{{call['Agent Name']}}</h6>
</div>
<div class="card-body">
<h5 class="card-title mb-2"><b class="mr-1">Final Grade:</b>{{call['Final Grade']}}</h5>
<p class="m-0"><b class="mr-1">Evaluated By:</b> {{call['Evaluted By']}}</p>
<p><b class="mr-1">Evaluated Date:</b> {{call['Evaluation Date']}}</p>
<a data-toggle="modal" data-target="#modal-rate" @click="removeKeys(call)" class="btn btn-success pqm-green float-right fc-white"><i class="fal fa-search"></i> View Details</a>
</div>
</div>
</div>
I have a function that replicates the object to delete certain keys that will not be used
removeKeys : function(obj){
var tempobj = obj
var keysToDelete = Object.keys(tempobj).splice(-3);
keysToDelete.forEach(k => $delete(tempobj,k));
this.awit = tempobj;
// console.log(callList);
}
but upon checking the callList
the keys that was remove in tempObj
was also remove which creating a problem in my UI. Is there something I missing? or a workaround here