Skip to content

Instantly share code, notes, and snippets.

@dhaniksahni
Created July 9, 2020 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaniksahni/f00b85864ce14476bf3408911ab1a596 to your computer and use it in GitHub Desktop.
Save dhaniksahni/f00b85864ce14476bf3408911ab1a596 to your computer and use it in GitHub Desktop.
childModule for errorCallback
<template>
<c-grand-child></c-grand-child>
</template>
import { LightningElement,track } from 'lwc';
import agGridcommunity from '@salesforce/resourceUrl/agGridcommunity';
export default class ChildModule extends LightningElement {
renderedCallback(){
Promise.all([
loadStyle(this, agGridcommunity + "/agGridCommunity/ag-grid.css"),
loadStyle(this, agGridcommunity + "/agGridCommunity/ag-theme-alpine.css"),
loadScript(this, agGridcommunity + '/agGridCommunity/ag-grid-community.js')
])
.then(() => {
console.error('isCSSLoaded');
})
.catch(error => {
this.dispatchEvent(
new ShowToastEvent({
title: error.message,
message: error.message,
variant: 'error'
})
);
});
}
}
@sagarpomal
Copy link

@dhaniksahni Thanks for sharing. Were you able to load AgGrid inside LWC? It is not related to error handling. We want to use AgGrid in LWC; however, it is not supported because of locker service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment