Skip to content

Instantly share code, notes, and snippets.

View sfcure's full-sized avatar
🎯
Focusing

sfcure

🎯
Focusing
View GitHub Profile
<application extends="force:slds>
<!-- customize your application here -->
</aura:application>
@sfcure
sfcure / JqueryDatePicker.cmp
Created July 27, 2018 10:48
Jquery Datepicker in Lightning Components for better control on behaviour of Datepicker
<aura:component >
<ltng:require scripts="{!join(',', $Resource.jquery_2_2_4, $Resource.jquery_ui_1_12_1 + '/jquery-ui-1.12.1/jquery-ui.min.js')}"
afterScriptsLoaded="{!c.afterScriptsLoaded}"
styles="{!$Resource.jquery_ui_1_12_1 + '/jquery-ui-1.12.1/jquery-ui.min.css'}"
/>
Birth Date: <input aura:id="birthdate" class="datepicker" type="text"/>
</aura:component>
public class ContactTriggerHandler extends TriggerHandler {
public override void beforeInsert() {
// Call the static method to populate the address
ContactTriggerHandler.populateMailingAddress( (List<Contact>) Trigger.new );
}
public override void beforeUpdate() {
@sfcure
sfcure / AccountEditController.apxc
Last active May 27, 2022 08:47
Get field labels dynamically in the lightning component
public class AccountEditController {
@AuraEnabled
public static String getObjectType() {
// Passing the sObject name in the method, it could be multiple objects too
return Utility.getDescribedObjects( new List<String>{'Account'} );
}
}
@sfcure
sfcure / CreditCardSetting.cmp
Last active October 27, 2020 19:03
Lightning Component for Insert/Update Custom Metadata Type Records
<aura:component implements="force:appHostable" controller="CreditCardSettingsController">
<aura:attribute name="data"
type="Object"/>
<aura:attribute name="columns"
type="List"/>
<aura:attribute name="record"
type="Object"/>
@sfcure
sfcure / ResizableTable.cmp
Created May 4, 2018 13:35
Resizable Data Table ( Lightning Design System )
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
<aura:attribute name="mouseStart" type="string" />
<aura:attribute name="newWidth" type="string" />
<aura:attribute name="currentEle" type="Object" />
<div class="container" onmouseup="{!c.resetColumn}">
<div class="slds-table--header-fixed_container slds-scrollable_x">
<div class="">
<table class="slds-table slds-table--header-fixed slds-table_bordered slds-table_edit slds-table_resizable-cols" style="table-layout:fixed">
<thead>
@sfcure
sfcure / UploadAttachment.page
Last active December 1, 2017 08:35
Upload Attachment through Force.com sites
<apex:page controller="UploadAttachmentController">
<script type="text/javascript">
function alertFilesize(){
if(window.ActiveXObject){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var filepath = document.getElementById('j_id0:j_id2:fileInput').value;
var thefile = fso.getFile(filepath);
var sizeinbytes = thefile.size;
}else{
var sizeinbytes = document.getElementById('j_id0:j_id2:fileInput').files[0].size;