Skip to content
View 0.md

SharePoint 2013 Visual Studio Team Foundation Web Parts How To Automatically Refresh Query Results Without Postback Action

You want to refresh the Query Results web parts of Visual Studio Team Foundtion embedded into a web part page, so that every 3 seconds the user has a query updated without having to refresh the entire page. Obviously you want automatically refresh the single web part, not the entire web page.

  1. In Edit mode, search in the web page runtime elements for the keyword "Refresh Results". You should find one or more ie:menuitem elements, many elements as many Query Results web parts you have. See the snippet_menuitem.html below for an example.
  2. The script you are interested to is in the onmenuclick attribute.
  3. After you have taken note of all required onmenuclick values just build you refresher as shown below.
View 0.md

SharePoint 2013 how to CSS Image Sprites: spcommon.png and custom

SharePoint 2013 layouts come with a common image sprite called spcommon.png. We can access this image via CSS sprite with positioning or background technique and reuse standard layout icons in web pages.

The breakdown of css instructions for spcommon.png is documented here: http://ericoverfield.com/sharepoint-2013-spcommon-png-sprite-breakdown/

Basics:

  1. Build a custom CSS file using the image sprite technique
  2. Upload the custom CSS into the asset folder
View 0.md

SharePoint 2013 How To Javascript Callout Manager

Callouts in SharePoint 2013 are now possible with minimal client side scripting thanks to the new callout.js framework. The fastest method is to embed the code into a code web part.

Useful MSDN starter topic: https://msdn.microsoft.com/en-us/library/office/dn135236%28v=office.15%29.aspx

In summary:

  1. Make sure to use SP.SOD.executeFunc to call your code when the callout framework has been loaded.
  2. Get an element as launchpoint from the document. If the element is dynamically created via javascript, a DOM get_element is necessary to correctly reference the launchpoint.
View 0.md

SharePoint 2013 How To XSL Link Option List View Web Part

XSL Link option allows to link an XSLT stylesheet uploaded to the site for processing and transforming List View data to which the web part is connetcted.

The input xml passed to XSLT is described here https://msdn.microsoft.com/en-us/library/office/ff602042(v=office.14).aspx

There are two main ways to work:

  • Just transform input data and render it as wanted
  • Include the default templates and override those as required

SharePoint 2013 How To Client Side Javascript jQuery Ajax Web API REST Data Manipulation Basics

Useful MSDN starter: https://msdn.microsoft.com/en-us/library/office/jj164022.aspx

The fastest and easiest way to load client libraries is by the Embed Code functionality web part directly from a web part page. Reference any js library using script HTML tag.

Reference by CDN or relative URL. Official releases of MS CDNs can be get here http://www.asp.net/ajax/cdn.

Data request with json header results in a easier response to work with. The response returns an object with an array of items stored in data.d.results. The columns values can be normally accessed by name, eg: item.Title.

View function-v2.ps1
function <name>
{
<#
.SYNOPSIS
The synopsis goes here. This can be one line, or many.
.DESCRIPTION
The description is usually a longer, more detailed explanation of what the script or function does. Take as many lines as you need.
.PARAMETER computername
View zootool-slideshow.js
function startCamera() {$('#camera_wrap').camera({ fx: 'scrollLeft', time: 2000, loader: 'none', playPause: false, height: '65%', pagination: true });}
$(document).ready(function(){
$.ajax({
url: "http://zootool.com/api/users/items/?username=<user>&apikey=<apikey>&limit=30",
dataType: 'jsonp',
success: function(results){
View Create-SP-Std-Security.ps1
$weburl
$webname
###### Get the web object that requires the new groups
$web = Get-SPWeb $weburl
###### If the web object is currently inheriting permission then break the inheritance
View sqlsearchcolumns.sql
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%INSERTHERECOLUMNKEYWORD%'
ORDER BY schema_name, table_name;
View NOT WORKING PlaceHolderMain
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<script type="text/javascript">
window.onload = function() {
ExecuteOrDelayUntilScriptLoaded(ViewItem, "sp.js");
}
</script>
<div id="test">
Something went wrong with that request. Please try again.