SlideShare a Scribd company logo
SPS Omaha Mark Rackley
mrackley@paitgroup.com
Utilizing jQuery in SharePoint: Get More Done Faster
© 2015 PAIT Group
Mark Rackley / Partner & CSO
• 20+ years software
architecture and
development experience
• Office 365 MVP, SharePoint
Junkie since 2007
• Event Organizer
(SharePointalooza.org)
• Blogger, Writer, Speaker
• Bacon aficionado
@mrackley
www.MarkRackley.net
www.PAITGroup.com
www.SharePointaLooza.org
www.StratusForms.com
#SayNoToInfoPath
© 2015 PAIT Group
Agenda
• What is jQuery?
• Why SharePoint & jQuery?
• Deploying / Maintaining
• Development Basics
• Third Party Libraries
• jQuery UI Demo
© 2015 PAIT Group
What is jQuery?
• JavaScript Utility Library
• jQuery() or $()
• Allows interaction and manipulation of the DOM
after page is rendered
• Can interact with other systems using Web Services
• Supported by Microsoft
• Part of “Client Side” Development
Why SharePoint & jQuery?
© 2015 PAIT Group
Why SharePoint & jQuery?
Turn This…
© 2015 PAIT Group
Why SharePoint & jQuery?
Into This…
http://www.markrackley.net/2015/08/16/sharepoint-tabbed-web-partshillbillytabs-3-0/
© 2015 PAIT Group
Why SharePoint & jQuery?
And This…
© 2015 PAIT Group
Why SharePoint & jQuery?
Into This…
http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
© 2015 PAIT Group
Why SharePoint & jQuery?
© 2015 PAIT Group
Why SharePoint & jQuery?
• Let SharePoint do the heavy lifting!
• Page Modifications
• Remove Clutter
• Improve Flow
• Add business logic to forms
• Call Web Services
• Basic Workflow
• Create/update/delete items based on user choices
• Pull data in from other lists and sites
• Create dashboards
• TONS of free 3rd party libraries
• Graphs, charts, dialogs, animations, etc
© 2015 PAIT Group
jQuery & SharePoint Basics
The development process:
• Create a Script
• Add script to a page in SharePoint
• Viola!
Why?
• Works in SharePoint 2007,2010,2013, & O365
• Great stepping stone to SharePoint Hosted whatever-they’re-
called-today
• No Visual Studio
• No Add-in model
• No Oauth (yay!)
© 2015 PAIT Group
jQuery & SharePoint Basics
• Scripts execute with same privileges as current user
• Permissions cannot be elevated
• Interact with SharePoint List data using JavaScript Client Side Object Model
(JSOM), REST, or SPServices
• Deployment options
• Add-In Model
• Sandbox Solutions
• Manual
• SharePoint Framework???
© 2015 PAIT Group
jQuery Methods Commonly Used in SharePoint
•Learn how SharePoint builds a
page and how to traverse the
DOM
• Show / Hide information
• Get / Set field values
• Bind to events on elements
© 2015 PAIT Group
jQuery Basics
<script type="text/javascript">
$(document).ready(function($){
//this script executes after the page is loaded
//if you need to interact with the DOM put script here
})
//Script placed here would execute before the page is finished loading.
</script>
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve the element by ID:
$(“#myID”);
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve the element by attribute:
$(“div[attribute=‘myAttribute’]”);
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve every div on the page
$(“div”).each(function() {
//”this” is the current element in each loop
$(this).method();
});
//Hide all divs on the page
$(“div”).hide();
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve every div of a specific class
$(“div.myClass”).each(function() {
//”this” is the current element in each loop
$(this).method();
});
//Hide all divs of a specific class on the page
$(“div.myClass”).hide();
//Hide all elements of a specific class on the page
$(“.myClass”).hide();
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve the div that contains content “World”
$(“div:contains(‘World’)”).each(function() {
//”this” is the current element in each loop
$(this).method();
});
© 2015 PAIT Group
jQuery Basics
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve the formatted HTML for an element
$(“#myID”).html(); //returns <b>Hello World</b>
//Set the formatted HTML for an element
$(“#myID”).html(“<b>Hello Nurse</b>”);
//Retrieve the text with HTML formatting stripped out
$(“#myID”).text(); //returns Hello World
//Set the unformatted text of an element
$(“#myID”).text(“Hello Nurse”);
© 2015 PAIT Group
MORE jQuery basics
• //get input / select values
• $(“#id”).val();
• //set input / select values
• $(“#id”).val(“value”);
• //uncheck a check box
• $(“#id").removeAttr('checked');
• //check a check box
• $(“#id").attr('checked','checked');
• //is a check box checked?
• if ($(“#id”).is(':checked'))
© 2015 PAIT Group
MORE jQuery basics
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
© 2015 PAIT Group
MORE jQuery basics
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
• //get the row that contains the div “myElement”
• $(“#myElement”).closest(“tr”);
• //get the cell that contains the div “myElement”
• $(“#myElement”).closest(“td”);
• Or
• $(“#myElement”).parent();
© 2015 PAIT Group
MORE jQuery basics
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
• //get the div AFTER myElement
• $(“#myElement”).next(“div”);
• Or
• $(“#myElement”).next();
• //get the div BEFORE myOtherelement
• $(“#myOtherElement”).prev(“div”);
• Or
• $(“#myOtherElement”).prev();
© 2015 PAIT Group
Chaining
• //find the input element that has the “title” attribute equal to “Name”
• //then find it’s parent cell’s previous cell. Then find the “h3” element and replace the HTML
• $("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <font color='red'>*</font>");
• //In English: Find the label for the field “Name” and change it to “File Name” and add a red astrisk
• //find the input element that has the “title” attribute equal to “City”
• //then hide the entire row that contains the input
• $(“input[title=‘City’]”).closest(“tr”).hide();
• //In English: Hide the SharePoint Form Field and label for the field with the Display
• //name “City”
© 2015 PAIT Group
How About Some Best Practices?
• Use the Element’s ID when possible
• Reduce DOM searches
• Re-use code / Good coding practices
• Minimize files
• Use animations to hide slow performance
• Delay loading of Selects until you need the data
© 2015 PAIT Group
Using Third Party Libraries
• Tips for selection and integration
• Look for supported / documented libraries
• Test in target browsers before implementing
• Duplicate file structure
• Test “vanilla” in SharePoint first
© 2015 PAIT Group
Using Third Party Libraries
• Some of my favorites
• Content Slider - http://unslider.com
• Formatted Tables - http://www.datatables.net/
• Modal Window - http://www.ericmmartin.com/projects/simplemodal/
• Calendar - http://arshaw.com/fullcalendar/
• StratusForms #SayNoToInfoPath – http://www.stratusforms.com
• Draw on a canvas - http://intridea.github.io/sketch.js/
• Responsive tiles - http://masonry.desandro.com/
• Flip w/ 3D animation - https://nnattawat.github.io/flip/
Let’s DO some stuff!!!
I know!! It’s about time? Right?
© 2015 PAIT Group
jQueryUI
•http://jqueryui.com/
•jQuery UI is a curated set of user interface
interactions, effects, widgets, and themes built on
top of the jQuery JavaScript Library. Whether you're
building highly interactive web applications or you
just need to add a date picker to a form control,
jQuery UI is the perfect choice.
© 2015 PAIT Group
jQueryUI– Basic Usage - Tabs
<div id="tabs">
<ul>
<li><a href="#tabs-1">Tab 1 title</a></li>
<li><a href="#tabs-2">Tab 2 title</a></li>
<li><a href="#tabs-3">Tab 3 title</a></li>
</ul>
<div id="tabs-1">
<p>content in tab 1</p>
</div>
<div id="tabs-2">
<p>content in tab 2</p>
</div>
<div id="tabs-3">
<p>content in tab 3</p>
</div>
</div>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
jQuery UI Tabs Demo
http://www.markrackley.net/2015/08/16/share
point-tabbed-web-partshillbillytabs-3-0
Some More Demos??
Thank you
http://www.paitgroup.com
http://www.markrackley.net
mrackley@paitgroup.com
@mrackley
© 2016 PAIT Group http://www.PAITGroup.com December 14,2016

More Related Content

What's hot

Introduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPathIntroduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPath
Mark Rackley
 
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint LimitationsSPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
Mark Rackley
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
Mark Rackley
 
NOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need itNOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need it
Mark Rackley
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesMark Rackley
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014Mark Rackley
 
SPUnite17 Transforming your Organisation into a Digital Workplace
SPUnite17 Transforming your Organisation into a Digital WorkplaceSPUnite17 Transforming your Organisation into a Digital Workplace
SPUnite17 Transforming your Organisation into a Digital Workplace
NCCOMMS
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
Mark Rackley
 
SPUnite17 Migrating your Customizations from On-prem to SharePoint Online
SPUnite17 Migrating your Customizations from On-prem to SharePoint OnlineSPUnite17 Migrating your Customizations from On-prem to SharePoint Online
SPUnite17 Migrating your Customizations from On-prem to SharePoint Online
NCCOMMS
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
Mark Rackley
 
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Wendy Neal
 
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
Jennifer Kenderdine
 
Using jQuery to Maximize Form Usability
Using jQuery to Maximize Form UsabilityUsing jQuery to Maximize Form Usability
Using jQuery to Maximize Form Usability
Mark Rackley
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
Philly Code Camp Oct SharePoint/Office 365 Developer Best Practices
Philly Code Camp Oct SharePoint/Office 365 Developer Best PracticesPhilly Code Camp Oct SharePoint/Office 365 Developer Best Practices
Philly Code Camp Oct SharePoint/Office 365 Developer Best Practices
Jennifer Kenderdine
 
SPSSTHLM - Using JSLink and Display Templates for ITPros
SPSSTHLM - Using JSLink and Display Templates for ITProsSPSSTHLM - Using JSLink and Display Templates for ITPros
SPSSTHLM - Using JSLink and Display Templates for ITPros
Paul Hunt
 
Modern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the UglyModern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the Ugly
Bob German
 
How to Make the Most of Google Analytics on Your Evoq Site
How to Make the Most of Google Analytics on Your Evoq SiteHow to Make the Most of Google Analytics on Your Evoq Site
How to Make the Most of Google Analytics on Your Evoq Site
DNN
 
Empower The Power User by @KerriAbraham and @SharePointWendy
Empower The Power User by @KerriAbraham and @SharePointWendyEmpower The Power User by @KerriAbraham and @SharePointWendy
Empower The Power User by @KerriAbraham and @SharePointWendy
Wendy Neal
 

What's hot (20)

Introduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPathIntroduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPath
 
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint LimitationsSPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 
NOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need itNOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need it
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
 
SPUnite17 Transforming your Organisation into a Digital Workplace
SPUnite17 Transforming your Organisation into a Digital WorkplaceSPUnite17 Transforming your Organisation into a Digital Workplace
SPUnite17 Transforming your Organisation into a Digital Workplace
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
 
SPUnite17 Migrating your Customizations from On-prem to SharePoint Online
SPUnite17 Migrating your Customizations from On-prem to SharePoint OnlineSPUnite17 Migrating your Customizations from On-prem to SharePoint Online
SPUnite17 Migrating your Customizations from On-prem to SharePoint Online
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
Enhance the Usability of Your SharePoint Site with JSLink #Collab365 #C365114...
 
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
Using Client Side Technologies to create a dynamic org chart in SharePoint 20...
 
Using jQuery to Maximize Form Usability
Using jQuery to Maximize Form UsabilityUsing jQuery to Maximize Form Usability
Using jQuery to Maximize Form Usability
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
 
Philly Code Camp Oct SharePoint/Office 365 Developer Best Practices
Philly Code Camp Oct SharePoint/Office 365 Developer Best PracticesPhilly Code Camp Oct SharePoint/Office 365 Developer Best Practices
Philly Code Camp Oct SharePoint/Office 365 Developer Best Practices
 
SPSSTHLM - Using JSLink and Display Templates for ITPros
SPSSTHLM - Using JSLink and Display Templates for ITProsSPSSTHLM - Using JSLink and Display Templates for ITPros
SPSSTHLM - Using JSLink and Display Templates for ITPros
 
Modern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the UglyModern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the Ugly
 
How to Make the Most of Google Analytics on Your Evoq Site
How to Make the Most of Google Analytics on Your Evoq SiteHow to Make the Most of Google Analytics on Your Evoq Site
How to Make the Most of Google Analytics on Your Evoq Site
 
Empower The Power User by @KerriAbraham and @SharePointWendy
Empower The Power User by @KerriAbraham and @SharePointWendyEmpower The Power User by @KerriAbraham and @SharePointWendy
Empower The Power User by @KerriAbraham and @SharePointWendy
 

Similar to Utilizing jQuery in SharePoint: Get More Done Faster

The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
Mark Rackley
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
Spunite17 Converting your CEWP Customisations
Spunite17 Converting your CEWP CustomisationsSpunite17 Converting your CEWP Customisations
Spunite17 Converting your CEWP Customisations
NCCOMMS
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
Ivano Malavolta
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in Production
BoldRadius Solutions
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Anupam Ranku
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
Quick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusFormsQuick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusForms
April Dunnam
 
Telerik Reporting for HTML 5 Apps
Telerik Reporting for HTML 5 AppsTelerik Reporting for HTML 5 Apps
Telerik Reporting for HTML 5 Apps
Muhammad Umar
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Doris Chen
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Brian Culver
 
webdevelopment_6132030-lva1-app6891.pptx
webdevelopment_6132030-lva1-app6891.pptxwebdevelopment_6132030-lva1-app6891.pptx
webdevelopment_6132030-lva1-app6891.pptx
lekhacce
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
Rene Modery
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
Mike Wilcox
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
MVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View ComponentsMVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View Components
David Paquette
 

Similar to Utilizing jQuery in SharePoint: Get More Done Faster (20)

The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
 
Spunite17 Converting your CEWP Customisations
Spunite17 Converting your CEWP CustomisationsSpunite17 Converting your CEWP Customisations
Spunite17 Converting your CEWP Customisations
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in Production
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
Quick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusFormsQuick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusForms
 
Telerik Reporting for HTML 5 Apps
Telerik Reporting for HTML 5 AppsTelerik Reporting for HTML 5 Apps
Telerik Reporting for HTML 5 Apps
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
webdevelopment_6132030-lva1-app6891.pptx
webdevelopment_6132030-lva1-app6891.pptxwebdevelopment_6132030-lva1-app6891.pptx
webdevelopment_6132030-lva1-app6891.pptx
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and Servers
 
MVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View ComponentsMVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View Components
 

More from Mark Rackley

Column Formatter in SharePoint Online
Column Formatter in SharePoint OnlineColumn Formatter in SharePoint Online
Column Formatter in SharePoint Online
Mark Rackley
 
SharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFXSharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
Mark Rackley
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??Mark Rackley
 
Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)
Mark Rackley
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
Mark Rackley
 
SPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery EssentialsSPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery Essentials
Mark Rackley
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsMark Rackley
 

More from Mark Rackley (9)

Column Formatter in SharePoint Online
Column Formatter in SharePoint OnlineColumn Formatter in SharePoint Online
Column Formatter in SharePoint Online
 
SharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFXSharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFX
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??
 
Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)Wrapping your head around the SharePoint Beast (For the rest of us)
Wrapping your head around the SharePoint Beast (For the rest of us)
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
 
SPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery EssentialsSPSTC - SharePoint & jQuery Essentials
SPSTC - SharePoint & jQuery Essentials
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
 

Recently uploaded

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

Utilizing jQuery in SharePoint: Get More Done Faster

  • 1. SPS Omaha Mark Rackley mrackley@paitgroup.com Utilizing jQuery in SharePoint: Get More Done Faster
  • 2. © 2015 PAIT Group Mark Rackley / Partner & CSO • 20+ years software architecture and development experience • Office 365 MVP, SharePoint Junkie since 2007 • Event Organizer (SharePointalooza.org) • Blogger, Writer, Speaker • Bacon aficionado @mrackley www.MarkRackley.net www.PAITGroup.com www.SharePointaLooza.org www.StratusForms.com #SayNoToInfoPath
  • 3. © 2015 PAIT Group Agenda • What is jQuery? • Why SharePoint & jQuery? • Deploying / Maintaining • Development Basics • Third Party Libraries • jQuery UI Demo
  • 4. © 2015 PAIT Group What is jQuery? • JavaScript Utility Library • jQuery() or $() • Allows interaction and manipulation of the DOM after page is rendered • Can interact with other systems using Web Services • Supported by Microsoft • Part of “Client Side” Development
  • 6. © 2015 PAIT Group Why SharePoint & jQuery? Turn This…
  • 7. © 2015 PAIT Group Why SharePoint & jQuery? Into This… http://www.markrackley.net/2015/08/16/sharepoint-tabbed-web-partshillbillytabs-3-0/
  • 8. © 2015 PAIT Group Why SharePoint & jQuery? And This…
  • 9. © 2015 PAIT Group Why SharePoint & jQuery? Into This… http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
  • 10. © 2015 PAIT Group Why SharePoint & jQuery?
  • 11. © 2015 PAIT Group Why SharePoint & jQuery? • Let SharePoint do the heavy lifting! • Page Modifications • Remove Clutter • Improve Flow • Add business logic to forms • Call Web Services • Basic Workflow • Create/update/delete items based on user choices • Pull data in from other lists and sites • Create dashboards • TONS of free 3rd party libraries • Graphs, charts, dialogs, animations, etc
  • 12. © 2015 PAIT Group jQuery & SharePoint Basics The development process: • Create a Script • Add script to a page in SharePoint • Viola! Why? • Works in SharePoint 2007,2010,2013, & O365 • Great stepping stone to SharePoint Hosted whatever-they’re- called-today • No Visual Studio • No Add-in model • No Oauth (yay!)
  • 13. © 2015 PAIT Group jQuery & SharePoint Basics • Scripts execute with same privileges as current user • Permissions cannot be elevated • Interact with SharePoint List data using JavaScript Client Side Object Model (JSOM), REST, or SPServices • Deployment options • Add-In Model • Sandbox Solutions • Manual • SharePoint Framework???
  • 14. © 2015 PAIT Group jQuery Methods Commonly Used in SharePoint •Learn how SharePoint builds a page and how to traverse the DOM • Show / Hide information • Get / Set field values • Bind to events on elements
  • 15. © 2015 PAIT Group jQuery Basics <script type="text/javascript"> $(document).ready(function($){ //this script executes after the page is loaded //if you need to interact with the DOM put script here }) //Script placed here would execute before the page is finished loading. </script>
  • 16. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
  • 17. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the element by ID: $(“#myID”);
  • 18. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the element by attribute: $(“div[attribute=‘myAttribute’]”);
  • 19. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve every div on the page $(“div”).each(function() { //”this” is the current element in each loop $(this).method(); }); //Hide all divs on the page $(“div”).hide();
  • 20. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve every div of a specific class $(“div.myClass”).each(function() { //”this” is the current element in each loop $(this).method(); }); //Hide all divs of a specific class on the page $(“div.myClass”).hide(); //Hide all elements of a specific class on the page $(“.myClass”).hide();
  • 21. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the div that contains content “World” $(“div:contains(‘World’)”).each(function() { //”this” is the current element in each loop $(this).method(); });
  • 22. © 2015 PAIT Group jQuery Basics <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the formatted HTML for an element $(“#myID”).html(); //returns <b>Hello World</b> //Set the formatted HTML for an element $(“#myID”).html(“<b>Hello Nurse</b>”); //Retrieve the text with HTML formatting stripped out $(“#myID”).text(); //returns Hello World //Set the unformatted text of an element $(“#myID”).text(“Hello Nurse”);
  • 23. © 2015 PAIT Group MORE jQuery basics • //get input / select values • $(“#id”).val(); • //set input / select values • $(“#id”).val(“value”); • //uncheck a check box • $(“#id").removeAttr('checked'); • //check a check box • $(“#id").attr('checked','checked'); • //is a check box checked? • if ($(“#id”).is(':checked'))
  • 24. © 2015 PAIT Group MORE jQuery basics <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
  • 25. © 2015 PAIT Group MORE jQuery basics <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr> • //get the row that contains the div “myElement” • $(“#myElement”).closest(“tr”); • //get the cell that contains the div “myElement” • $(“#myElement”).closest(“td”); • Or • $(“#myElement”).parent();
  • 26. © 2015 PAIT Group MORE jQuery basics <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr> • //get the div AFTER myElement • $(“#myElement”).next(“div”); • Or • $(“#myElement”).next(); • //get the div BEFORE myOtherelement • $(“#myOtherElement”).prev(“div”); • Or • $(“#myOtherElement”).prev();
  • 27. © 2015 PAIT Group Chaining • //find the input element that has the “title” attribute equal to “Name” • //then find it’s parent cell’s previous cell. Then find the “h3” element and replace the HTML • $("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <font color='red'>*</font>"); • //In English: Find the label for the field “Name” and change it to “File Name” and add a red astrisk • //find the input element that has the “title” attribute equal to “City” • //then hide the entire row that contains the input • $(“input[title=‘City’]”).closest(“tr”).hide(); • //In English: Hide the SharePoint Form Field and label for the field with the Display • //name “City”
  • 28. © 2015 PAIT Group How About Some Best Practices? • Use the Element’s ID when possible • Reduce DOM searches • Re-use code / Good coding practices • Minimize files • Use animations to hide slow performance • Delay loading of Selects until you need the data
  • 29. © 2015 PAIT Group Using Third Party Libraries • Tips for selection and integration • Look for supported / documented libraries • Test in target browsers before implementing • Duplicate file structure • Test “vanilla” in SharePoint first
  • 30. © 2015 PAIT Group Using Third Party Libraries • Some of my favorites • Content Slider - http://unslider.com • Formatted Tables - http://www.datatables.net/ • Modal Window - http://www.ericmmartin.com/projects/simplemodal/ • Calendar - http://arshaw.com/fullcalendar/ • StratusForms #SayNoToInfoPath – http://www.stratusforms.com • Draw on a canvas - http://intridea.github.io/sketch.js/ • Responsive tiles - http://masonry.desandro.com/ • Flip w/ 3D animation - https://nnattawat.github.io/flip/
  • 31. Let’s DO some stuff!!! I know!! It’s about time? Right?
  • 32. © 2015 PAIT Group jQueryUI •http://jqueryui.com/ •jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.
  • 33. © 2015 PAIT Group jQueryUI– Basic Usage - Tabs <div id="tabs"> <ul> <li><a href="#tabs-1">Tab 1 title</a></li> <li><a href="#tabs-2">Tab 2 title</a></li> <li><a href="#tabs-3">Tab 3 title</a></li> </ul> <div id="tabs-1"> <p>content in tab 1</p> </div> <div id="tabs-2"> <p>content in tab 2</p> </div> <div id="tabs-3"> <p>content in tab 3</p> </div> </div> <script> $(function() { $( "#tabs" ).tabs(); }); </script>
  • 34. jQuery UI Tabs Demo http://www.markrackley.net/2015/08/16/share point-tabbed-web-partshillbillytabs-3-0