List
-
DataTable in Lightning Web Component (LWC)LWC 2024. 4. 6. 00:28
1. 이란?LWC의 DataTable 구성 요소는 Salesforce에서 표 형식 데이터를 표시하고 상호 작용하는 데 필수적인 도구 2. datatable에서 보여줄 List와 Columns 생성 2-1 : data List 생성 //js파일import { LightningElement, track, api } from 'lwc'; export default class Kk_gwiseok extends LightningElement { @track data = []; connectedCallback() { const data = [ { id:'123', TemplateTitle__c:'공급계약서', TemplateId__c:' tmplate01'}, ..
-
apex 및 JS에서 리스트 중복제거 ( apex JS - Remove duplicates from list )Apex 2024. 3. 15. 22:16
Apex에서 리스트 중복 제거 Set 을 이용한 방법 List targetList = new List{'A', 'B', 'C', 'B', 'B', 'D', 'A', 'C'}; Set setStr = new Set(); for(String str : targetList){ setStr.add(str); } System.debug(setStr); // DEBUG|(A, B, C, D) 출력 Map을 이용한 방법 List targetList = new List{'A', 'B', 'C', 'B', 'B', 'D', 'A', 'C'}; //( 마지막에 중복된 값으로 최종 저장됨 1.2...99 이면 99로 저장됨 ) Map targetMap = new Map(); for (String str : targetLis..