Movatterモバイル変換


[0]ホーム

URL:


Mark Rackley, profile picture
Uploaded byMark Rackley
PPTX, PDF1,018 views

SPTechCon Boston 2015 - Utilizing jQuery in SharePoint

This document provides an overview of using jQuery in SharePoint. It discusses what jQuery is, why it is useful for SharePoint development, and how to deploy and develop with jQuery in SharePoint. It provides examples of common jQuery methods and best practices. It also demonstrates using the jQuery UI library to add tabs to a page.

Embed presentation

Downloaded 23 times
© 2003-2014 PAIT GroupUtilizing jQuery in SharePointGet More Done FasterMark Rackleymrackley@paitgroup.comSPTechCon Boston
Mark Rackley / Partner & CTO• 20+ years software architecture anddevelopment experience• Office 365 MVP, SharePoint Junkiesince 2007• Event Organizer(SharePointalooza.org)• Blogger, Writer, Speaker• Bacon aficionado@mrackleywww.SharePointHillbilly.comwww.PaitGroup.comwww.SharePointaLooza.orgwww.StratusForms.com
Agenda• What is jQuery?• Why SharePoint & jQuery?• Deploying / Maintaining• Development Basics• Third Party Libraries• jQuery UI DemoThe SharePoint & jQuery Guidehttp://bit.ly/jQueryAndSP
What is jQuery?• JavaScript Utility Library• jQuery() or $()• Allows interaction and manipulation of theDOM after page is rendered• Can interact with other systems using WebServices• Supported by Microsoft• Part of “Client Side” Development
Why SharePoint & jQuery?
Why SharePoint & jQuery?Turn This…
Why SharePoint & jQuery?Into This…http://www.markrackley.net/2014/11/25/sharepoint-tabbed-web-partshillbillytabs2-0/
Why SharePoint & jQuery?And This…
Why SharePoint & jQuery?Into This…http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
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
jQuery & SharePoint BasicsThe 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 Hostedwhatever-they’re-called-today• No Visual Studio• No Add-in model• No Oauth (yay!)
jQuery & SharePoint Basics• Scripts execute with same privileges as current user• Permissions cannot be elevated• Interact with SharePoint List data using JavaScriptClient Side Object Model (JSOM), REST, or SPServices• Deployment options• Add-In Model• Sandbox Solutions• Manual
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
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>
jQuery Basics<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
jQuery Basics<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>//Retrieve the element by ID:$(“#myID”);
jQuery Basics<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>//Retrieve the element by attribute:$(“div[attribute=‘myAttribute’]”);
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();
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();
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();});
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”);
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'))
MORE jQuery basics<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
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();
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();
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 replacethe HTML• $("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <fontcolor='red'>*</font>");• //In English: Find the label for the field “Name” and change it to “File Name” andadd 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 theDisplay• //name “City”
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 thedata
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
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/• SPServices - http://spservices.codeplex.com/• Calendar - http://arshaw.com/fullcalendar/• Stratus Forms – http://www.stratusforms.com
Let’s DO some stuff!!!I know!! It’s about time? Right?
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 youjust need to add a date picker to a form control, jQuery UI is theperfect choice.
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>
jQueryUI demo
Mark Rackleymrackley@paitgroup.comwww.markrackley.net@mrackley

Recommended

PPTX
SPTechCon DevDays - SharePoint & jQuery
PPTX
SPTechCon Dev Days - Third Party jQuery Libraries
PPTX
SharePoint & jQuery Guide - SPSNashville 2014
PPTX
(Updated) SharePoint & jQuery Guide
PPTX
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
PPTX
SPTechCon 2014 How to develop and debug client side code in SharePoint
PPTX
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
PPTX
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
PPTX
A Power User's Intro to jQuery Awesomeness in SharePoint
PPTX
The SharePoint & jQuery Guide - Updated 1/14/14
PPTX
Intro to SharePoint Web Services
PPTX
SPSNH 2014 - The SharePoint & jQueryGuide
PPTX
SharePoint & jQuery Guide - SPSTC 5/18/2013
PPTX
Introduction to StratusForms #SayNoToInfoPath
PPTX
Introduction to Client Side Dev in SharePoint Workshop
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
PPTX
Using jQuery to Maximize Form Usability
PPTX
What is SharePoint Development??
PPTX
SharePoint Saturday St. Louis - SharePoint & jQuery
PPTX
SPTechCon - Share point and jquery essentials
PPTX
Introduction to using jQuery with SharePoint
PPTX
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
PPTX
SharePoint REST vs CSOM
PDF
NOW I Get it!! What SharePoint IS and why I need it
PPTX
SEF2013 - A jQuery Primer for SharePoint
PPTX
A Power User's intro to jQuery awesomeness in SharePoint
PPTX
Bringing HTML5 alive in SharePoint
PPTX
The SharePoint & jQuery Guide
PPTX
The Slippery Slope of Migrating to SharePoint Online or On-Premise
PPTX
How Office 365 is Changing the Face of Collaboration and Communication

