You need to sign in to do that
Don't have an account?
golu
code to display the lighting output from the controller:
Hi,
i have created a component having three checkboxes - course 1 , course 2 and course 3.
also i have a button to select all courses.
My requirement is running a soql query and displaying the count of records for each course type ( the ones which are selected)
So far i have written this code:
SelectCheckBox.js
Can you all please give a sample code to proceed forward for the requirement?
Thanks
i have created a component having three checkboxes - course 1 , course 2 and course 3.
also i have a button to select all courses.
My requirement is running a soql query and displaying the count of records for each course type ( the ones which are selected)
So far i have written this code:
<aura:component access="global"> <aura:attribute name="selected" type="List" default="[]"/> <aura:attribute name="options" type="List" default="[{'label': 'Course 1', 'value': 'option1'}, {'label': 'Course 2', 'value': 'option2'},{'label': 'Course 3', 'value': 'option3'}]"/> <lightning:checkboxGroup aura:id="mygroup" name="checkboxGroup" label="Checkbox Group" options="{!v.options}" value="{!v.selected}" onchange="{!c.handleChange}" required="true" /> <br/><br/> <lightning:button variant="brand" label="Select All" onclick="{!c.selectAll}"/> </aura:component>
SelectCheckBox.js
({ selectAll : function(component, event, helper) { component.set("v.selected",['option1','option2','option3']); }, handleChange : function(component, event, helper) { }, })
Can you all please give a sample code to proceed forward for the requirement?
Thanks
If you are looking for fetching course data on just selection of checkbox or all the checkbox then follow below code for your reference:
Hope this will help you...
Thanks,
Sanjay
Hi Golu,
.cmp
JsController courseController .apxcHope, this will help you
Thanks