Last active
January 3, 2024 08:17
-
-
Save svierk/6b3f94a7781b897f408f31c9f806d37c to your computer and use it in GitHub Desktop.
JS Code for Drag & Drop Demo LWC | Variables & connectedCallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement, track } from 'lwc'; | |
const COLUMNS = [ | |
{ | |
label: 'Id', | |
fieldName: 'id', | |
hideDefaultActions: true | |
}, | |
{ | |
label: 'Label', | |
fieldName: 'label', | |
hideDefaultActions: true | |
} | |
]; | |
export default class DragAndDrop extends LightningElement { | |
elements = []; | |
columns = COLUMNS; | |
@track data = []; | |
connectedCallback() { | |
for (let i = 1; i <= 12; i++) { | |
this.elements.push({ id: i, label: `Element ${i}` }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment