You need to sign in to do that
Don't have an account?
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);
} })
>> 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.
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