CHUVASH.eu

CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: Libraries

Toastr.js and SharePoint

Have you used SharePoint javascript Notifications (SP.UI.Notify)? Are you looking for something new and fresh? Well then check out the Toastr.js – a simple, beautiful, fully responsive and light-weight javascript lib for notifications, developed by John Papa and Hans Fjällemark and released under the MIT License.

By the way, toastr was one of many things I discovered and learned on John Papa’s online course by pluralsight: Single Page Apps with HTML5, Web API, Knockout and jQuery. It is a really awesome course, where you learn how to create an amazing SPA.

Well, how’s about SharePoint. While whatching the course videos about toastr, I thought: Can we use it in SharePoint? Yes we can!

Just load the toastr css and js and start using it:

toastr.success("Data has been saved successfully!", "Looks very nice")

 

The easiest way to get the toastr in your project is to install the toastr nuget package:

Install-Package toastr

JSOM: Last Modified Date of a List

The data transfer between server and client can heavily affect the performance. One of the measures to reduce the amount data transferred from the server to the client is storing data on the client. In many modern browsers we can use html5 localStorage. Even in older browsers there are ways to store data.

I would recommend a nice js lib called amplify.js. The interface is much easier, then:

amplify.store("key", { title: "value" });

It comes in nicely, if we have much data which we get with JSOM. But we have to care about eventual changes to list items done after we got them the last time.

So we have to store the last modified date. This property is also available in JSOM:

var ctx = SP.ClientContext.get_current();
var web = ctx.get_web();
var lists = web.get_lists();
var list = lists.getByTitle("Tasks");
ctx.load(list, "LastItemModifiedDate");
ctx.executeQueryAsync(
	function() {
		var lastmodified = list.get_lastItemModifiedDate();
	},
	function() {}
);

Be sure you load only the properties you need:

ctx.load(list, "LastItemModifiedDate");

I took a screenshot to show the difference:

Next time we want to load our items, we can check if we have them saved locally and get the last modified date of the list. If this hasn’t changed, just load from the localStorage.

Another property to keep an eye for is “LastItemDeletedDate”…

Version 0.2.2: Added libraries

Libraries are now present on the LUSites map. The list of Lund University Libraries was taken from the official site.

Committed on Github, but not published on Market.

Here is the coordinates of the libraries, their addresses and the CSV-file which is located in /res/raw/libraries_utf8.csv in the LUSites project.

Read more of this post

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Coder, Speaker, Author

Office 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Paul J. Swider - RealActivity

RealActivity is a specialized Microsoft healthcare services and solution advisory firm.

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders

paul.tavares

Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant

SPJoel

SharePoint for everyone

SharePointRyan

Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint

blksthl

Mostly what I know about SharePoint - CommunicoCuspis