즐겨찾기SFDC Forum (g) 님이 #Lightning Experience에 질문했습니다2020년 5월 19일 오전 9:34Lightning Data table onrowselection issueI have created data table, as below. I am getting selectedRows is [object Object] in console when i select any row.i supposed to get array of selected row.I guess i have done some mistake in declaration of attributes (columns, data).Please clarify asap.Component:::<aura:component controller="ContactTopTen" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:attribute name="columns" type="List" /> <aura:attribute name="data" type="Object" /> <aura:handler name="init" value="{! this }" action="{! c.init }"/> <lightning:datatable aura:id="contactTable" keyField="id" data="{!v.data}" columns="{!v.columns}" hideCheckboxColumn="false" onrowselection="{!c.doSelect}" /> </aura:component>Controller:({ init : function(component, event, helper) { component.set('v.columns',[ {label: 'Account Name', fieldName: 'Name', type: 'text', sortable: true}, {label: 'Rating', fieldName: 'Rating', type: 'text', sortable: true}, ]); var action=component.get('c.getCon'); action.setCallback(this, function(response){ var state=response.getState(); if(state==='SUCCESS' || state==='DRAFT') { var responseValue=response.getReturnValue(); component.set('v.data', responseValue); } }); $A.enqueueAction(action,false); }, doSelect:function(component, event, helper) { alert('Success'); var selectedRows=event.getParam('selectedRows'); console.log('selectedRows is : ' +selectedRows); }})Apex class:public class ContactTopTen { @AuraEnabled public static List<Account> getCon(){ List<Account> con=[select Name,Id, Rating from Account Limit 5]; return con; }} 더 보기답변 6개정렬날짜별 정렬가장 유용한 항목별 정렬날짜별 정렬댓글 더 보기...인정받은 답변Tushar Sharma (Briskminds Software Solutions PVT. LTD.)2020년 5월 19일 오전 11:24SFDC Forum 9, iterate that array, and using dot notation you can access all available fields. If this answer helps you, please mark it as accepted. 댓글 추가답변을 작성하세요...굵은 글꼴기울인 글꼴밑줄취소선불릿 기호 목록번호가 지정된 목록링크 추가코드 블록이미지 삽입파일 첨부링크 URL취소저장0/9000답글 쓰기
인정받은 답변Tushar Sharma (Briskminds Software Solutions PVT. LTD.)2020년 5월 19일 오전 11:24SFDC Forum 9, iterate that array, and using dot notation you can access all available fields. If this answer helps you, please mark it as accepted.