Posts

Showing posts with the label JavaScript

PropretyBag with JavaScript in SharePoint 2013

Image
Hello,
as we know, Property bag are very important in SharePoint development, and to get it with JavaScript is very simple :



//wait until client object model dependencies are loaded before executing our code ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js"); varwebProperties;

Activate / Deactivate Feature with PowerShell on all site collections of the webapp

Image
Hello,


When we do some change on the solution  specially on the branding  for exmple ( display teamplate),we should update also existing sites collection and replace old files with new one after the deployment. So this powershell Script with do this on the all farm. $feature = Get-SPFeature -Identity "ID OF THE FEATURE" $siteCollections = Get-SPSite –WebApplication $webhubUrl -Limit ALL $siteCollections | foreach-object {    Write-Host "Deactivating" $feature.DisplayName "on" $_.Url -foregroundcolor yellow    Disable-SPFeature $feature -Url $_.Url -confirm:$false
} $siteCollections | foreach-object {    Write-Host "Activating" $feature.DisplayName "on" $_.Url -foregroundcolor green    Enable-SPFeature $feature -Url $_.Url
}

SharePoint 2013 Autocomplete textbox using the term store and CSOM

Image
Hello Everyone,


you don't have sometimes the idea to customise the textbox by getting the terms from the termstore ?
if yes, continue reading this post,
ok it's very easy let's start:
you need  jQuery UI Autocomplete.  
The code loads the terms from the term store and then sets the source.
  This implementation is really only ideal for a small amount of terms, but it’s enough to get you started.
For this example, I am going to use a simple set of terms using state names in the United States.  My terms are included in a group named Jobs and a Term Set named Persons.  Here is what my term store looks like.

In this example, we’re going to build our code inside a Client Web Part.  Take a look at that post if you are not familiar with the process yet.  We then need to add a heap of JavaScript references.  Some of these are included already, but specifically we need to load SP.Taxonomy.js.  We also need to include init.js as I mentioned in an earlier blog post. <scripttype="…