AnswerBun.com

This page has an error

Salesforce Asked on January 6, 2022

I’ve created a lightning-datatable and I’m trying to filter records in the lightning-datatable using a custom search box. However, it displays a pop-up with error which says SORRY TO INTERRUPT -> the page has error when I try to filter the records.

Below is the code I’ve written to filter records in data-table.

    handleSearch(event){
            var searchText = event.target.value;
            console.log('searchText : ' ,searchText);
            try{
                    this.dataListTemp  = this.dataListTemp.filter(function (record) {
                        return record.name.includes(searchText)  ||
                               record.title.includes(searchText) ||
                               record.occupation.includes(searchText);
                      });
                }catch(error){
                    console.log('Error : ' ,error);
                }
    }

dataListTemp is assigned to the data attribute of lightning-datatable and handleSearch is called onchange of text in search box.

I used try-catch just to figure out what’s causing this error but catch isn’t called at all.

What is the issue here?

Add your own answers!

Related Questions

SSJS redirecting to wrong page

1  Asked on December 24, 2021

     

Updating checkbox From custom buttons

1  Asked on December 22, 2021 by user21944

   

Createdby cannot reference custom field?

2  Asked on December 22, 2021 by shuo-wang

   

Multiple input inside aura:iteration table

1  Asked on December 22, 2021 by nom

     

SFDX CLI is not working for any commands

1  Asked on December 22, 2021 by ysr-shk

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP