function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManjusrinuManjusrinu 

Display Project records on click of input filed

Hi ,

I am new to aura components . I have field where project records are to be displayed .On click of field I should get project records. I have tried and able to display input field ,but for displaying project records , i have no idea on how to do .Can anyone help me to solve my requirement .

<aura:component >
<div class="slds-align_absolute-center">
<lightning:layoutItem size="4"> <table> <tr>
<td style="padding:20px;">
<lightning:input type="sObject" aura:id="test" name="Project" label="Project" value="" placeholder="search project" onClick="{!c.handleClick}"/>
</td></tr>
</table>
</lightning:layoutItem>
</div>
</aura:component>
**Controller :**
public class ListOfProjects{
@AuraEnabled
public static List<project__c> getProjectList() {
List<project__c> myProjects = [SELECT Name from project__c ]; return myProjects;
}
}
**.Js file :**
({
handleClick : function(component, event, helper) {
var action = component.get("c.getProjectList");
action.setCallback(this, function(response) { console.log(response.getReturnValue());
component.set("v.Projects" ,response.getReturnValue());
});
$A.enqueueAction(action);
} })

My required outputCurrent output

ANUTEJANUTEJ (Salesforce Developers) 
Hi Manjusrinu,

>> https://sfdcmonkey.com/2016/12/15/search-accounts-lightning-component/

The above link has an implementation of showing records with an ability to search records can you try checking it once?

Let me know if it helps you and close your query by marking it as the best answer so that it can help others in the future.  

Thanks.
ManjusrinuManjusrinu


Hi ANUTEJ

https://sfdcmonkey.com/2016/12/15/search-accounts-lightning-component/

Here we are displaying the records using custom  table , but i need to get the records down to the input field itself 

I should get the output like the below image This should be done when i click on the input field