Posts

Wait dialog in SharePoint 2013 with JavaScript

Some actions in SharePoint (e.g. executing querys) can take a while. You want the user to not do any action or even change the data while your process is running. So you need the wait dialog that SharePoint is displaying some time. Calling the dialog is pretty easy. All you need is a line of code.

Refresh SharePoint ListView without refreshing the page

Of course you have once updated a SharePoint listitem out of the list view. To display the results you've updated the whole page. But you do not need to. With this simple statement you can update the view without any redirect or refreshing of the page:

ClientSideRendering basics 2

Image
In my last post  I extended the view of a list. The goal was to add the unit of measurement next to a numeric value. Now I want to extend it by adding the unit into the forms (new, edit and display) of this list. This is how the form usually looks like: At first we need to write the code.

ClientSideRendering basics

Image
Lists in SharePoint 2013 are very minimal and nice looking. You can have multiple use cases for a list. For example a list of cars. I made a very simple list of cars with three columns: We can see the title the power and the manufacturer, but what is the unit of measurement for the power? To answer this question we should build in the unit.

SharePoint Views [Me]-Filter in Schema.xml

Image
Everybody knows the [Me]-Filter in views. It is a nice way to help me seeing my items. This filter is set in SharePoint pretty fast.. you just need to modify you view, scroll down to the filter region and select a person field and show it if its equals the value "[Me]". It looks like this:

jQuery set the click event the right way

Everybody should know multiple ways how to set click events in JavaScript and jQuery. But if there are multiple different ways which one is the right one? First of all what ways do we have? There are the declaratively ways: 1 2 3 4 5 <!-- declaratively example one --> <a href= "javascript:myFunction()" > click me </a> <!-- declaratively example two --> <button onclick= "myFunction()" > Click me </button>

replace all in JavaScript

Maybe you already had the problem that you needed to use a a simple replace in JavaScript. The problem is while using "string.replace('old string', 'new string')" just the first match will be replaced. This is kind of weird if you are coming from the .Net world. So there are two ways to perform a replace all in JavaScript: the replacing with arrays and the regex replacing