You need to sign in to do that
Don't have an account?

lightning:datatable custom row selection
Hi,
Is there a way to enable row selection when a user clicks on the row of datatable, rather than just on the checkbox/radio button?
I'd imagine I could do this through a combonation of jquery and using the selectedRows object that is provided.
However I'd like to avoid that in favor of a method that would use just the default functionality of the datatable, I'm just not sure how to do that if its currently possible.
Thanks
Is there a way to enable row selection when a user clicks on the row of datatable, rather than just on the checkbox/radio button?
I'd imagine I could do this through a combonation of jquery and using the selectedRows object that is provided.
However I'd like to avoid that in favor of a method that would use just the default functionality of the datatable, I'm just not sure how to do that if its currently possible.
Thanks
There is already an event available with lightning:datatable to do this.
http://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_datatable.htm
Example below: Hope the above answer helps and please mark as correct answer so others can benefit from it.