More Related Content

PPTX
SPTechCon DevDays - SharePoint & jQuery
PPTX
SPTechCon Dev Days - Third Party jQuery Libraries
PPTX
SharePoint & jQuery Guide - SPSNashville 2014
PPTX
(Updated) SharePoint & jQuery Guide
PPTX
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
PPTX
SPTechCon 2014 How to develop and debug client side code in SharePoint
PPTX
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
PPTX
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
SPTechCon DevDays - SharePoint & jQuery
SPTechCon Dev Days - Third Party jQuery Libraries
SharePoint & jQuery Guide - SPSNashville 2014
(Updated) SharePoint & jQuery Guide
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...

What's hot

PPTX
A Power User's Intro to jQuery Awesomeness in SharePoint
PPTX
The SharePoint & jQuery Guide - Updated 1/14/14
PPTX
Intro to SharePoint Web Services
PPTX
SPSNH 2014 - The SharePoint & jQueryGuide
PPTX
SharePoint & jQuery Guide - SPSTC 5/18/2013
PPTX
Introduction to StratusForms #SayNoToInfoPath
PPTX
Introduction to Client Side Dev in SharePoint Workshop
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
PPTX
Using jQuery to Maximize Form Usability
PPTX
What is SharePoint Development??
PPTX
SharePoint Saturday St. Louis - SharePoint & jQuery
PPTX
SPTechCon - Share point and jquery essentials
PPTX
Introduction to using jQuery with SharePoint
PPTX
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
PPTX
SharePoint REST vs CSOM
PDF
NOW I Get it!! What SharePoint IS and why I need it
PPTX
SEF2013 - A jQuery Primer for SharePoint
PPTX
A Power User's intro to jQuery awesomeness in SharePoint
PPTX
Bringing HTML5 alive in SharePoint
PPTX
The SharePoint & jQuery Guide
A Power User's Intro to jQuery Awesomeness in SharePoint
The SharePoint & jQuery Guide - Updated 1/14/14
Intro to SharePoint Web Services
SPSNH 2014 - The SharePoint & jQueryGuide
SharePoint & jQuery Guide - SPSTC 5/18/2013
Introduction to StratusForms #SayNoToInfoPath
Introduction to Client Side Dev in SharePoint Workshop
SPSDenver - SharePoint & jQuery - What I wish I would have known
Using jQuery to Maximize Form Usability
What is SharePoint Development??
SharePoint Saturday St. Louis - SharePoint & jQuery
SPTechCon - Share point and jquery essentials
Introduction to using jQuery with SharePoint
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
SharePoint REST vs CSOM
NOW I Get it!! What SharePoint IS and why I need it
SEF2013 - A jQuery Primer for SharePoint
A Power User's intro to jQuery awesomeness in SharePoint
Bringing HTML5 alive in SharePoint
The SharePoint & jQuery Guide

Viewers also liked

PPTX
The Slippery Slope of Migrating to SharePoint Online or On-Premise
PPTX
How Office 365 is Changing the Face of Collaboration and Communication
PPTX
Enhance SharePoint 2013 with Responsive Web Design
PPTX
What IS SharePoint Development?
PPTX
The Social Enterprise In A Cloud First And Mobile First World - SPTechCon
PPTX
How To Decide When To Use What In Office 365 - SPTechCon 2015
PPTX
10 Golden Rules for S/4 HANA Migrations
The Slippery Slope of Migrating to SharePoint Online or On-Premise
How Office 365 is Changing the Face of Collaboration and Communication
Enhance SharePoint 2013 with Responsive Web Design
What IS SharePoint Development?
The Social Enterprise In A Cloud First And Mobile First World - SPTechCon
How To Decide When To Use What In Office 365 - SPTechCon 2015
10 Golden Rules for S/4 HANA Migrations

