Posts

Showing posts from April, 2017

Using Angular - Filter and Sort a Table

Image
Using Angular Filter and Sort a Table In this post, we’ll be looking at a way to filter and sort our data in the table. When building Angular applications, one of the cornerstones we will use is ng-repeat . Showing data is something that we do in applications like when we show a table of users or whatever other data we need to show our users. This is a common feature that is always useful so let’s look at what we’ll be building and dive right into the code. This demo will allow us to: Show a table of data ( ng-repeat [1]) Sort by ascending or descending columns ( orderBy [2]) Filter by using a search field ( filter [3]) These three common functions in Angular let’s us implement these features in a very simple way.  We'll create a simple module with one controller where we define a few variables and the list of data we’ll show to our users. script: We have created various variables for sorting and searching, and also a list of data's to be displ...

SharePoint 2013 CRUD Operation to List Using Rest API

Image
CRUD Operation to List Using SharePoint 2013 Rest API This post will give you a complete idea about CRUD (Create, Read, Update and Delete) operation in a list of SharePoint 2013 using REST API. REST service for list was first introduced in SharePoint 2010. It was under the end point /_vti_bin/listdata.svc, and it still works in SharePoint 2013. SharePoint 2013 introduces another endpoint /_api/web/lists, and which is much more powerful than in SharePoint 2010. The main advantage of REST in SharePoint 2013 is: we can access data by using any technology that supports REST web request and Open Data Protocol (OData) syntax. That means you can do everything just making HTTP requests to the dedicated endpoints. Available HTTP methods are GET, POST, PUT, MERGE, and PATCH . READ : HTTP GET method is used for any kinds of read operation. CREATE : Any kind of create operation like list, list item, site and so on maps to the HTTP POST method. You have to specify the data in reques...

Sorting DIV's using jQuery

Image
Sort DIVs alphabetically without destroying and recreating the content. Sort a bunch of div elements on my page with the click of a button. 1. Sort the element array with sort()[1]  2. Reattach (in their sorted state) with appendTo()[2] html :   script: Click here to download working sample Reference: [1]. sort() [2]. appendTo()