Created
April 30, 2018 09:33
-
-
Save anilsomasundaran/2131c90f39e6630c4711f1914438b764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
addClass : function (element, className) { | |
//Global Aura util method for adding a style class from an aura element | |
$A.util.addClass(element,className); | |
}, | |
removeClass : function (element , className) { | |
//Global Aura util method for removing a style class from an aura element | |
$A.util.removeClass(element,className); | |
}, | |
showElement : function (element) { | |
//To show an aura html element | |
var self = this; | |
self.removeClass(element,'slds-hide'); | |
self.addClass(element,'slds-show'); | |
}, | |
hideElement : function (element) { | |
//To hide an aura html element | |
var self = this; | |
self.removeClass(element,'slds-show'); | |
self.addClass(element,'slds-hide'); | |
}, | |
searchContent : function (component,searchContent) { | |
//The helper method calls sets the matched search content to component view | |
//Now, it is returing some dummy records | |
//Note - In your application - you should call the server method here with search query string | |
//(searchContent)as parameter. | |
//Matched records should sets to v.fetchedRecords attribute. | |
var record = [{"name": "Account1","description":"Account . Location1"}, | |
{"name": "Account2","description":"Account . Location2"}, | |
{"name": "Account3","description":"Account . Location3"}, | |
{"name": "Account4","description":"Account . Location4"}, | |
{"name": "Account5","description":"Account . Location5"}, | |
{"name": "Account6","description":"Account . Location6"}, | |
{"name": "Account7","description":"Account . Location7"} | |
]; | |
component.set("v.fetchedRecords",record); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment