Skip to content

Instantly share code, notes, and snippets.


Keir Bowden keirbowden

View GitHub Profile
keirbowden / TableSortingCtrl.cls
Last active Aug 29, 2015
Custom controller for the table sorting blog post
View TableSortingCtrl.cls
public with sharing class TableSortingCtrl {
public List<Account> accounts {get; set;}
public TableSortingCtrl()
accounts=[select id, CreatedDate, Name, BillingStreet,
BillingState, BillingCity,
BillingPostalCode, BillingCountry
from Account
where BillingPostalCode!=null
keirbowden /
Created Sep 20, 2014
Demo page for Visualforce and tablesorter
<apex:page sidebar="true" controller="TableSortingCtrl">
value="//" />
value="//" />
value="//" />
<apex:datatable value="{!accounts}" var="acc" id="accsTable" styleclass="tablesorter">
<apex:column headerValue="Created">
keirbowden / RequiredCtrl.cls
Created Sep 27, 2014
Action Region, Required Fields and HTML5 Controller
View RequiredCtrl.cls
public with sharing class RequiredCtrl
public List<Row> rows {get; set;}
public String name {get; set;}
public Account acc {get; set;}
public RequiredCtrl()
rows=new List<Row>();
rows.add(new Row());
keirbowden /
Created Sep 27, 2014
Action Region, Required Field and HTML5 Page
<apex:page controller="RequiredCtrl" tabstyle="Account" doctype="html-5.0">
<apex:pageMessages id="msgs"/>
<apex:pageBlock mode="maindetail">
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}" />
<apex:pageBlockSection title="Account Information">
<apex:outputlabel value="Name"/>
keirbowden / gist:a1e624fbc596f0b71ea4
Created Apr 18, 2015
Accounts List Lightning Component
View gist:a1e624fbc596f0b71ea4
<aura:component controller="AccountsListController" implements="flexipage:availableForAllPageTypes">
<link href="/resource/Bootstrap_3_3_2/bootstrap-3.3.2-dist/css/bootstrap.min.css" rel="stylesheet" />
<link class="user" href="/resource/Bootstrap_3_3_2/bootstrap-3.3.2-dist/css/bootstrap-theme.min.css"
rel="stylesheet" type="text/css" />
<aura:attribute name="accounts" type="Account[]" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<div class="container-fluid">
<div class="row-fluid">
keirbowden / gist:c99015c1006f7a14f08d
Created Apr 18, 2015
Accounts List JavaScript Component
View gist:c99015c1006f7a14f08d
<apex:component >
var accsListCtrl={
// renders the HTML to display the supplied accounts in bootstrap panels
renderAccs : function(accounts) {
var markup='';
$.each(accounts, function(idx, acc) {
markup+= ' <div class="row-fluid"> \n' +
' <div class="col-xs-12 fullwidth"> \n' +
' <div class="panel panel-primary"> \n' +
keirbowden / RWDCaseAppController.js
Last active Aug 29, 2015
JavaScript Controller for the RWDCases Lightning App
View RWDCaseAppController.js
doInit : function(component, event, helper) {
keirbowden / RWDCaseAppHelper.js
Last active Aug 29, 2015
JavaScript Helper for the Lightning App to Render Cases
View RWDCaseAppHelper.js
getCases : function(component) {
var action = component.get("c.GetRecentCases");
var self = this;
action.setCallback(this, function(a) {
var cases=a.getReturnValue();
console.log('Result = ' + JSON.stringify(cases));
component.set("v.cases", cases);
keirbowden / CasesController.cls
Created May 3, 2015
Apex Controller for the Case Render App
View CasesController.cls
public class CasesController {
public static List<Case> GetRecentCases()
List<Case> cases=[select id, CaseNumber, Subject, CreatedDate, Status, Priority
from Case
order by CreatedDate desc
limit 5];
return cases;
keirbowden /
Last active Aug 29, 2015
Lightning Application to Retrieve Cases and Iterate
<aura:application controller="CasesController">
<aura:attribute type="Case[]" name="cases" description="casesToIterate" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:iteration items="{!v.cases}" var="case">
<c:RWDCase case="{!case}" />
You can’t perform that action at this time.