You need to sign in to do that
Don't have an account?
Lee Anne G
lightning component equivalent of pageblocktable with radio input
Hi, I need to show a list of returned rows with a radio input in a lightning component. In visualforce it would look like this:
How do we achieve the same result in a lightning component? In my test component, I have the following markup:
with my controller:
I just don't know how to turn this datatable into the radioGroup that I need. All I can find examples of are of Yes/No or dynamic single columns of data for radio input.
Thanks!
<apex:pageblocktable value="{!addresses}" var="pro" rendered="{!NOT(ISNULL(addresses))}"> <apex:column headerValue="Select Address"> <apex:actionSupport action="{!getValue}" event="onclick" reRender=""> <input type="radio" name="<strong>selectRadio</strong>" id= "radio"/> <apex:param name="proid" value="{!pro.id}" assignTo="{!paramValueFromPage}"> </apex:param> </apex:actionSupport> </apex:column> <apex:column value="{!pro.Name}"/> <apex:column value="{!pro.Account__r.Name}"/> <apex:column value="{!pro.Account__r.Site__c}"/> <apex:column value="{!pro.Address1__c}"/> <apex:column value="{!pro.Addressee__c}"/> </apex:pageBlocktable>
How do we achieve the same result in a lightning component? In my test component, I have the following markup:
<aura:handler name="init" value="{!this}" action="{!c.getProfilesList}" /> <lightning:datatable data="{! v.Profiles }" columns="{! v.Columns }" keyField="Id" hideCheckboxColumn="false"/>
with my controller:
({ getProfilesList : function(component, event, helper) { component.set("v.Columns", [ {label:"Profile Number", fieldName:"Name", type:"text"}, {label:"Attention", fieldName:"Address_Line_1__c", type:"text"}, {label:"Company/Addressee", fieldName:"Company_Addressee__c", type:"text"}, {label:"Profile Type", fieldName:"Profile_Type__c", type:"text"}, {label:"Ship To Contact", fieldName:"Ship_to_Contact_Name__c", type:"text"} ]); var action = component.get("c.getProfiles"); action.setParams({ recordId: component.get("v.recordId") }); action.setCallback(this, function(data) { component.set("v.Profiles", data.getReturnValue()); }); $A.enqueueAction(action); } })
I just don't know how to turn this datatable into the radioGroup that I need. All I can find examples of are of Yes/No or dynamic single columns of data for radio input.
Thanks!