Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
@msrivastav13
msrivastav13 / SearchController.apex
Created March 16, 2016 14:06
Apex class for searching Topic and Users
public with sharing class SearchController {
@AuraEnabled
public static list<UserWrapper> searchPeople(String searchString){
list<UserWrapper> lstusers = new list<UserWrapper>();
Id communityId = Network.getNetworkId();
Id networkId = [Select Name, Id From Network where Id =:;//Fetch the community Id of the Current User
searchString = '%' + searchString + '%';
//Get User records as per search keyterm
map<id,User> mapIdByUser = new map<id,User>([Select Id,
<apex:page showHeader="false" sidebar="false">
<apex:includeLightning />
<div id="lightning"> Hello world VF ..!!! </div>
<script>
$Lightning.use("c:myEventApp", function() {
$Lightning.createComponent("c:myComponent", {}, "lightning", function(){
$A.eventService.addHandler({ "event": "c:myEvent", "handler" : visualForceFunction});
});
<aura:component>
<div> Hello World !!!! </div>
<aura:registerEvent name="myevent" type="c:myEvent" />
<ui:button label="fireEvent" press="{!c.fireevent}" />
</aura:component>
<apex:page showHeader="true" sidebar="true">
<apex:includeLightning />
<div id="lightning"> hello World VF!! </div>
<script>
$Lightning.use("c:sampleApp", function() {
$Lightning.createComponent("c:sampleComponent", {},
"lightning",
function(cmp) {
var myExternalEvent;
myExternalEvent = $A.get("e.c:sampleEvent");
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="c:sampleComponent" />
</aura:application>
<aura:event type="APPLICATION">
<aura:attribute name="userId" type="String"/>
</aura:event>
({
toggleClass: function(component,componentId,className) {
var modal = component.find(componentId);
$A.util.removeClass(modal,className+'hide');
$A.util.addClass(modal,className+'open');
},
toggleClassInverse: function(component,componentId,className) {
var modal = component.find(componentId);
$A.util.addClass(modal,className+'hide');
({
showOppmodal: function(component, event, helper) {
//Toggle CSS styles for opening Modal
helper.toggleClass(component,'backdrop','slds-backdrop--');
helper.toggleClass(component,'modaldialog','slds-fade-in-');
helper.getopportunitylst(component,event);
},
hideModal : function(component, event, helper) {
//Toggle CSS styles for hiding Modal
<div class="slds">
<div aria-hidden="true" role="dialog" class="slds-modal slds-modal--large slds-fade-in-hide" aura:id="modaldialog">
</div>
<!--Other markups-->
<div class="slds-backdrop slds-backdrop--hide" aura:id="backdrop">
</div>
@msrivastav13
msrivastav13 / FuncommunityController.apex
Created January 31, 2016 01:10
FuncommunityController
public class FuncommunityController {
@AuraEnabled
public static String fetchTopicName(String topicname){
system.debug(topicname);
return topicname;
}
}