Similar to SPTechCon Boston 2015 - Utilizing jQuery in SharePoint

PPTX
Utilizing jQuery in SharePoint: Get More Done Faster
PPTX
SPSTC - SharePoint & jQuery Essentials
PPTX
SharePoint and jQuery Essentials
PPTX
Spsemea j query
PPTX
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
PPTX
SharePoint Cincy 2012 - jQuery essentials
PPTX
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
PPTX
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
PPT
Kick start with j query
KEY
jQuery Performance Tips and Tricks (2011)
KEY
Bcblackpool jquery tips
PPTX
Introduction to jQuery
PPT
J query module1
PPTX
Jquery
PDF
jQuery Rescue Adventure
PPTX
PPTX
Jquery Complete Presentation along with Javascript Basics
PPTX
Spsbe2012 sessie start to-jquery
KEY
jQuery: Tips, tricks and hints for better development and Performance
PPTX
Unit-III_JQuery.pptx engineering subject for third year students
Utilizing jQuery in SharePoint: Get More Done Faster
SPSTC - SharePoint & jQuery Essentials
SharePoint and jQuery Essentials
Spsemea j query
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
SharePoint Cincy 2012 - jQuery essentials
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
Kick start with j query
jQuery Performance Tips and Tricks (2011)
Bcblackpool jquery tips
Introduction to jQuery
J query module1
Jquery
jQuery Rescue Adventure
Jquery Complete Presentation along with Javascript Basics
Spsbe2012 sessie start to-jquery
jQuery: Tips, tricks and hints for better development and Performance
Unit-III_JQuery.pptx engineering subject for third year students

Recently uploaded

PPTX
cybercrime in Information security .pptx
PPTX
Unit-4-ARTIFICIAL NEURAL NETWORKS.pptx ANN ppt Artificial neural network
PPTX
wob-report.pptxwob-report.pptxwob-report.pptx
PDF
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
PDF
Security Forum Sessions from Houston 2025 Event
PDF
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
PPTX
Coded Agents – with UiPath SDK + LangGraph [Virtual Hands-on Workshop]
PPTX
Data Privacy and Protection: Safeguarding Information in a Connected World
PPTX
From Backup to Resilience: How MSPs Are Preparing for 2026
 
