Trailhead Challenge – Mark Item as Packed
Mark Item as Packed
Add a button to the campingListItem component that when clicked, marks the item as packed.
- Add a button labelled Packed! that calls the packItem controller function when clicked.
- The controller function should do the following:
- Mark the item attribute as packed using a value of true
- Disable the button by marking the disabled attribute using a value of true
https://trailhead.salesforce.com/modules/lex_dev_lc_basics/units/lex_dev_lc_basics_controllers
Solution
In this challenge, we need to add a button to the previously created campingListItem component. The attribute values of the button is
- Label – packed!
- Handler– Onclick- {c.packedItem}
The click event handler of the button should have update the item.Packed__c to true and it’s disabled attribute to true.
References
TrailHead:https://trailhead.salesforce.com/modules/lex_dev_lc_basics/units/lex_dev_lc_basics_controllers:
Don’t forget to share the post if you like it & bookmark the blog for future references. If you have any comments or doubts on this post, Please comment on the box.
Advertisements