buli
2023-05-22 71b93327e8f3fb3bffffc7c033c1f782e7b6ab32
force-app/main/default/lwc/paginatedList/paginatedList.js
@@ -7,6 +7,11 @@
import ACCOUNT_PHONE_FIELD from "@salesforce/schema/Account.Type";
import ACCOUNT_EMPLOYEES_FIELD from "@salesforce/schema/Account.NumberOfEmployees";
//table css
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
const COLUMNS = [
    {
        label: "Account Name",
@@ -44,7 +49,7 @@
    connectedCallback() {
        this.getAccounts();
    }
    stylesLoaded = false;
    getAccounts() {
        this.loader = true;
        getAccountsPaginated({
@@ -117,4 +122,17 @@
    get nextButtonDisabled() {
        return this.nextPageToken === undefined;
    }
    renderedCallback(){
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
                .then(() => {
                    console.log("Custom styles loaded");
                    this.stylesLoaded = true;
                })
                .catch((error) => {
                    console.error("Error loading custom styles");
                });
        }
    }
}