From f3a8b609580d160f2d15b0c2fab28784a38cba71 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期二, 04 七月 2023 17:44:48 +0800
Subject: [PATCH] 备品附属品选择 附属品追加

---
 force-app/main/default/lwc/paginatedList/paginatedList.js |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/lwc/paginatedList/paginatedList.js b/force-app/main/default/lwc/paginatedList/paginatedList.js
index fd3051b..e9312e2 100644
--- a/force-app/main/default/lwc/paginatedList/paginatedList.js
+++ b/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");
+                });
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1