PDF
GPUS and How to Program Them by Manya Bansal
PPT
software-security-intro in information security.ppt
PDF
ElyriaSoftware — Powering the Future with Blockchain Innovation
PPTX
Conversational Agents – Building Intelligent Assistants [Virtual Hands-on Wor...
PDF
API-First Architecture in Financial Systems
PPTX
THIS IS CYBER SECURITY NOTES USED IN CLASS ON VARIOUS TOPICS USED IN CYBERSEC...
PDF
Is It Possible to Have Wi-Fi Without an Internet Provider
PDF
Unser Jahresrückblick – MarvelClient in 2025
PDF
Decoding the DNA: The Digital Networks Act, the Open Internet, and IP interco...
PDF
Energy Storage Landscape Clean Energy Ministerial
PDF
Security Technologys: Access Control, Firewall, VPN
cybercrime in Information security .pptx
Unit-4-ARTIFICIAL NEURAL NETWORKS.pptx ANN ppt Artificial neural network
wob-report.pptxwob-report.pptxwob-report.pptx
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
Security Forum Sessions from Houston 2025 Event
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
Coded Agents – with UiPath SDK + LangGraph [Virtual Hands-on Workshop]
Data Privacy and Protection: Safeguarding Information in a Connected World
From Backup to Resilience: How MSPs Are Preparing for 2026
 
GPUS and How to Program Them by Manya Bansal
software-security-intro in information security.ppt
ElyriaSoftware — Powering the Future with Blockchain Innovation
Conversational Agents – Building Intelligent Assistants [Virtual Hands-on Wor...
API-First Architecture in Financial Systems
THIS IS CYBER SECURITY NOTES USED IN CLASS ON VARIOUS TOPICS USED IN CYBERSEC...
Is It Possible to Have Wi-Fi Without an Internet Provider
Unser Jahresrückblick – MarvelClient in 2025
Decoding the DNA: The Digital Networks Act, the Open Internet, and IP interco...
Energy Storage Landscape Clean Energy Ministerial
Security Technologys: Access Control, Firewall, VPN

SPTechCon Boston 2015 - Utilizing jQuery in SharePoint

  • 1.
    © 2003-2014 PAITGroupUtilizing jQuery in SharePointGet More Done FasterMark Rackleymrackley@paitgroup.comSPTechCon Boston
  • 2.
    Mark Rackley /Partner & CTO• 20+ years software architecture anddevelopment experience• Office 365 MVP, SharePoint Junkiesince 2007• Event Organizer(SharePointalooza.org)• Blogger, Writer, Speaker• Bacon aficionado@mrackleywww.SharePointHillbilly.comwww.PaitGroup.comwww.SharePointaLooza.orgwww.StratusForms.com
  • 3.
    Agenda• What isjQuery?• Why SharePoint & jQuery?• Deploying / Maintaining• Development Basics• Third Party Libraries• jQuery UI DemoThe SharePoint & jQuery Guidehttp://bit.ly/jQueryAndSP
  • 4.
    What is jQuery?•JavaScript Utility Library• jQuery() or $()• Allows interaction and manipulation of theDOM after page is rendered• Can interact with other systems using WebServices• Supported by Microsoft• Part of “Client Side” Development
  • 5.
  • 6.
    Why SharePoint &jQuery?Turn This…
  • 7.
    Why SharePoint &jQuery?Into This…http://www.markrackley.net/2014/11/25/sharepoint-tabbed-web-partshillbillytabs2-0/
  • 8.
    Why SharePoint &jQuery?And This…
  • 9.
    Why SharePoint &jQuery?Into This…http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
  • 10.
    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
  • 11.
    jQuery & SharePointBasicsThe 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 Hostedwhatever-they’re-called-today• No Visual Studio• No Add-in model• No Oauth (yay!)
  • 12.
    jQuery & SharePointBasics• Scripts execute with same privileges as current user• Permissions cannot be elevated• Interact with SharePoint List data using JavaScriptClient Side Object Model (JSOM), REST, or SPServices• Deployment options• Add-In Model• Sandbox Solutions• Manual
  • 13.
    jQuery Methods CommonlyUsed 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
  • 14.
    jQuery Basics<script type="text/javascript">$(document).ready(function($){//thisscript 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>
  • 15.
    jQuery Basics<div id=“myID”attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
  • 16.
    jQuery Basics<div id=“myID”attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>//Retrieve the element by ID:$(“#myID”);
  • 17.
    jQuery Basics<div id=“myID”attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>//Retrieve the element by attribute:$(“div[attribute=‘myAttribute’]”);
  • 18.
    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();
  • 19.
    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();
  • 20.
    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();});
  • 21.
    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”);
  • 22.
    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'))
  • 23.
    MORE jQuery basics<trid=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
  • 24.
    MORE jQuery basics<trid=‘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();
  • 25.
    MORE jQuery basics<trid=‘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();
  • 26.
    Chaining• //find theinput element that has the “title” attribute equal to “Name”• //then find it’s parent cell’s previous cell. Then find the “h3” element and replacethe HTML• $("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <fontcolor='red'>*</font>");• //In English: Find the label for the field “Name” and change it to “File Name” andadd 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 theDisplay• //name “City”
  • 27.
    How About SomeBest 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 thedata
  • 28.
    Using Third PartyLibraries• Tips for selection and integration• Look for supported / documented libraries• Test in target browsers before implementing• Duplicate file structure• Test “vanilla” in SharePoint first
  • 29.
    Using Third PartyLibraries• Some of my favorites• Content Slider - http://unslider.com• Formatted Tables - http://www.datatables.net/• Modal Window - http://www.ericmmartin.com/projects/simplemodal/• SPServices - http://spservices.codeplex.com/• Calendar - http://arshaw.com/fullcalendar/• Stratus Forms – http://www.stratusforms.com
  • 30.
    Let’s DO somestuff!!!I know!! It’s about time? Right?
  • 31.
    jQueryUI• http://jqueryui.com/• jQueryUI 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 youjust need to add a date picker to a form control, jQuery UI is theperfect choice.
  • 32.
    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>
  • 33.
  • 34.

[8]ページ先頭

©2009-2025 Movatter.jp