This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BEGIN PERSON OR GROUP QUERY | |
// Queery Person or Group Properties | |
function getItemDetails(webUrl,listTitle,itemId,selectFields, expandFields){ | |
var endpointUrl = webUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/items(" + itemId + ")"; | |
endpointUrl+= '?$select=' + selectFields.join(","); | |
endpointUrl+= '&$expand=' + expandFields.join(","); | |
return executeRequest(endpointUrl,'GET'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
When looping Multiple items from a SharePoint List | |
and You want to render them on UI into individual rows | |
containing only a specific number of columns. :) | |
*/ | |
$(function() { | |
var $render = function (myarr){ | |
console.dir(myarr); // rendering logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
1. The best Idea is that the File Even when Updating other items, | |
will be overwritten, so no need to worry about the update code. | |
:) | |
--> | |
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){ | |
//your code goes here... | |
<div id="message"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Get a SharePoint List Metadata for Use in REST API code. | |
1. Create a List and Add one item into it. | |
2. Create a SitePage and Insert a Script Editor into it. | |
3. Edit the WebPart to insert the code below inside. | |
4. Save the File. | |
5. Open Fiddler and inspect the Data from JSON tab. | |
6. You are good. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dynamic Image Slider for SharePoint | |
// Image Carousel | |
// SharePoint Image Slider | |
$(document).ready(function () { | |
// ### Fecth Data from The List | |
var resourcez = "/_api/web/lists/GetByTitle('SlideMagic')/items?$select=Title,EncodedAbsUrl,Description,Alive"; | |
//var eureka = "$top=3"; | |
var orient = "$orderby=Created desc"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NB: The SiteCollection is Created automatically. If you try to make the collection first | |
an Exception will be thrown; "The Site Collection Already Exists". | |
NB: You don't need the -HostHeaderWebApplication parameter if the site being restored, share | |
the same name as the web application. | |
### Backup | |
Backup-SPSite http://s-hqs-spdev/sites/branding/ -Path C:\COLLECTIONS\Branding.bak –UseSqlSnapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to Create a React Sub Component | |
a. Create File | |
b. Import React Library | |
c. Use createClass() to Define the Component | |
d. Export Component | |
var React = require('react'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add data into a list using CSOM | |
function apbObjectivesSection() { | |
alert("We are in the first function"); | |
var currentCrx = SP.ClientContext.get_current(); | |
var web = currentCrx.get_web(); | |
try { | |
var list = web.get_lists().getByTitle("MyObjectives"); | |
var itemInfoObj = new SP.ListItemCreationInformation(); |