jQuery programming with visual web part


Published on

Client Object Model Vs jQuery

Published in: Technology
1 Comment
1 Like
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

jQuery programming with visual web part

  1. 1. jQuery Programmingwith Visual Web PartSharePoint 2013 / 2010SharePoint UG 07/May/2013
  2. 2. Agenda What is jQuery? Why jQuery? jQuery Widgets Visual Web Parts and jQuery Demo Deploying jQuery Components with wsp
  3. 3. What is jQuery? jQuery is a library that makes it quicker and easier to build JavaScriptwebpages and web apps jQuery is itself written in JavaScript, and comes in the form of a single .js filethat you link to from your webpage The jQuery library actually comes in 2 forms: The uncompressed .js file is easy to read and modify, but its around 160kb in size(at the time of writing). The minified .js file has all comments, whitespace, and other unnecessarycharacters removed from the file, squeezing the whole library into a mere 23kb.
  4. 4. Why jQuery? Making XML (Ajax) requests. These use JavaScript to request additional datafrom the Web server without having to reload the page. Manipulating the DOM. You can easily add, remove, and reorder content inthe Web page using just a couple of lines of code Adding animated effects to elements. jQuery lets you easily add effects suchas fading in/out, sliding in/out, and expanding/contracting Rich UI animated Controls Available jQuery Plugins – Many reusable plugins available which are ready to use.
  5. 5. jQuery Widgets Accordion Autocomplete Button Datepicker Dialog Menu Progressbar Slider Spinner Tabs Tooltip
  6. 6. Client Object Model vs. jQuery Client Object Model Managed Client - Microsoft.SharePoint.Client.dll Silverlight - Microsoft.SharePoint.Client.Silverlight.dll ECMAScript - SP.js jQuery spservices http://spservices.codeplex.com/ jPoint http://jpoint.codeplex.com/discussions/81945 Raw jQuery http://jquery.com/
  7. 7. Client Object Model
  8. 8. SharePoint 2013 -REST(REpresentational State Transfer) jQuery Programming against list jQuery UI
  9. 9. REST POST – Create lists and sites PUT, PATCH, MERGE for updateClient object model REST equivalentClientContext.Web.Lists http://server/site/_api/web/listsClientContext.Web.Lists[guid] http://server/site/_api/web/lists(‘guid’)ClientContext.Web.Lists.GetByTitle("Title") http://server/site/_api/web/lists/getbytitle(‘Title’)
  10. 10. REST CallArea Access pointSite http://server/site/_api/siteWeb http://server/site/_api/webUser Profile http:// server/site/_api/SP.UserProfiles.PeopleManagerSearch http:// server/site/_api/searchPublishing http:// server/site/_api/publishingTo access a specific site collectionhttp://server/site/_api/siteTo access a specific sitehttp://server/site/_api/webParameterhttp://server/site/_api/web/lists/getByTitle(Announcements)/fields/getByTitle(Description)http://server/site/_api/web/lists(<guid>)/fields/getById(<guid>)Alias (both are same)http://server/site/_api/web/applyWebTemplate("STS#0")http://server/site/_api/web/applyWebTemplate(title=@template)?@template="STS#0“
  11. 11. Sample – Create List
  12. 12. Update List
  13. 13. jQuery UI Demo Accordion Sample