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
function parseTaxonomySearchResultValue(val){ | |
var taxValue = {TermSetGuids: [], TermValues: []}; | |
var parts = val.split(';'); | |
parts.forEach(function(part){ | |
if (part.startsWith("GP0|#")) //term? | |
{ | |
var termGuid = part.replace("GP0|#", ""); | |
taxValue.TermValues.push({ TermGuid: termGuid}); | |
} | |
else if (part.startsWith("GTSet|#")) //term set? |
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
var rextension = { | |
CreateTableFromJson: function (options){ | |
/* | |
var options ={ | |
data: results, | |
container: "#jsontotable", | |
FieldNotToPopulate: ["id","uri","etag","type","Id","TermGuid","type","Label","WssId"] | |
}; | |
*/ | |
console.log(options); |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<%@ Page Language="C#" %> | |
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> | |
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<meta name="WebPartPageExpansion" content="full" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Diable Thrid Level TermSet</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=10" /> |
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
//An Example of Using SPTrick, uses SetValueForPeoplPicker & GetFieldControl | |
$.when( $.SetValueForPeoplPicker('Requestor',G_CurrentUserEmail)).then(function(){ | |
$.GetFieldControl('Requestor').attr("disabled","disabled").find(".sp-peoplepicker-delImage").hide(); | |
}); |
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
function GetUserProfileProperties() { | |
var userProfileProperties; | |
var peopleManager = new SP.UserProfiles.PeopleManager(rClientContext); | |
userProfileProperties = peopleManager.getMyProperties(); | |
rClientContext.load(userProfileProperties); | |
rClientContext.executeQueryAsync(onRequestSuccess, onRequestFail); | |
function onRequestSuccess() { | |
//https://unicef-my.sharepoint.com/_layouts/15/EditProfile.aspx?UserSettingsProvider=dfb95e82-8132-404b-b693-25418fdac9b6 | |
//The list of properties |
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
$(document).ready(function(){ | |
$("BODY").append('<div id="dialog-message" title="In Progress">\ | |
<div id="progressbar"></div>\ | |
</div>'); | |
}); | |
function ShowDialog() { | |
$( "#dialog-message" ).dialog({ | |
dialogClass: "no-close", | |
modal: true |
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
log("CountryRegion"); | |
function AddCountryToField(dutyStationFieldName,countryFieldName,regionFieldName){ | |
var d = $.Deferred(); | |
var DutyStationTermsetName = "6e8c6e86-6359-4685-9284-1fcbf0629093"; //DutyStationTermsetID | |
var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(rClientContext); | |
var termStores = taxSession.get_termStores(); | |
var termStore = taxSession.getDefaultSiteCollectionTermStore(); | |
var termSet = termStore.getTermSet(DutyStationTermsetName); |
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
$("[ID*='RequestorDutyStation']").find('[contenteditable]').attr('contenteditable','false').end().find('IMG').hide(); |
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
if (typeof console == "undefined") { this.console = {log: function() {}}; }//If browser doesn't support console.log | |
//OTO = One Time Object | |
var rClientContext;//A context OTO used everywhere | |
var rWeb;//A web OTO used | |
var rCurrentUser;// A user OTO | |
$(document).ready(function(){ | |
rClientContext = SP.ClientContext.get_current(); | |
rWeb = rClientContext.get_web(); |