0

I have the following datatable and on the click of a button, I would like to get all of the record Ids to put in a list. However, when I try the method below I am getting a proxy object. I know this has to do with locker service. Is there a way to query the Proxy object so I can pull the Ids into a list? thanks!!

Datatable

<!-- Start List of Group Structure List-->
<div if:true={isViewList} class="slds-modal__content slds-p-around_medium"> 
    <div class="container">
        <!-- Start List of Group Structures-->
            <lightning-layout horizontal-align="spread" > 
                <lightning-layout-Item size="12" class= "slds-size_2-of-2">
                    <div class="slds-var-m-vertical_medium">
                        <c-pagination records={filteredgroupstructures} onupdate={updateGsHandler}></c-pagination>
                    </div>
                
                    <template if:true={filteredgroupstructures}>
                        <lightning-datatable
                                id="pdftable"
                                data={visibleGroupStructures}
                                columns={columns}
                                column-widths-mode={auto}
                                key-field="Id"
                                sorted-by={sortBy}
                                sorted-direction={sortDirection}
                                onsort={handleSortdata}
                                onrowaction={handleRowActions}
                                draft-values={draftValues}
                                onsave={handleSave}
                                onerror={handleError}
                                wrap-text-max-lines=3>
                        </lightning-datatable>
                    </template>
                <template if:true={error}>
                                {error}
                </template>
                    </lightning-layout-Item>
                </lightning-layout>

    </div>
</div>  

Method called on button click

cloneRecords(){

  var selectedRecords =  this.template.querySelector('lightning-datatable').getSelectedRows();  
  this.currentRecordIds = selectedRecords;
  console.log('selectedRecords are ',this.currentRecordIds);
}
1
  • 2
    JSON.parse(JSON.stringify(proxy.object))
    – glls
    Sep 20 at 15:39