how to implement enter key press for search functionality on lightning page? i have a search button which is working on the functionality but how do i make it work by using the enter key as well
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Apex:
public class SearchKeyupC {
@AuraEnabled
public static List<Account> search(String key){
String keyword = key + '%' ;
List<Account> sr = [SELECT Name, Phone, Rating FROM Account WHERE Name LIKE:keyword];
return sr;
}
}
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Greetings to you!
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Apex:
Component:
Controller:
CSS:
Application:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
please find this as wel
https://developer.salesforce.com/forums/?id=906F0000000BP92IAG
Please mark this if it justify your requirement