The whole datatable looks fine, and hyperlinks are visible till using Search Bar. After writing dummy words - the data is showing correct, but without hyperlinks. What I missed?
I need to refresh whole page, to get hyperlinks back again.
@wire(getWoliList,{ woid: '$recordId' })
wiredOpps(result) {
//this.result = wolis;
this.wiredResult = result;
const { data, error } = result;
if(data) {
console.log(data);
this.data = data;
this.initialRecords = data;
let nameUrl, assetUrl, prodUrl;
this.data = data.map(row => {
nameUrl = `/${row.Id}`;
assetUrl = `/${row.AssetId}`;
prodUrl = `/${row.PricebookEntryId}`;
return {...row , nameUrl , assetUrl , prodUrl}
})
this.error = null;
}
if(error) {
this.error = error;
this.data = [];
}
}
handleSearch(event) {
const searchKey = event.target.value.toLowerCase();
if (searchKey) {
this.data = this.initialRecords;
if (this.data) {
let searchRecords = [];
for (let record of this.data) {
let valuesArray = Object.values(record);
for (let val of valuesArray) {
console.log('val is ' + val);
let strVal = String(val);
if (strVal) {
if (strVal.toLowerCase().includes(searchKey)) {
searchRecords.push(record);
break;
}
}
}
}
console.log('Matched Wolis are ' + JSON.stringify(searchRecords));
this.data = searchRecords;
return refreshApex(this.wiredResult);
}
} else {
this.data = this.initialRecords;
return refreshApex(this.wiredResult);
}
}