Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created March 31, 2016 00:54
Show Gist options
  • Save msrivastav13/50ff0157d7ce2c2fc917e43836047345 to your computer and use it in GitHub Desktop.
Save msrivastav13/50ff0157d7ce2c2fc917e43836047345 to your computer and use it in GitHub Desktop.
This shows how to work through navigation and encode the Topic Search String
if (component.isValid() && state === "SUCCESS") {
for (i = 0; i < response.getReturnValue().length; i++) {
var topic = {};
topic = { 'sobjectType': 'Topic','Name': '' ,'Id' :'','Label' :''};
topic.Name = encodeURIComponent(response.getReturnValue()[i].Name);
topic.Label = response.getReturnValue()[i].Name;
topic.Id = response.getReturnValue()[i].Id;
topicslst.push(topic);
}
console.log('TOPICS..'+topicslst);
component.set("v.lsttopics", topicslst);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment