Skip to main content

Posts

Showing posts with the label JavaScript

How to delete duplicates from SharePoint list using JSOM

How to delete duplicates from SharePoint list using JSOM, Credit: Thulasi Pasam Reference:  https://community.nintex.com/thread/8516 Note: Make sure the reference file paths Make sure the column to test duplicate on CAML query Update your SharePoint list name <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=5, IE=8, IE=9, IE=10" > </head> <body> <div Id="myDiv" style= "width: 75%;"> <table id="tblHeading"  width = "100%" align = "left"> <tr style ="width:100%;"> <td><input type= "button" onclick="Delete()" align = "Center" alt="Delete Duplicates" value="Delete...

GetListItem and UpdateListItem using SPServices in MOSS 2007

GetListItem and UpdateListItem using SPServices in MOSS 2007 $(document).ready(function() { var itemToUpdate = GetListItem(); UpdateListItem(itemToUpdate); }); function GetListItem(){ var today = new Date(); var dayOfWeek = today.getDay(); var itemID = 0; var out = ""; var titleField = "<FieldRef Name='Title' />"; var descriptionField = "<FieldRef Name='Description' />"; var viewFields = "<ViewFields>" + titleField + descriptionField + "</ViewFields>"; var myQuery = "<Query>" + "<OrderBy>" + "<FieldRef Name='ItemOrder' Ascending='True'/>" + "</OrderBy>" + "</Query>"; $().SPServices({ operation: "GetListItems", async: false, listName: "MyList", CAMLQuery: myQuery,   CAMLViewFields: viewFields, completefunc: fun...

How to move list paging in top right corner in SharePoint 2013

Add script editor web part and paste the below code to move list paging in top right corner in SharePoint 2013, < script type = "text/javascript" > $ ( document ).ready( function () {   var header = $ ( "table.ms-listviewtable" );   var table = $ ( "#bottomPagingCellWPQ3" );     if (header & & table)     {         table. insertBefore (header);         $ ( "#bottomPagingCellWPQ3" ).css( 'text-align' , 'right' );     }     else     {         alert ( 'jQuery did not found Elements.' );     } }); </ script > < style type = "text/css" > td #bottomPagingCellWPQ3 {float:right} </ style > Hope this helps!!!

Set height of page to full screen from JavaScript

Call any of the following JS method onload of body like to set the height of page to full screen. function resizehtml() {             window.moveTo(0, 0);             window.resizeTo(screen.availWidth, screen.availHeight);         } function setPanelHeight() {                         var hederHeight = document.getElementById('header').offsetHeight;             var footerHeight = document.getElementById('footer').offsetHeight;             var contentHeight = document.getElementById('content').offsetHeight;             height = document.body.clientHeight - hederHeight - f...