Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nick Hadlee and Gary Payne. RegisterSod("menu.js", \u002f_layouts\u002f15\u002fmenu.js?rev=pcr83s11QGFA2kL t5rDQ1g\u00253D\u00253D"); //

Similar presentations


Presentation on theme: "Nick Hadlee and Gary Payne. RegisterSod("menu.js", \u002f_layouts\u002f15\u002fmenu.js?rev=pcr83s11QGFA2kL t5rDQ1g\u00253D\u00253D"); //

1 Nick Hadlee and Gary Payne

2

3

4

5

6

7 RegisterSod("menu.js", \u002f_layouts\u002f15\u002fmenu.js?rev=pcr83s11QGFA2kL t5rDQ1g\u00253D\u00253D"); // true"

8

9

10

11

12

13 GetByTitle('Towns')/items?$select=Title

14

15 Getting internal name of list fields getbytitle('Events')/Fields ?$select=Title,InternalName,ID

16

17

18 var clientContext = SP.ClientContext.get_current(); var web = clientContext.get_web(); var list = web.get_lists().getByTitle("Rooms"); var floorChoiceField = clientContext.castTo( list.get_fields().getByInternalNameOrTitle("Floor"), SP.FieldChoice ); clientContext.load(floorChoiceField); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) );

19 var clientContext = SP.ClientContext.get_current(); var web = clientContext.get_web(); var list = web.get_lists().getByTitle("Rooms"); var floorChoiceField = clientContext.castTo( list.get_fields().getByInternalNameOrTitle("Floor"), SP.FieldChoice ); clientContext.load(floorChoiceField); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) );

20 var clientContext = SP.ClientContext.get_current(); var web = clientContext.get_web(); var list = web.get_lists().getByTitle("Rooms"); var floorChoiceField = clientContext.castTo( list.get_fields().getByInternalNameOrTitle("Floor"), SP.FieldChoice ); clientContext.load(floorChoiceField); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) );

21 var clientContext = SP.ClientContext.get_current(); var web = clientContext.get_web(); var list = web.get_lists().getByTitle("Rooms"); var floorChoiceField = clientContext.castTo( list.get_fields().getByInternalNameOrTitle("Floor"), SP.FieldChoice ); clientContext.load(floorChoiceField); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) );

22

23 You can only work with files up to 1.5 MB by using the JavaScript object model. To upload larger files, use REST.

24

25

26 Method of changing how areas of SharePoints UI via JS micro templates Display Templates JSLink or JS Link Search

27 Fields View(s) templates "View" Forms templates "DisplayForm" "EditForm" "NewForm" Views The entire view via an Item template or Body template A field in a view via a View template Can also limit to a specific view and/or list template Xslt List View Web Parts Forms

28 The JavaScript template pattern: (function () { // Initialize the variable that store the objects. var overrideCtx = {}; overrideCtx.Templates = {}; // Do the template bits here // // Register the template overrides. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })();

29 (function () { // Initialize the variable that store the objects. var overrideCtx = {}; overrideCtx.Templates = {}; // A field template. Can be static text or a function overrideCtx.Fields = { LinkTitle = { "View" : "No problem here!" } } // Register the template overrides. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })();

30 (function () { // Initialize the variable that store the objects. var overrideCtx = {}; overrideCtx.Templates = {}; // A field template. Can be static text or a function overrideCtx.Fields = { LinkTitle = { "View" : titleFieldFunction } } // Register the template overrides. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })();

31 function titleFieldFunction (ctx) { // Craft the html to be returned by the function var returnHtml = ""; returnHtml += " "; returnHtml += ctx.CurrentItem.Title; returnHtml += " "; return returnHtml; }

32

33 _spPageContextInfo is a JS object on every SP page _spPageContextInfo.webServerRelativeUrl =9 =9 javascript-current-page-context-info.html javascript-current-page-context-info.html

34

35 Gary Payne Nick

36 Markup and js in notes for this slide

37 Markup and code in notes of this slide

38 Markup and code in notes for this slide

39

40

41 The markup will need to be copied into a.JS file and deployed to a document library, the master page gallery or the _layouts directory on the server. This file is referenced in the JSLink update script on the next slide

42 Markup and code in notes for this slide

43

44 The markup will need to be copied into a.JS file and deployed to a document library, the master page gallery or the _layouts directory on the server.

45 Markup and code in notes for this slide Add the News XSLT List View Web Part to the page and change the JS Link property Add this code to a Script Editor web part This carousel demo uses

46 Thank you to our sponsors


Download ppt "Nick Hadlee and Gary Payne. RegisterSod("menu.js", \u002f_layouts\u002f15\u002fmenu.js?rev=pcr83s11QGFA2kL t5rDQ1g\u00253D\u00253D"); //

Similar presentations


Ads by Google