function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Please refer the link (https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation) and go to 'Selecting Rows Programmatically' section
Yes you can perselect the rows by using the wrapper class or set the selectedRows (set the record Id's array) in component load JS (aura : doInit , Lwc : Connectcallback).
Refer the below sample codes surely it will help you.
For Aura :
https://gist.github.com/sumugapadman/b31488774df70e50c9f8bf64d3c9ac33
https://salesforce.stackexchange.com/questions/268067/stuck-trying-to-preselect-rows-in-data-table
For LWC:
https://www.salesforcepoint.com/2020/07/preselected-checkbox-data-table-Lwc.html
Thanks.
Maharajan.C
Default option is not available but you can set auto select when your component compleate load from controller .
below is sample code
https://initaura.com/lightning-component-show-check-boxes-for-a-records-list-and-display-selected-record/
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh